Interface EquipmentHandler

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

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

    • getItemInMainHand

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

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

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

      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 @NotNull ItemStack getHelmet()
      Gets the helmet.
      Returns:
      the helmet
    • setHelmet

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

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

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

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

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

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

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

      @NotNull default @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

      default void setEquipment(@NotNull @NotNull EquipmentSlot slot, @NotNull @NotNull ItemStack itemStack)
    • 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