The block to create the trait for.
Optionaloptions: Partial<BlockInventoryTraitOptions>The options for the block inventory trait.
Protected ReadonlyblockThe block that this trait is attached to.
ReadonlycomponentThe block component that this trait is attached to.
Protected ReadonlydimensionThe dimension that the block is in.
ReadonlyidentifierThe identifier of the trait.
ProtectedopenedWhether the block is opened or not.
ReadonlystateThe block state key that this trait is attached to.
ReadonlytagThe block tag that this trait is attached to.
Static ReadonlycomponentThe block component that this trait is compatible with by default. If null, the trait will not attach to any block by default.
Static ReadonlyidentifierThe identifier of the trait.
Static ReadonlystateThe block state key that this trait is compatible with by default. If null, the trait will not be initialized by any block state.
Static ReadonlytagThe block tag that this trait is compatible with by default. If null, the trait will not attach to any block by default.
Static ReadonlytypesThe block type identifiers that this trait is compatible with by default.
Called when the trait is added to an object.
Called when the block is broken in the world.
Optionaloptions: BlockDestroyOptionsWhether the block break was successful; default is true.
Called when the state of the inventory is set to close.
Optional_silent: booleanOptionalonCalled 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.
Called when the state of the inventory is set to open.
Optional_silent: booleanOptionalonCalled when a player pick blocks the block.
The player that picked the block.
Whether the player picked the block with a data request.
OptionalonCalled when the block is placed in the world.
The options of the block placement.
Whether the block placement was successful; default is true.
OptionalonCalled when the trait is random ticked by the dimension.
Called when the trait is removed from an object.
OptionalonOptionalonCalled when the block is started to be broken in the world.
The player that started to break the block.
OptionalonCalled when the block is stopped to be broken in the world.
The player that stopped breaking the block.
Called when the trait is ticked by the dimension.
OptionalonCalled when the block is updated in the world.
Optionalsource: BlockThe source of the update, if any.
Sets the probability of this trait being randomly ticked each tick.
The numerator of the probability fraction.
The denominator of the probability fraction.
Wether this trait should be randomly ticked this tick.
A factor to multiply the chance by. Default is 1.
True if the trait should be randomly ticked, false otherwise.
Create a new inventory trait for a specific block.