Private
constructorReadonly
entityThe entity that owns this component. The entity will be undefined if it has been removed.
Readonly
typeIdentifier of the component.
Static
Readonly
componentThe equipment slot. e.g. "head", "chest", "offhand"
Returns the item equipped to the given EquipmentSlot. If empty, returns undefined.
Gets the equipped item for the given EquipmentSlot.
This function can throw errors.
The equipment slot. e.g. "head", "chest", "offhand".
Returns the ContainerSlot corresponding to the given EquipmentSlot.
Gets the ContainerSlot corresponding to the given EquipmentSlot.
This function can throw errors.
The equipment slot. e.g. "head", "chest", "offhand".
Optional
itemStack: ItemStackThe item to equip. If undefined, clears the slot.
Optional
Replaces the item in the given EquipmentSlot.
This function can't be called in read-only mode.
This function can throw errors.
Provides access to a mob's equipment slots. This component exists for all mob entities.
Example
givePlayerElytra.ts
Example
givePlayerEquipment.ts
Example
clearOffhand.ts
Example
getMainhandSlot.js