Skip to main content
Custom blocks are real blocks on the server, but Bukkit reports a generic Material for all of them: STONE, GLASS or TRIPWIRE. org.lodemc.api.block.LodeBlocks tells you which custom block is really there and lets you place them.
This covers every kind of custom block: solid, see-through and walk-through blocks, stairs, slabs, trapdoors, doors, crops and saplings. Props aren’t blocks; use LodeProps for them.

LodeBlocks

Finding blocks

PlacedBlock
The custom block at block, with its state, or null for a vanilla block.
boolean
Whether a custom block is at block.
boolean
Whether custom block id is at block.
Collection<CustomBlockType>
Every custom block configured right now.
CustomBlockType
Custom block id, or null. Also takes the id as a String.
CustomBlockType
The custom block a stack places, or null.

Placing blocks

boolean
Places custom block id at block, replacing what’s there. properties sets its state, using the names from getPropertyNames() for cube blocks (axis=x, facing=east, stage=2) or vanilla’s names for stairs, slabs, trapdoors and doors (facing=east, half=top, open=true). Leave it out, or leave a property out, to get the default. Also takes the id as a String.
  • Placed leaves are the kind that never decays, as when a player places them. Add persistent=false to place leaves that decay.
  • Doors get their top half too.
  • Light around a block with light: is added.
  • No events fire and nothing is checked, like /setblock.
Returns false if there’s no such block or the properties don’t fit it.
To place a block as a player would, with protection checks and events, give the player the block’s item instead.

CustomBlockType

A custom block as it’s configured. It’s read-only, and a reload makes new objects. The properties a cube block can have:

PlacedBlock

What LodeBlocks.at returns: a custom block in the world at the moment you asked.

Events

  • CustomBlockPlaceEvent fires when a player places a custom block.
  • CustomBlockBreakEvent fires when a player breaks one.
  • Bukkit’s own BlockPlaceEvent, BlockBreakEvent, BlockDropItemEvent and PlayerInteractEvent fire as for any block. Check them with LodeBlocks.at.