The block that this trait will be attached to.
Optional
_options: JSONLikeObjectProtected
Readonly
blockThe block that this trait is attached to.
Readonly
componentThe block component that this trait is attached to.
Protected
Readonly
dimensionThe dimension that the block is in.
Readonly
identifierThe identifier of the trait.
Readonly
stateThe block state key that this trait is attached to.
Readonly
tagThe block tag that this trait is attached to.
Static
Readonly
componentThe block component that this trait is compatible with by default. If null, the trait will not attach to any block by default.
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
tagThe block tag that this trait is compatible with by default. If null, the trait will not attach to any block by default.
Static
Readonly
typesThe block type identifiers that this trait is compatible with by default.
Whether the bounding box of the structure is visible.
True if the bounding box is visible, false otherwise.
Get the structure mode from the structure block.
The mode of the structure block.
Gets the structure offset from the block's NBT data.
The structure offset as an IPosition.
Gets the structure size from the block's NBT data.
The structure size as an IPosition.
Get the structure name from the block's NBT data.
The structure name or an empty string if not set.
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.
Sets whether the bounding box of the structure is visible.
True to make the bounding box visible, false to hide it.
Sets the mode of the structure block.
The mode to set for the structure block.
Sets the structure offset in the block's NBT data.
The offset of the structure to set.
Sets the structure size in the block's NBT data.
The size of the structure to set.
Sets the structure name in the block's NBT data.
The name of the structure to set.
Creates a new instance of the block trait.