Contains a set of events that will be raised for a block. This object must be bound using the BlockRegistry.

interface BlockCustomComponent {
    beforeOnPlayerPlace?: (
        arg0: BlockComponentPlayerPlaceBeforeEvent,
        arg1: CustomComponentParameters,
    ) => void;
    onEntityFallOn?: (
        arg0: BlockComponentEntityFallOnEvent,
        arg1: CustomComponentParameters,
    ) => void;
    onPlace?: (
        arg0: BlockComponentOnPlaceEvent,
        arg1: CustomComponentParameters,
    ) => void;
    onPlayerDestroy?: (
        arg0: BlockComponentPlayerDestroyEvent,
        arg1: CustomComponentParameters,
    ) => void;
    onPlayerInteract?: (
        arg0: BlockComponentPlayerInteractEvent,
        arg1: CustomComponentParameters,
    ) => void;
    onRandomTick?: (
        arg0: BlockComponentRandomTickEvent,
        arg1: CustomComponentParameters,
    ) => void;
    onStepOff?: (
        arg0: BlockComponentStepOffEvent,
        arg1: CustomComponentParameters,
    ) => void;
    onStepOn?: (
        arg0: BlockComponentStepOnEvent,
        arg1: CustomComponentParameters,
    ) => void;
    onTick?: (
        arg0: BlockComponentTickEvent,
        arg1: CustomComponentParameters,
    ) => void;
}

Properties

beforeOnPlayerPlace?: (
    arg0: BlockComponentPlayerPlaceBeforeEvent,
    arg1: CustomComponentParameters,
) => void

This function will be called before a player places the block.

onEntityFallOn?: (
    arg0: BlockComponentEntityFallOnEvent,
    arg1: CustomComponentParameters,
) => void

This function will be called when an entity falls onto the block that this custom component is bound to.

onPlace?: (
    arg0: BlockComponentOnPlaceEvent,
    arg1: CustomComponentParameters,
) => void

This function will be called when the block that this custom component is bound to is placed.

onPlayerDestroy?: (
    arg0: BlockComponentPlayerDestroyEvent,
    arg1: CustomComponentParameters,
) => void

This function will be called when a player destroys a specific block.

onPlayerInteract?: (
    arg0: BlockComponentPlayerInteractEvent,
    arg1: CustomComponentParameters,
) => void

This function will be called when a player sucessfully interacts with the block that this custom component is bound to.

onRandomTick?: (
    arg0: BlockComponentRandomTickEvent,
    arg1: CustomComponentParameters,
) => void

This function will be called when a block randomly ticks.

onStepOff?: (
    arg0: BlockComponentStepOffEvent,
    arg1: CustomComponentParameters,
) => void

This function will be called when an entity steps off the block that this custom component is bound to.

onStepOn?: (
    arg0: BlockComponentStepOnEvent,
    arg1: CustomComponentParameters,
) => void

This function will be called when an entity steps onto the block that this custom component is bound to.

onTick?: (
    arg0: BlockComponentTickEvent,
    arg1: CustomComponentParameters,
) => void

This function will be called when a block ticks.