Enum Class EquipmentSlot

java.lang.Object
java.lang.Enum<EquipmentSlot>
net.minecraft.entity.EquipmentSlot
All Implemented Interfaces:
Serializable, Comparable<EquipmentSlot>, Constable, StringIdentifiable

public enum EquipmentSlot extends Enum<EquipmentSlot> implements StringIdentifiable
Provides enum types for several key slots found within an entity Inventory.

Each equipment slot has a type, which represents what inventory category it is contained within. The HAND category covers the mainhand and offhand slots, while the ARMOR category covers the 4 types of armor slots found in LivingEntity.

Each equipment slot contains information on where that slot should be located within a parent Inventory. getEntitySlotId() will provide the base slot index a slot should occupy (starting from 0), while getOffsetEntitySlotId(int) will return the same value added to an offset index.

An equipment slot can be used to quickly access the item held by an inventory slot in a LivingEntity through methods such as LivingEntity.getEquippedStack(EquipmentSlot), which will return the ItemStack held in the entity's inventory slot pointed at by the target slot.

Mappings:
Namespace Name
named net/minecraft/entity/EquipmentSlot
intermediary net/minecraft/class_1304
official buu
  • Enum Constant Details Link icon

    • MAINHAND Link icon

      public static final EquipmentSlot MAINHAND
      Mappings:
      Namespace Name Mixin selector
      named MAINHAND Lnet/minecraft/entity/EquipmentSlot;MAINHAND:Lnet/minecraft/entity/EquipmentSlot;
      intermediary field_6173 Lnet/minecraft/class_1304;field_6173:Lnet/minecraft/class_1304;
      official a Lbuu;a:Lbuu;
    • OFFHAND Link icon

      public static final EquipmentSlot OFFHAND
      Mappings:
      Namespace Name Mixin selector
      named OFFHAND Lnet/minecraft/entity/EquipmentSlot;OFFHAND:Lnet/minecraft/entity/EquipmentSlot;
      intermediary field_6171 Lnet/minecraft/class_1304;field_6171:Lnet/minecraft/class_1304;
      official b Lbuu;b:Lbuu;
    • FEET Link icon

      public static final EquipmentSlot FEET
      Mappings:
      Namespace Name Mixin selector
      named FEET Lnet/minecraft/entity/EquipmentSlot;FEET:Lnet/minecraft/entity/EquipmentSlot;
      intermediary field_6166 Lnet/minecraft/class_1304;field_6166:Lnet/minecraft/class_1304;
      official c Lbuu;c:Lbuu;
    • LEGS Link icon

      public static final EquipmentSlot LEGS
      Mappings:
      Namespace Name Mixin selector
      named LEGS Lnet/minecraft/entity/EquipmentSlot;LEGS:Lnet/minecraft/entity/EquipmentSlot;
      intermediary field_6172 Lnet/minecraft/class_1304;field_6172:Lnet/minecraft/class_1304;
      official d Lbuu;d:Lbuu;
    • CHEST Link icon

      public static final EquipmentSlot CHEST
      Mappings:
      Namespace Name Mixin selector
      named CHEST Lnet/minecraft/entity/EquipmentSlot;CHEST:Lnet/minecraft/entity/EquipmentSlot;
      intermediary field_6174 Lnet/minecraft/class_1304;field_6174:Lnet/minecraft/class_1304;
      official e Lbuu;e:Lbuu;
    • BODY Link icon

      public static final EquipmentSlot BODY
      Mappings:
      Namespace Name Mixin selector
      named BODY Lnet/minecraft/entity/EquipmentSlot;BODY:Lnet/minecraft/entity/EquipmentSlot;
      intermediary field_48824 Lnet/minecraft/class_1304;field_48824:Lnet/minecraft/class_1304;
      official g Lbuu;g:Lbuu;
  • Field Details Link icon

    • NO_MAX_COUNT Link icon

      public static final int NO_MAX_COUNT
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named NO_MAX_COUNT Lnet/minecraft/entity/EquipmentSlot;NO_MAX_COUNT:I
      intermediary field_51935 Lnet/minecraft/class_1304;field_51935:I
      official h Lbuu;h:I
    • VALUES Link icon

      public static final List<EquipmentSlot> VALUES
      Mappings:
      Namespace Name Mixin selector
      named VALUES Lnet/minecraft/entity/EquipmentSlot;VALUES:Ljava/util/List;
      intermediary field_54086 Lnet/minecraft/class_1304;field_54086:Ljava/util/List;
      official i Lbuu;i:Ljava/util/List;
    • FROM_INDEX Link icon

      public static final IntFunction<EquipmentSlot> FROM_INDEX
      Mappings:
      Namespace Name Mixin selector
      named FROM_INDEX Lnet/minecraft/entity/EquipmentSlot;FROM_INDEX:Ljava/util/function/IntFunction;
      intermediary field_54087 Lnet/minecraft/class_1304;field_54087:Ljava/util/function/IntFunction;
      official j Lbuu;j:Ljava/util/function/IntFunction;
    • CODEC Link icon

      public static final StringIdentifiable.EnumCodec<EquipmentSlot> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/entity/EquipmentSlot;CODEC:Lnet/minecraft/util/StringIdentifiable$EnumCodec;
      intermediary field_45739 Lnet/minecraft/class_1304;field_45739:Lnet/minecraft/class_3542$class_7292;
      official k Lbuu;k:Lazv$a;
    • PACKET_CODEC Link icon

      public static final PacketCodec<ByteBuf,EquipmentSlot> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/entity/EquipmentSlot;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_54088 Lnet/minecraft/class_1304;field_54088:Lnet/minecraft/class_9139;
      official l Lbuu;l:Lyn;
    • type Link icon

      private final EquipmentSlot.Type type
      Mappings:
      Namespace Name Mixin selector
      named type Lnet/minecraft/entity/EquipmentSlot;type:Lnet/minecraft/entity/EquipmentSlot$Type;
      intermediary field_6170 Lnet/minecraft/class_1304;field_6170:Lnet/minecraft/class_1304$class_1305;
      official m Lbuu;m:Lbuu$a;
    • entityId Link icon

      private final int entityId
      Mappings:
      Namespace Name Mixin selector
      named entityId Lnet/minecraft/entity/EquipmentSlot;entityId:I
      intermediary field_6168 Lnet/minecraft/class_1304;field_6168:I
      official n Lbuu;n:I
    • maxCount Link icon

      private final int maxCount
      Mappings:
      Namespace Name Mixin selector
      named maxCount Lnet/minecraft/entity/EquipmentSlot;maxCount:I
      intermediary field_51936 Lnet/minecraft/class_1304;field_51936:I
      official o Lbuu;o:I
    • index Link icon

      private final int index
      Mappings:
      Namespace Name Mixin selector
      named index Lnet/minecraft/entity/EquipmentSlot;index:I
      intermediary field_54089 Lnet/minecraft/class_1304;field_54089:I
      official p Lbuu;p:I
    • name Link icon

      private final String name
      Mappings:
      Namespace Name Mixin selector
      named name Lnet/minecraft/entity/EquipmentSlot;name:Ljava/lang/String;
      intermediary field_6175 Lnet/minecraft/class_1304;field_6175:Ljava/lang/String;
      official q Lbuu;q:Ljava/lang/String;
  • Constructor Details Link icon

    • EquipmentSlot Link icon

      private EquipmentSlot(EquipmentSlot.Type type, int entityId, int maxCount, int index, String name)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/EquipmentSlot;<init>(Ljava/lang/String;ILnet/minecraft/entity/EquipmentSlot$Type;IIILjava/lang/String;)V
      intermediary <init> Lnet/minecraft/class_1304;<init>(Ljava/lang/String;ILnet/minecraft/class_1304$class_1305;IIILjava/lang/String;)V
      official <init> Lbuu;<init>(Ljava/lang/String;ILbuu$a;IIILjava/lang/String;)V
    • EquipmentSlot Link icon

      private EquipmentSlot(EquipmentSlot.Type type, int entityId, int index, String name)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/EquipmentSlot;<init>(Ljava/lang/String;ILnet/minecraft/entity/EquipmentSlot$Type;IILjava/lang/String;)V
      intermediary <init> Lnet/minecraft/class_1304;<init>(Ljava/lang/String;ILnet/minecraft/class_1304$class_1305;IILjava/lang/String;)V
      official <init> Lbuu;<init>(Ljava/lang/String;ILbuu$a;IILjava/lang/String;)V
  • Method Details Link icon

    • values Link icon

      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 Link icon

      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
    • getType Link icon

      public EquipmentSlot.Type getType()
      Returns the target EquipmentSlot.Type that this slot targets.

      An equipment slot either targets the hand or body type, which can be used to determine whether a request to manipulate slot data on an entity should be applied to an armor inventory or general item inventory.

      Returns:
      the target EquipmentSlot.Type that this slot targets
      Mappings:
      Namespace Name Mixin selector
      named getType Lnet/minecraft/entity/EquipmentSlot;getType()Lnet/minecraft/entity/EquipmentSlot$Type;
      intermediary method_5925 Lnet/minecraft/class_1304;method_5925()Lnet/minecraft/class_1304$class_1305;
      official a Lbuu;a()Lbuu$a;
    • getEntitySlotId Link icon

      public int getEntitySlotId()
      Returns the index of the inventory slot this slot should occupy.

      In the case of MAINHAND and OFFHAND, this method will return 0 and 1, respectively. The remaining armor slots re-start at index 0 and end at index 3.

      To calculate the target index of an inventory slot for a slot relative to the offset index of an entire inventory, visit getOffsetEntitySlotId(int).

      Returns:
      the index of the inventory slot this slot should occupy
      Mappings:
      Namespace Name Mixin selector
      named getEntitySlotId Lnet/minecraft/entity/EquipmentSlot;getEntitySlotId()I
      intermediary method_5927 Lnet/minecraft/class_1304;method_5927()I
      official b Lbuu;b()I
    • getOffsetEntitySlotId Link icon

      public int getOffsetEntitySlotId(int offset)
      Returns the index of the inventory slot this slot should occupy, plus the passed in offset amount.
      Returns:
      the index of the inventory slot this slot should occupy, plus the passed in offset amount
      Mappings:
      Namespace Name Mixin selector
      named getOffsetEntitySlotId Lnet/minecraft/entity/EquipmentSlot;getOffsetEntitySlotId(I)I
      intermediary method_32320 Lnet/minecraft/class_1304;method_32320(I)I
      official a Lbuu;a(I)I
    • split Link icon

      public ItemStack split(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named split Lnet/minecraft/entity/EquipmentSlot;split(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;
      intermediary method_60610 Lnet/minecraft/class_1304;method_60610(Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;
      official a Lbuu;a(Lcwq;)Lcwq;
    • getIndex Link icon

      public int getIndex()
      Mappings:
      Namespace Name Mixin selector
      named getIndex Lnet/minecraft/entity/EquipmentSlot;getIndex()I
      intermediary method_63622 Lnet/minecraft/class_1304;method_63622()I
      official d Lbuu;d()I
    • getOffsetIndex Link icon

      public int getOffsetIndex(int offset)
      Mappings:
      Namespace Name Mixin selector
      named getOffsetIndex Lnet/minecraft/entity/EquipmentSlot;getOffsetIndex(I)I
      intermediary method_63620 Lnet/minecraft/class_1304;method_63620(I)I
      official b Lbuu;b(I)I
    • getName Link icon

      public String getName()
      Returns the unique name of this equipment slot.

      The returned value will be a lower-case string (such as "chest" for CHEST).

      Returns:
      the unique name of this equipment slot
      Mappings:
      Namespace Name Mixin selector
      named getName Lnet/minecraft/entity/EquipmentSlot;getName()Ljava/lang/String;
      intermediary method_5923 Lnet/minecraft/class_1304;method_5923()Ljava/lang/String;
      official e Lbuu;e()Ljava/lang/String;
    • isArmorSlot Link icon

      public boolean isArmorSlot()
      Mappings:
      Namespace Name Mixin selector
      named isArmorSlot Lnet/minecraft/entity/EquipmentSlot;isArmorSlot()Z
      intermediary method_46643 Lnet/minecraft/class_1304;method_46643()Z
      official f Lbuu;f()Z
    • asString Link icon

      public String asString()
      Returns the unique string representation of the enum, used for serialization.
      Specified by:
      asString in interface StringIdentifiable
      Returns:
      the unique string representation of the enum, used for serialization
      Mappings:
      Namespace Name Mixin selector
      named asString Lnet/minecraft/util/StringIdentifiable;asString()Ljava/lang/String;
      intermediary method_15434 Lnet/minecraft/class_3542;method_15434()Ljava/lang/String;
      official c Lazv;c()Ljava/lang/String;
    • byName Link icon

      public static EquipmentSlot byName(String name)
      Returns the slot where the name is equal to name. If no slot matching the input name is found, this throws IllegalArgumentException.
      Returns:
      the slot where the name is equal to name
      Throws:
      IllegalArgumentException - if no slot type could be found matching name
      Mappings:
      Namespace Name Mixin selector
      named byName Lnet/minecraft/entity/EquipmentSlot;byName(Ljava/lang/String;)Lnet/minecraft/entity/EquipmentSlot;
      intermediary method_5924 Lnet/minecraft/class_1304;method_5924(Ljava/lang/String;)Lnet/minecraft/class_1304;
      official a Lbuu;a(Ljava/lang/String;)Lbuu;