Function setEquipmentItem

  • Replaces the item in the given EquipmentSlot.

    Parameters

    • entity: Entity

      The owner of the slot.

    • Optionalitem: ItemStack

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

    • slot: EquipmentSlot = EquipmentSlot.Mainhand

      The slot to set item stack, default is EquipmentSlot.Mainhand.

    Returns boolean | undefined