The entity to apply the equipment trait to.
Optional
properties: Partial<EntityEquipmentTraitProperties>The optional properties of the equipment trait.
Readonly
armorThe armor container that holds the equipment items.
Protected
Readonly
entityThe entity that this trait is attached to.
Readonly
identifierThe identifier of the trait.
Readonly
offhandThe offhand container that holds the equipment items.
Static
Readonly
componentsThe entity 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
typesThe entity type identifiers that this trait is compatible with by default.
Protected
dimensionThe dimension that the entity is in.
The dynamic property used to store the equipment items.
Calculates the total protection of the armor items.
The total protection of the armor items.
Clones the entity trait.
The entity to clone the trait to.
A new entity trait.
Gets the item stack from a specific equipment slot.
The equipment slot to get the item stack from.
The item stack from the equipment slot; otherwise, null.
Optional
onCalled when the trait is added to an object.
Optional
onCalled when the entity that this trait is attached executes a command.
The command execution state.
Whether the command was successful; default is true.
Called when a container that is attached to the entity is updated.
The container that was updated.
Called when the entity that this trait is attached to is killed.
Optional
onCalled when the entity that this trait is attached to is despawned from a dimension.
The details of the entity despawn.
Optional
onCalled when the entity that this trait is attached to falls on a block.
The event properties of the entity falling on a block.
Optional
onCalled when the entity that this trait is attached to is interacted with by a player.
The player that interacted with the entity.
The method that the player used to interact with the entity.
Called when the trait is removed from an object.
Called then the entity that this trait is attached to is spawned into a dimension.
Optional
onCalled when the trait is ticked by the dimension.
The details about the tick event.
Sets an item stack to a specific equipment slot.
The equipment slot to set the item stack to.
The item stack to set to the equipment slot.
Swaps an item stack from the inventory to an equipment slot.
The slot of the item stack in the inventory.
The equipment slot to swap the item stack to.
Create a new equipment trait for the entity.