Class PlayerStopUsingItemEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.papermc.paper.event.player.PlayerStopUsingItemEvent

@NullMarked public class PlayerStopUsingItemEvent extends PlayerEvent
Called when the server detects a player stopping using an item. Examples of this are letting go of the interact button when holding a bow, an edible item, or a spyglass.
  • Constructor Details

    • PlayerStopUsingItemEvent

      public PlayerStopUsingItemEvent(Player player, ItemStack item, int ticksHeldFor)
  • Method Details

    • getItem

      public ItemStack getItem()
      Gets the exact item the player is releasing
      Returns:
      ItemStack the exact item the player released
    • getTicksHeldFor

      public int getTicksHeldFor()
      Gets the number of ticks the item was held for
      Returns:
      int the number of ticks the item was held for
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()