Class CustomBlockComponent

Define a custom block component.

~~~ts
// Define the component
const COMPONENT = new CustomBlockComponent("lazuli:example", {
onEntityFallOn(arg) {
arg.dimension.createExplosion(arg.block.location, 5);
},
})
// Registry the component
Register.componentRegistry(COMPONENT);
~~~

Constructors

Properties

Constructors

  • Parameters

    • typeId: string

      The id that represents this custom component. Must have a namespace. This id can be specified in a item's JSON configuration under the 'minecraft:custom_components' item component.

    • components: BlockCustomComponent

      The collection of event functions that will be called when the event occurs on an item using this custom component id.

    Returns CustomBlockComponent

    This function can throw errors.

Properties

components: BlockCustomComponent

The collection of event functions that will be called when the event occurs on an item using this custom component id.

typeId: string

The id that represents this custom component. Must have a namespace. This id can be specified in a item's JSON configuration under the 'minecraft:custom_components' item component.