Package com.destroystokyo.paper.event.block

# Class AnvilDamagedEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.inventory.InventoryEvent
com.destroystokyo.paper.event.block.AnvilDamagedEvent

All Implemented Interfaces:
  `Cancellable`

public class AnvilDamagedEvent extends InventoryEvent implements Cancellable
Called when an anvil is damaged from being used

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`AnvilDamagedEvent.DamageState`
Represents the amount of damage on an anvil block

## Nested classes/interfaces inherited from class org.bukkit.event.Event

`Event.Result`

## Field Summary

### Fields inherited from class org.bukkit.event.inventory.InventoryEvent

`transaction`

## Constructor Summary

Constructors
Constructor
Description
`AnvilDamagedEvent(@NotNull InventoryView inventory, @NotNull BlockData blockData)`

## Method Summary

Modifier and Type
Method
Description
`@NotNull AnvilDamagedEvent.DamageState`
`getDamageState()`
Gets the new state of damage on the anvil
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`@NotNull AnvilInventory`
`getInventory()`
Gets the primary Inventory involved in this transaction
`boolean`
`isBreaking()`
Gets if anvil is breaking on this use
`boolean`
`isCancelled()`
Gets the cancellation state of this event.
`void`
`setBreaking(boolean breaking)`
Sets if anvil is breaking on this use
`void`
`setCancelled(boolean cancel)`
Sets the cancellation state of this event.
`void`
`setDamageState(@NotNull AnvilDamagedEvent.DamageState damageState)`
Sets the new state of damage on the anvil

### Methods inherited from class org.bukkit.event.inventory.InventoryEvent

`getView, getViewers`

### 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, toString, wait, wait, wait`

## Constructor Details

### AnvilDamagedEvent

public AnvilDamagedEvent(@NotNull @NotNull InventoryView inventory, @NotNull @NotNull BlockData blockData)

## Method Details

### getInventory

@NotNull public @NotNull 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

@NotNull public @NotNull AnvilDamagedEvent.DamageState getDamageState()
Gets the new state of damage on the anvil

Returns:
  Damage state

### setDamageState

public void setDamageState(@NotNull @NotNull 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

@NotNull public @NotNull HandlerList getHandlers()

Overrides:
  `getHandlers` in class `InventoryEvent`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()