Making simple block
Well, basicly making a block is like making a custom item. Custom block has CustomBlockData that defines important information about our block.
Placed blocks represented as PlacedBlockData that contain location of this block, UUID, UUID of his owner (can be null) and item that used to place this block.
All events contain PlacedBlockData and bukkit event itself for more control. Most events can be cancelled.
Making new class
Create new class, after that implement a CustomBlock
interface and override blockData
method. blockData method require to return CustomBlockData which contains: Item that represents this block, blockID, material of this block. For work you need that item material and material of block was a block (Material#isBlock
).
Example:
And thats all.
Register custom block
Same thing like custom items. Just use CustomBlockManager for register, getting, placing custom blocks.
Done! Give yourself your item that represents your block and place it. You can do it with /citem
command.
Last updated
Was this helpful?