Interface EquipmentHandler

All Known Implementing Classes:
EntityCreature, LivingEntity, Player, PlayerInventory

public interface EquipmentHandler
Represents an Entity which can have ItemStack in hands and armor slots.
  • Method Details

    • getEquipment

      @NotNull @NotNull ItemStack getEquipment(@NotNull @NotNull EquipmentSlot slot)
      Gets the equipment in a specific slot.
      Parameters:
      slot - the equipment to get the item from
      Returns:
      the equipment ItemStack
    • setEquipment

      void setEquipment(@NotNull @NotNull EquipmentSlot slot, @NotNull @NotNull ItemStack itemStack)
    • getItemInMainHand

      @NotNull default @NotNull ItemStack getItemInMainHand()
      Gets the ItemStack in main hand.
      Returns:
      the ItemStack in main hand
    • setItemInMainHand

      default void setItemInMainHand(@NotNull @NotNull ItemStack itemStack)
      Changes the main hand ItemStack.
      Parameters:
      itemStack - the main hand ItemStack
    • getItemInOffHand

      @NotNull default @NotNull ItemStack getItemInOffHand()
      Gets the ItemStack in off hand.
      Returns:
      the item in off hand
    • setItemInOffHand

      default void setItemInOffHand(@NotNull @NotNull ItemStack itemStack)
      Changes the off hand ItemStack.
      Parameters:
      itemStack - the off hand ItemStack
    • getItemInHand

      @NotNull default @NotNull ItemStack getItemInHand(@NotNull Player.Hand hand)
      Gets the ItemStack in the specific hand.
      Parameters:
      hand - the Hand to get the ItemStack from
      Returns:
      the ItemStack in hand
    • setItemInHand

      default void setItemInHand(@NotNull Player.Hand hand, @NotNull @NotNull ItemStack stack)
      Changes the ItemStack in the specific hand.
      Parameters:
      hand - the hand to set the item to
      stack - the ItemStack to set
    • getHelmet

      @NotNull default @NotNull ItemStack getHelmet()
      Gets the helmet.
      Returns:
      the helmet
    • setHelmet

      default void setHelmet(@NotNull @NotNull ItemStack itemStack)
      Changes the helmet.
      Parameters:
      itemStack - the helmet
    • getChestplate

      @NotNull default @NotNull ItemStack getChestplate()
      Gets the chestplate.
      Returns:
      the chestplate
    • setChestplate

      default void setChestplate(@NotNull @NotNull ItemStack itemStack)
      Changes the chestplate.
      Parameters:
      itemStack - the chestplate
    • getLeggings

      @NotNull default @NotNull ItemStack getLeggings()
      Gets the leggings.
      Returns:
      the leggings
    • setLeggings

      default void setLeggings(@NotNull @NotNull ItemStack itemStack)
      Changes the leggings.
      Parameters:
      itemStack - the leggings
    • getBoots

      @NotNull default @NotNull ItemStack getBoots()
      Gets the boots.
      Returns:
      the boots
    • setBoots

      default void setBoots(@NotNull @NotNull ItemStack itemStack)
      Changes the boots.
      Parameters:
      itemStack - the boots
    • getBodyEquipment

      @NotNull default @NotNull ItemStack getBodyEquipment()
      Gets the body equipment. Used by horses, wolves, and llama's.
      Returns:
      the body equipment
    • setBodyEquipment

      default void setBodyEquipment(@NotNull @NotNull ItemStack itemStack)
      Changes the body equipment. Used by horses, wolves, and llama's.
      Parameters:
      itemStack - the body equipment
    • hasEquipment

      default boolean hasEquipment(@NotNull @NotNull EquipmentSlot slot)
    • syncEquipment

      default void syncEquipment(@NotNull @NotNull EquipmentSlot slot)
      Sends a specific equipment to viewers.
      Parameters:
      slot - the slot of the equipment
    • getEquipmentsPacket

      @NotNull default @NotNull EntityEquipmentPacket getEquipmentsPacket()
      Gets the packet with all the equipments.
      Returns:
      the packet with the equipments
      Throws:
      IllegalStateException - if 'this' is not an Entity