Class ItemBreakEvent

java.lang.Object
valorless.rarespawns.events.ItemBreakEvent
All Implemented Interfaces:
org.bukkit.event.Listener

public class ItemBreakEvent extends Object implements org.bukkit.event.Listener
Listener that reacts to PlayerItemBreakEvent for RareSpawns items.

When a rare item breaks, this handler looks up its ItemData and plays the configured break sound (if present) to the owning player.

Register this listener by calling init() during plugin startup.

  • Constructor Details

    • ItemBreakEvent

      public ItemBreakEvent()
  • Method Details

    • init

      public static void init()
      Registers this listener with the Bukkit plugin manager.
    • onPlayerItemBreak

      public void onPlayerItemBreak(org.bukkit.event.player.PlayerItemBreakEvent event)
      Handles the PlayerItemBreakEvent.

      If the broken item is recognized as a RareSpawns item, the corresponding ItemData is retrieved and any configured breakSound is played to the player.

      Parameters:
      event - the item break event fired by Bukkit