Block manager

About manager

Custom block manager is similar to custom items manager so for more info read About manager

Access the manager

Managers.getCustomBlockManager();
// or
CustomBlockManager.getManager();

Get registered custom block

CustomBlockManager manager = CustomBlockManager.getManager();

manager.customBlock("ID").ifPresent(block -> {
    // CODE
});
// OR
CustomBlock block = manager.customBlock("ID").orElse(null);

Get all registered blocks

Register a block

Removing a custom block at position

In the second method we see argument "force". Force means that this block will be deleted without notification AKA destroyRequest event will not fire for this instance of block.

Get a block at location

Get all blocks

All block placed by someone

circle-info

This operation is may be slow since this method need to search through all blocks.

All block placed in area

circle-info

This operation may be slow since this method need to search through all blocks.

Place a block

Last updated