Package ch.njol.skript.util.slot
Class EquipmentSlot
java.lang.Object
ch.njol.skript.util.slot.Slot
ch.njol.skript.util.slot.SlotWithIndex
ch.njol.skript.util.slot.EquipmentSlot
- All Implemented Interfaces:
Debuggable
Represents equipment slot of an entity.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionEquipmentSlot
(org.bukkit.entity.HumanEntity holder, int index) EquipmentSlot
(org.bukkit.inventory.EntityEquipment e, EquipmentSlot.EquipSlot slot) EquipmentSlot
(org.bukkit.inventory.EntityEquipment e, EquipmentSlot.EquipSlot slot, boolean slotToString) -
Method Summary
Modifier and TypeMethodDescriptionint
Gets underlying armor slot enum.int
getIndex()
Gets an index of this slot.@Nullable org.bukkit.inventory.ItemStack
getItem()
void
setAmount
(int amount) void
setItem
(@Nullable org.bukkit.inventory.ItemStack item) toString
(@Nullable org.bukkit.event.Event event, boolean debug) Methods inherited from class ch.njol.skript.util.slot.SlotWithIndex
getRawIndex, isSameSlot
-
Constructor Details
-
EquipmentSlot
public EquipmentSlot(org.bukkit.inventory.EntityEquipment e, EquipmentSlot.EquipSlot slot, boolean slotToString) -
EquipmentSlot
-
EquipmentSlot
public EquipmentSlot(org.bukkit.entity.HumanEntity holder, int index)
-
-
Method Details
-
getItem
@Nullable public @Nullable org.bukkit.inventory.ItemStack getItem() -
setItem
public void setItem(@Nullable @Nullable org.bukkit.inventory.ItemStack item) -
getAmount
public int getAmount() -
setAmount
public void setAmount(int amount) -
getEquipSlot
Gets underlying armor slot enum.- Returns:
- Armor slot.
-
getIndex
public int getIndex()Description copied from class:SlotWithIndex
Gets an index of this slot.- Specified by:
getIndex
in classSlotWithIndex
- Returns:
- Index of the slot.
-
toString
- Parameters:
event
- The event to get information from. This is always null if debug == false.debug
- If true this should print more information, if false this should print what is shown to the end user- Returns:
- String representation of this object
-