Enum Class PlayerInventorySlot
- All Implemented Interfaces:
Serializable
,Comparable<PlayerInventorySlot>
,Constable
Represents a slot of a
MainSpectatorInventory
.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic PlayerInventorySlot
byDefaultIndex
(int index) Get the slot given its index in theMainSpectatorInventory
.int
Get the index of theMainSpectatorInventory
at which this slot resides.boolean
isArmour()
Get whether this slot is an armour slot.boolean
Get whether this slot is a regular container slot.boolean
isCursor()
Get whether this slot is the cursor slot.boolean
Get whether this slot is an offhand slot.boolean
Get whether this slot is a personal slot.static PlayerInventorySlot
Returns the enum constant of this class with the specified name.static PlayerInventorySlot[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CONTAINER_00
-
CONTAINER_01
-
CONTAINER_02
-
CONTAINER_03
-
CONTAINER_04
-
CONTAINER_05
-
CONTAINER_06
-
CONTAINER_07
-
CONTAINER_08
-
CONTAINER_09
-
CONTAINER_10
-
CONTAINER_11
-
CONTAINER_12
-
CONTAINER_13
-
CONTAINER_14
-
CONTAINER_15
-
CONTAINER_16
-
CONTAINER_17
-
CONTAINER_18
-
CONTAINER_19
-
CONTAINER_20
-
CONTAINER_21
-
CONTAINER_22
-
CONTAINER_23
-
CONTAINER_24
-
CONTAINER_25
-
CONTAINER_26
-
CONTAINER_27
-
CONTAINER_28
-
CONTAINER_29
-
CONTAINER_30
-
CONTAINER_31
-
CONTAINER_32
-
CONTAINER_33
-
CONTAINER_34
-
CONTAINER_35
-
ARMOUR_BOOTS
-
ARMOUR_LEGGINGS
-
ARMOUR_CHESTPLATE
-
ARMOUR_HELMET
-
OFFHAND
-
CURSOR
-
PERSONAL_00
-
PERSONAL_01
-
PERSONAL_02
-
PERSONAL_03
-
PERSONAL_04
-
PERSONAL_05
-
PERSONAL_06
-
PERSONAL_07
-
PERSONAL_08
-
-
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
-
isContainer
public boolean isContainer()Get whether this slot is a regular container slot.- Returns:
- true if this slot is a container slot, otherwise false
-
isArmour
public boolean isArmour()Get whether this slot is an armour slot.- Returns:
- true if this slot is an armour slot, otherwise false
- API Note:
- the
OFFHAND
slot is NOT considered an armour slot.
-
isPersonal
public boolean isPersonal()Get whether this slot is a personal slot. Personal slots are slots which host items that are personal to the player, such as crafting slots, enchanting window and villager working block windows.- Returns:
- true if this slot is personal to the player, otherwise false
-
isOffHand
public boolean isOffHand()Get whether this slot is an offhand slot.- Returns:
- true if this slot is the offhand slot, otherwise false
-
isCursor
public boolean isCursor()Get whether this slot is the cursor slot. The cursor slot is the slot that hosts the item that the target player is holding in its cursor when they are viewing an inventory themselves.- Returns:
- true if this slot is the cursor slot, otherwise false
-
defaultIndex
public int defaultIndex()Get the index of theMainSpectatorInventory
at which this slot resides. -
byDefaultIndex
Get the slot given its index in theMainSpectatorInventory
.
-