Package me.deecaad.core.events
Class EntityEquipmentEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
me.deecaad.core.events.EntityEquipmentEvent
public class EntityEquipmentEvent
extends org.bukkit.event.entity.EntityEvent
An event that fires when a
LivingEntity changes an item in their
equipment. An entity's equipment is a structure mapping an
EquipmentSlot to an item.
As of writing this comment, this event is only fired for bukkit
Players. This is subject to change.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
FieldsFields inherited from class org.bukkit.event.entity.EntityEvent
entity -
Constructor Summary
ConstructorsConstructorDescriptionEntityEquipmentEvent(org.bukkit.entity.Entity what, org.bukkit.inventory.EquipmentSlot slot, org.bukkit.inventory.ItemStack dequipped, org.bukkit.inventory.ItemStack equipped) -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStackReturns the item that was previously in that slot, ornull.org.bukkit.inventory.ItemStackReturns the item that is being equipped, ornull.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.inventory.EquipmentSlotgetSlot()Returns the slot that the item is being equipped to.booleanisArmor()Returnstrueif the slot involved is an armor slot.booleanReturnstrueif an item is being removed from the slot.booleanReturnstrueif an item is being equipped to the slot.toString()Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntity, getEntityTypeMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Field Details
-
HANDLERS
public static final org.bukkit.event.HandlerList HANDLERS
-
-
Constructor Details
-
EntityEquipmentEvent
public EntityEquipmentEvent(org.bukkit.entity.Entity what, org.bukkit.inventory.EquipmentSlot slot, org.bukkit.inventory.ItemStack dequipped, org.bukkit.inventory.ItemStack equipped)
-
-
Method Details
-
getSlot
@NotNull public @NotNull org.bukkit.inventory.EquipmentSlot getSlot()Returns the slot that the item is being equipped to. Note that prior to 1.9,EquipmentSlot.OFF_HANDdid not exist.- Returns:
- The non-null slot the item is being equipped to/from.
-
isDequipping
public boolean isDequipping()Returnstrueif an item is being removed from the slot. Note that an item may be dequipped at the same time one is equipped.- Returns:
trueif an item is removed.- See Also:
-
isEquipping
public boolean isEquipping()Returnstrueif an item is being equipped to the slot. Note that an item may be equipped at the same time one is dequipped.- Returns:
true- See Also:
-
getDequipped
public org.bukkit.inventory.ItemStack getDequipped()Returns the item that was previously in that slot, ornull.- Returns:
- The nullable previous item.
-
getEquipped
public org.bukkit.inventory.ItemStack getEquipped()Returns the item that is being equipped, ornull.- Returns:
- The nullable currently equipped item.
-
isArmor
public boolean isArmor()Returnstrueif the slot involved is an armor slot.- Returns:
- true if the slot is an armor slot.
- See Also:
-
toString
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
-