Class AnvilDamagedEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.inventory.InventoryEvent
com.destroystokyo.paper.event.block.AnvilDamagedEvent
All Implemented Interfaces:
Cancellable

@NullMarked public class AnvilDamagedEvent extends InventoryEvent implements Cancellable
Called when an anvil is damaged from being used
  • Constructor Details

  • Method Details

    • getInventory

      public AnvilInventory getInventory()
      Description copied from class: InventoryEvent
      Gets the primary Inventory involved in this transaction
      Overrides:
      getInventory in class InventoryEvent
      Returns:
      The upper inventory.
    • getDamageState

      public AnvilDamagedEvent.DamageState getDamageState()
      Gets the new state of damage on the anvil
      Returns:
      Damage state
    • setDamageState

      public void setDamageState(AnvilDamagedEvent.DamageState damageState)
      Sets the new state of damage on the anvil
      Parameters:
      damageState - Damage state
    • isBreaking

      public boolean isBreaking()
      Gets if anvil is breaking on this use
      Returns:
      true if breaking
    • setBreaking

      public void setBreaking(boolean breaking)
      Sets if anvil is breaking on this use
      Parameters:
      breaking - true if breaking
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Cancellable
      Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins
      Specified by:
      isCancelled in interface Cancellable
      Returns:
      true if this event is cancelled
    • setCancelled

      public void setCancelled(boolean cancel)
      Description copied from interface: Cancellable
      Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancel - true if you wish to cancel this event
    • getHandlers

      public HandlerList getHandlers()
      Overrides:
      getHandlers in class InventoryEvent
    • getHandlerList

      public static HandlerList getHandlerList()