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/EquipmentSlot
intermediary net/minecraft/class_1304
official bsy
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The type of body item slot anEquipmentSlot
targets.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
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
static final StringIdentifiable.EnumCodec
<EquipmentSlot> private final int
private final int
private final String
static final int
private final EquipmentSlot.Type
Fields inherited from interface net.minecraft.util.StringIdentifiable
CACHED_MAP_THRESHOLD
-
Constructor Summary
ModifierConstructorDescriptionprivate
EquipmentSlot
(EquipmentSlot.Type type, int entityId, int maxCount, int armorStandId, String name) private
EquipmentSlot
(EquipmentSlot.Type type, int entityId, int armorStandId, String name) -
Method Summary
Modifier and TypeMethodDescriptionasString()
Returns the unique string representation of the enum, used for serialization.static EquipmentSlot
Returns the slot where the name is equal toname
.int
Returns the index of the inventory slot this slot occupies in anArmorStandEntity
.int
Returns the index of the inventory slot this slot should occupy.getName()
Returns the unique name of this equipment slot.int
getOffsetEntitySlotId
(int offset) Returns the index of the inventory slot this slot should occupy, plus the passed inoffset
amount.getType()
Returns the targetEquipmentSlot.Type
that this slot targets.boolean
static EquipmentSlot
Returns 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 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
Lbsy;a:Lbsy;
-
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
Lbsy;b:Lbsy;
-
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
Lbsy;c:Lbsy;
-
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
Lbsy;d:Lbsy;
-
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
Lbsy;e:Lbsy;
-
HEAD
- Mappings:
Namespace Name Mixin selector named HEAD
Lnet/minecraft/entity/EquipmentSlot;HEAD:Lnet/minecraft/entity/EquipmentSlot;
intermediary field_6169
Lnet/minecraft/class_1304;field_6169:Lnet/minecraft/class_1304;
official f
Lbsy;f:Lbsy;
-
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
Lbsy;g:Lbsy;
-
-
Field Details
-
NO_MAX_COUNT
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
Lbsy;h:I
-
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 i
Lbsy;i:Lazk$a;
-
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 j
Lbsy;j:Lbsy$a;
-
entityId
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 k
Lbsy;k:I
-
maxCount
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 l
Lbsy;l:I
-
armorStandId
private final int armorStandId- Mappings:
Namespace Name Mixin selector named armorStandId
Lnet/minecraft/entity/EquipmentSlot;armorStandId:I
intermediary field_6167
Lnet/minecraft/class_1304;field_6167:I
official m
Lbsy;m:I
-
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 n
Lbsy;n:Ljava/lang/String;
-
-
Constructor Details
-
EquipmentSlot
private EquipmentSlot(EquipmentSlot.Type type, int entityId, int maxCount, int armorStandId, 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>
Lbsy;<init>(Ljava/lang/String;ILbsy$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;)V
intermediary <init>
Lnet/minecraft/class_1304;<init>(Ljava/lang/String;ILnet/minecraft/class_1304$class_1305;IILjava/lang/String;)V
official <init>
Lbsy;<init>(Ljava/lang/String;ILbsy$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.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
Lbsy;a()Lbsy$a;
-
getEntitySlotId
public int getEntitySlotId()Returns the index of the inventory slot this slot should occupy.In the case of
MAINHAND
andOFFHAND
, 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
Lbsy;b()I
-
getOffsetEntitySlotId
public int getOffsetEntitySlotId(int offset) Returns the index of the inventory slot this slot should occupy, plus the passed inoffset
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
Lbsy;a(I)I
-
split
- 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
Lbsy;a(Lcuq;)Lcuq;
-
getArmorStandSlotId
public int getArmorStandSlotId()Returns the index of the inventory slot this slot occupies in anArmorStandEntity
.- Returns:
- the index of the inventory slot this slot occupies in an
ArmorStandEntity
- Mappings:
Namespace Name Mixin selector named getArmorStandSlotId
Lnet/minecraft/entity/EquipmentSlot;getArmorStandSlotId()I
intermediary method_5926
Lnet/minecraft/class_1304;method_5926()I
official d
Lbsy;d()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 getName
Lnet/minecraft/entity/EquipmentSlot;getName()Ljava/lang/String;
intermediary method_5923
Lnet/minecraft/class_1304;method_5923()Ljava/lang/String;
official e
Lbsy;e()Ljava/lang/String;
-
isArmorSlot
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
Lbsy;f()Z
-
asString
Returns the unique string representation of the enum, used for serialization.- Specified by:
asString
in interfaceStringIdentifiable
- 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
Lazk;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 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
Lbsy;a(Ljava/lang/String;)Lbsy;
-