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

    Fields
    Modifier and Type
    Field
    Description
    static final org.bukkit.event.HandlerList
     

    Fields inherited from class org.bukkit.event.entity.EntityEvent

    entity
  • Constructor Summary

    Constructors
    Constructor
    Description
    EntityEquipmentEvent(org.bukkit.entity.Entity what, org.bukkit.inventory.EquipmentSlot slot, org.bukkit.inventory.ItemStack dequipped, org.bukkit.inventory.ItemStack equipped)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.inventory.ItemStack
    Returns the item that was previously in that slot, or null.
    org.bukkit.inventory.ItemStack
    Returns the item that is being equipped, or null.
    static @NotNull org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.inventory.EquipmentSlot
    Returns the slot that the item is being equipped to.
    boolean
    Returns true if the slot involved is an armor slot.
    boolean
    Returns true if an item is being removed from the slot.
    boolean
    Returns true if an item is being equipped to the slot.
     

    Methods inherited from class org.bukkit.event.entity.EntityEvent

    getEntity, getEntityType

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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_HAND did not exist.
      Returns:
      The non-null slot the item is being equipped to/from.
    • isDequipping

      public boolean isDequipping()
      Returns true if an item is being removed from the slot. Note that an item may be dequipped at the same time one is equipped.
      Returns:
      true if an item is removed.
      See Also:
    • isEquipping

      public boolean isEquipping()
      Returns true if 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, or null.
      Returns:
      The nullable previous item.
    • getEquipped

      public org.bukkit.inventory.ItemStack getEquipped()
      Returns the item that is being equipped, or null.
      Returns:
      The nullable currently equipped item.
    • isArmor

      public boolean isArmor()
      Returns true if the slot involved is an armor slot.
      Returns:
      true if the slot is an armor slot.
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()