Class EntityEquipmentInventoryComponentBeta

Provides access to a mob's equipment slots. This component exists for all mob entities.

Hierarchy

Constructors

Properties

entity: Entity

Remarks

The entity that owns this component.

typeId: string

Remarks

Identifier of the component.

componentId: "minecraft:equipment_inventory" = 'minecraft:equipment_inventory'

Methods

  • Parameters

    • equipmentSlot: EquipmentSlot

      The equipment slot. e.g. "head", "chest", "offhand"

    Returns undefined | ItemStack

    Returns the item equipped to the given EquipmentSlot. If empty, returns undefined.

    Remarks

    Gets the equipped item for the given EquipmentSlot.

    This function can't be called in read-only mode.

    Throws

    This function can throw errors.

  • Parameters

    • equipmentSlot: EquipmentSlot

      The equipment slot. e.g. "head", "chest", "offhand".

    Returns ContainerSlot

    Returns the ContainerSlot corresponding to the given EquipmentSlot.

    Remarks

    Gets the ContainerSlot corresponding to the given EquipmentSlot.

    This function can't be called in read-only mode.

    Throws

    This function can throw errors.

  • Parameters

    • equipmentSlot: EquipmentSlot

      The equipment slot. e.g. "head", "chest", "offhand".

    • Optional itemStack: ItemStack

      The item to equip. If undefined, clears the slot.

    Returns void

    Remarks

    Replaces the item in the given EquipmentSlot.

    This function can't be called in read-only mode.

    Throws

    This function can throw errors.