Enum Class EquipmentSlot
- All Implemented Interfaces:
Serializable,Comparable<EquipmentSlot>,Constable,StringIdentifiable
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/EquipmentSlotintermediary net/minecraft/class_1304official buu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe type of body item slot anEquipmentSlottargets.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>Nested classes/interfaces inherited from interface net.minecraft.util.StringIdentifiable
StringIdentifiable.BasicCodec<S extends StringIdentifiable>, StringIdentifiable.EnumCodec<E extends Enum<E> & StringIdentifiable> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIdentifiable.EnumCodec<EquipmentSlot> private final intstatic final IntFunction<EquipmentSlot> private final intprivate final intprivate final Stringstatic final intstatic final PacketCodec<ByteBuf, EquipmentSlot> private final EquipmentSlot.Typestatic final List<EquipmentSlot> Fields inherited from interface net.minecraft.util.StringIdentifiable
CACHED_MAP_THRESHOLD -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateEquipmentSlot(EquipmentSlot.Type type, int entityId, int maxCount, int index, String name) privateEquipmentSlot(EquipmentSlot.Type type, int entityId, int index, String name) -
Method Summary
Modifier and TypeMethodDescriptionasString()Returns the unique string representation of the enum, used for serialization.static EquipmentSlotReturns the slot where the name is equal toname.intReturns the index of the inventory slot this slot should occupy.intgetIndex()getName()Returns the unique name of this equipment slot.intgetOffsetEntitySlotId(int offset) Returns the index of the inventory slot this slot should occupy, plus the passed inoffsetamount.intgetOffsetIndex(int offset) getType()Returns the targetEquipmentSlot.Typethat this slot targets.booleanstatic EquipmentSlotReturns the enum constant of this class with the specified name.static EquipmentSlot[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MAINHAND
- Mappings:
Namespace Name Mixin selector named MAINHANDLnet/minecraft/entity/EquipmentSlot;MAINHAND:Lnet/minecraft/entity/EquipmentSlot;intermediary field_6173Lnet/minecraft/class_1304;field_6173:Lnet/minecraft/class_1304;official aLbuu;a:Lbuu;
-
OFFHAND
- Mappings:
Namespace Name Mixin selector named OFFHANDLnet/minecraft/entity/EquipmentSlot;OFFHAND:Lnet/minecraft/entity/EquipmentSlot;intermediary field_6171Lnet/minecraft/class_1304;field_6171:Lnet/minecraft/class_1304;official bLbuu;b:Lbuu;
-
FEET
- Mappings:
Namespace Name Mixin selector named FEETLnet/minecraft/entity/EquipmentSlot;FEET:Lnet/minecraft/entity/EquipmentSlot;intermediary field_6166Lnet/minecraft/class_1304;field_6166:Lnet/minecraft/class_1304;official cLbuu;c:Lbuu;
-
LEGS
- Mappings:
Namespace Name Mixin selector named LEGSLnet/minecraft/entity/EquipmentSlot;LEGS:Lnet/minecraft/entity/EquipmentSlot;intermediary field_6172Lnet/minecraft/class_1304;field_6172:Lnet/minecraft/class_1304;official dLbuu;d:Lbuu;
-
CHEST
- Mappings:
Namespace Name Mixin selector named CHESTLnet/minecraft/entity/EquipmentSlot;CHEST:Lnet/minecraft/entity/EquipmentSlot;intermediary field_6174Lnet/minecraft/class_1304;field_6174:Lnet/minecraft/class_1304;official eLbuu;e:Lbuu;
-
HEAD
- Mappings:
Namespace Name Mixin selector named HEADLnet/minecraft/entity/EquipmentSlot;HEAD:Lnet/minecraft/entity/EquipmentSlot;intermediary field_6169Lnet/minecraft/class_1304;field_6169:Lnet/minecraft/class_1304;official fLbuu;f:Lbuu;
-
BODY
- Mappings:
Namespace Name Mixin selector named BODYLnet/minecraft/entity/EquipmentSlot;BODY:Lnet/minecraft/entity/EquipmentSlot;intermediary field_48824Lnet/minecraft/class_1304;field_48824:Lnet/minecraft/class_1304;official gLbuu;g:Lbuu;
-
-
Field Details
-
NO_MAX_COUNT
public static final int NO_MAX_COUNT- See Also:
- Mappings:
Namespace Name Mixin selector named NO_MAX_COUNTLnet/minecraft/entity/EquipmentSlot;NO_MAX_COUNT:Iintermediary field_51935Lnet/minecraft/class_1304;field_51935:Iofficial hLbuu;h:I
-
VALUES
- Mappings:
Namespace Name Mixin selector named VALUESLnet/minecraft/entity/EquipmentSlot;VALUES:Ljava/util/List;intermediary field_54086Lnet/minecraft/class_1304;field_54086:Ljava/util/List;official iLbuu;i:Ljava/util/List;
-
FROM_INDEX
- Mappings:
Namespace Name Mixin selector named FROM_INDEXLnet/minecraft/entity/EquipmentSlot;FROM_INDEX:Ljava/util/function/IntFunction;intermediary field_54087Lnet/minecraft/class_1304;field_54087:Ljava/util/function/IntFunction;official jLbuu;j:Ljava/util/function/IntFunction;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/entity/EquipmentSlot;CODEC:Lnet/minecraft/util/StringIdentifiable$EnumCodec;intermediary field_45739Lnet/minecraft/class_1304;field_45739:Lnet/minecraft/class_3542$class_7292;official kLbuu;k:Lazv$a;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODECLnet/minecraft/entity/EquipmentSlot;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_54088Lnet/minecraft/class_1304;field_54088:Lnet/minecraft/class_9139;official lLbuu;l:Lyn;
-
type
- Mappings:
Namespace Name Mixin selector named typeLnet/minecraft/entity/EquipmentSlot;type:Lnet/minecraft/entity/EquipmentSlot$Type;intermediary field_6170Lnet/minecraft/class_1304;field_6170:Lnet/minecraft/class_1304$class_1305;official mLbuu;m:Lbuu$a;
-
entityId
private final int entityId- Mappings:
Namespace Name Mixin selector named entityIdLnet/minecraft/entity/EquipmentSlot;entityId:Iintermediary field_6168Lnet/minecraft/class_1304;field_6168:Iofficial nLbuu;n:I
-
maxCount
private final int maxCount- Mappings:
Namespace Name Mixin selector named maxCountLnet/minecraft/entity/EquipmentSlot;maxCount:Iintermediary field_51936Lnet/minecraft/class_1304;field_51936:Iofficial oLbuu;o:I
-
index
private final int index- Mappings:
Namespace Name Mixin selector named indexLnet/minecraft/entity/EquipmentSlot;index:Iintermediary field_54089Lnet/minecraft/class_1304;field_54089:Iofficial pLbuu;p:I
-
name
- Mappings:
Namespace Name Mixin selector named nameLnet/minecraft/entity/EquipmentSlot;name:Ljava/lang/String;intermediary field_6175Lnet/minecraft/class_1304;field_6175:Ljava/lang/String;official qLbuu;q:Ljava/lang/String;
-
-
Constructor Details
-
EquipmentSlot
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/entity/EquipmentSlot;<init>(Ljava/lang/String;ILnet/minecraft/entity/EquipmentSlot$Type;IIILjava/lang/String;)Vintermediary <init>Lnet/minecraft/class_1304;<init>(Ljava/lang/String;ILnet/minecraft/class_1304$class_1305;IIILjava/lang/String;)Vofficial <init>Lbuu;<init>(Ljava/lang/String;ILbuu$a;IIILjava/lang/String;)V
-
EquipmentSlot
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/entity/EquipmentSlot;<init>(Ljava/lang/String;ILnet/minecraft/entity/EquipmentSlot$Type;IILjava/lang/String;)Vintermediary <init>Lnet/minecraft/class_1304;<init>(Ljava/lang/String;ILnet/minecraft/class_1304$class_1305;IILjava/lang/String;)Vofficial <init>Lbuu;<init>(Ljava/lang/String;ILbuu$a;IILjava/lang/String;)V
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getType
Returns the targetEquipmentSlot.Typethat 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.Typethat this slot targets - Mappings:
Namespace Name Mixin selector named getTypeLnet/minecraft/entity/EquipmentSlot;getType()Lnet/minecraft/entity/EquipmentSlot$Type;intermediary method_5925Lnet/minecraft/class_1304;method_5925()Lnet/minecraft/class_1304$class_1305;official aLbuu;a()Lbuu$a;
-
getEntitySlotId
public int getEntitySlotId()Returns the index of the inventory slot this slot should occupy.In the case of
MAINHANDandOFFHAND, 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 getEntitySlotIdLnet/minecraft/entity/EquipmentSlot;getEntitySlotId()Iintermediary method_5927Lnet/minecraft/class_1304;method_5927()Iofficial bLbuu;b()I
-
getOffsetEntitySlotId
public int getOffsetEntitySlotId(int offset) Returns the index of the inventory slot this slot should occupy, plus the passed inoffsetamount.- Returns:
- the index of the inventory slot this slot should occupy, plus the passed in
offsetamount - Mappings:
Namespace Name Mixin selector named getOffsetEntitySlotIdLnet/minecraft/entity/EquipmentSlot;getOffsetEntitySlotId(I)Iintermediary method_32320Lnet/minecraft/class_1304;method_32320(I)Iofficial aLbuu;a(I)I
-
split
- Mappings:
Namespace Name Mixin selector named splitLnet/minecraft/entity/EquipmentSlot;split(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;intermediary method_60610Lnet/minecraft/class_1304;method_60610(Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;official aLbuu;a(Lcwq;)Lcwq;
-
getIndex
public int getIndex()- Mappings:
Namespace Name Mixin selector named getIndexLnet/minecraft/entity/EquipmentSlot;getIndex()Iintermediary method_63622Lnet/minecraft/class_1304;method_63622()Iofficial dLbuu;d()I
-
getOffsetIndex
public int getOffsetIndex(int offset) - Mappings:
Namespace Name Mixin selector named getOffsetIndexLnet/minecraft/entity/EquipmentSlot;getOffsetIndex(I)Iintermediary method_63620Lnet/minecraft/class_1304;method_63620(I)Iofficial bLbuu;b(I)I
-
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 getNameLnet/minecraft/entity/EquipmentSlot;getName()Ljava/lang/String;intermediary method_5923Lnet/minecraft/class_1304;method_5923()Ljava/lang/String;official eLbuu;e()Ljava/lang/String;
-
isArmorSlot
public boolean isArmorSlot()- Mappings:
Namespace Name Mixin selector named isArmorSlotLnet/minecraft/entity/EquipmentSlot;isArmorSlot()Zintermediary method_46643Lnet/minecraft/class_1304;method_46643()Zofficial fLbuu;f()Z
-
asString
Returns the unique string representation of the enum, used for serialization.- Specified by:
asStringin interfaceStringIdentifiable- Returns:
- the unique string representation of the enum, used for serialization
- Mappings:
Namespace Name Mixin selector named asStringLnet/minecraft/util/StringIdentifiable;asString()Ljava/lang/String;intermediary method_15434Lnet/minecraft/class_3542;method_15434()Ljava/lang/String;official cLazv;c()Ljava/lang/String;
-
byName
Returns the slot where the name is equal toname. If no slot matching the input name is found, this throwsIllegalArgumentException.- Returns:
- the slot where the name is equal to
name - Throws:
IllegalArgumentException- if no slot type could be found matchingname- Mappings:
Namespace Name Mixin selector named byNameLnet/minecraft/entity/EquipmentSlot;byName(Ljava/lang/String;)Lnet/minecraft/entity/EquipmentSlot;intermediary method_5924Lnet/minecraft/class_1304;method_5924(Ljava/lang/String;)Lnet/minecraft/class_1304;official aLbuu;a(Ljava/lang/String;)Lbuu;
-