The block that this trait will be attached to.
Optional
_options: JSONLikeObjectProtected
Readonly
blockThe block that this trait is attached to.
Readonly
componentsThe block component identifiers that this trait is compatible with. If empty, the trait will not be initialized by any component.
Protected
Readonly
dimensionThe dimension that the block is in.
Readonly
identifierThe identifier of the trait.
Readonly
stateThe block state key that this trait is compatible with. If null, the trait will not be initialized by any block state.
Static
Readonly
componentsThe block component identifiers that this trait is compatible with by default. If empty, the trait will not be initialized by any component.
Static
Readonly
identifierThe identifier of the trait.
Static
Readonly
stateThe block state key that this trait is compatible with by default. If null, the trait will not be initialized by any block state.
Static
Readonly
typesThe block type identifiers that this trait is compatible with by default.
Optional
onCalled when the trait is added to an object.
Optional
onCalled when the block is broken in the world.
Whether the block break was successful; default is true.
Optional
onCalled when a container that is attached to the block is updated.
The container that was updated.
Called when the block is interacted with by a player.
The options of the block interaction.
Whether the interaction was successful; default is true.
Optional
onCalled when a player pick blocks the block.
The player that picked the block.
Whether the player picked the block with a data request.
Optional
onCalled when the block is placed in the world.
The options of the block placement.
Whether the block placement was successful; default is true.
Optional
onCalled when the trait is removed from an object.
Optional
onOptional
onCalled when the block is started to be broken in the world.
The player that started to break the block.
Optional
onCalled when the block is stopped to be broken in the world.
The player that stopped breaking the block.
Optional
onCalled when the trait is ticked by the dimension.
The details about the tick event.
Optional
onCalled when the block is updated in the world.
Optional
source: BlockThe source of the update, if any.
Creates a new instance of the block trait.