The item stack that this trait will be attached to.
Optional_options: JSONLikeObjectReadonlyidentifierThe identifier of the trait.
Protected ReadonlyitemThe item stack that this trait is attached to.
Static ReadonlycomponentThe item component(s) that this trait is compatible with by default. If null, the trait will not attach to any item stack by default.
Static ReadonlyidentifierThe identifier of the trait.
Static ReadonlytagThe item tag(s) that this trait is compatible with by default. If null, the trait will not attach to any item stack by default.
Static ReadonlytypesThe item type identifiers that this trait is compatible with by default.
Clones the item trait to another item stack.
The item stack to clone the component to.
A new item trait.
Compares another item trait to this one.
The other item trait to compare.
Whether the item traits are equal.
OptionalonCalled when the trait is added to an object.
OptionalonCalled when the container that the item is stored in is closed.
The player that closed the container
OptionalonCalled when the container that the item is stored in is opened.
The player that opened the container.
OptionalonCalled when the item is dropped by a player or entity.
The options for the item stack that was dropped.
OptionalonCalled when the trait is random ticked by the dimension.
OptionalonCalled when the release action is triggered by a player.
The player that released the item.
OptionalonCalled when the trait is removed from an object.
OptionalonCalled when the item has been signaled to cooldown.
The duration of the cooldown in ticks.
OptionalonCalled when the item is used by a player.
The player that used the item.
The additional options for the item use.
Whether the item use was successful; default is true
OptionalonCalled when the item cooldown has stopped.
OptionalonCalled when the item is stopped being used by a player.
The player that stopped using the item.
The additional options for the item use.
OptionalonCalled when the trait is ticked by the dimension.
The details about the tick event.
OptionalonCalled when the item is used by a player.
The player that used the item.
The additional options for the item use.
Called when the item is used on a block by a player.
The player that used the item.
The additional options for the item use.
OptionalonCalled when the item is used on an entity by a player.
The player that used the item.
The additional options for the item use.
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.
Creates a new instance of the item trait.