Enum Class EquipmentSlot

java.lang.Object
java.lang.Enum<EquipmentSlot>
fr.fidorial.inventory.EquipmentSlot
All Implemented Interfaces:
Serializable, Comparable<EquipmentSlot>, Constable

public enum EquipmentSlot extends Enum<EquipmentSlot>
One place an entity wears or holds an item, as an item's minecraft:equippable component names it.
Since:
0.1.0
See Also:
  • Enum Constant Details

    • MAIN_HAND

      public static final EquipmentSlot MAIN_HAND
      The main hand.
    • OFF_HAND

      public static final EquipmentSlot OFF_HAND
      The off hand, where a shield is held.
    • FEET

      public static final EquipmentSlot FEET
      Boots.
    • LEGS

      public static final EquipmentSlot LEGS
      Leggings.
    • CHEST

      public static final EquipmentSlot CHEST
      Chestplates and elytras.
    • BODY

      public static final EquipmentSlot BODY
      The body armor of an animal: horse armor, wolf armor, llama carpets, harnesses...
    • SADDLE

      public static final EquipmentSlot SADDLE
      The saddle of a mount.
  • Method Details

    • values

      public static EquipmentSlot[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static EquipmentSlot valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • byName

      public static @Nullable EquipmentSlot byName(@Nullable String name)
      Parameters:
      name - the vanilla name, e.g. head
      Returns:
      the matching slot, null when the name is unknown
      Since:
      0.1.0
    • serializedName

      public String serializedName()
      Returns:
      the vanilla name, e.g. head
      Since:
      0.1.0
    • isHumanoidArmor

      public boolean isHumanoidArmor()
      Returns:
      true for the four slots of a player's armor
      Since:
      0.1.0