Class PrepareAnvilEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.inventory.InventoryEvent
org.bukkit.event.inventory.PrepareInventoryResultEvent
com.destroystokyo.paper.event.inventory.PrepareResultEvent
org.bukkit.event.inventory.PrepareAnvilEvent
Called when an item is put in a slot for repair by an anvil.
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class InventoryEvent
transaction -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the primary Inventory involved in this transactiongetView()Gets the view object itselfvoidSet result item, may benull.Methods inherited from class PrepareResultEvent
getResultMethods inherited from class PrepareInventoryResultEvent
getHandlerList, getHandlersMethods inherited from class InventoryEvent
getViewersMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PrepareAnvilEvent
-
-
Method Details
-
getInventory
Description copied from class:InventoryEventGets the primary Inventory involved in this transaction- Overrides:
getInventoryin classInventoryEvent- Returns:
- The upper inventory.
-
setResult
Set result item, may benull.Note: by default custom recipes in anvil are disabled you should define a repair cost on the anvil inventory greater or equals to zero in order to allow that.
- Overrides:
setResultin classPrepareResultEvent- Parameters:
result- result item
-
getView
Description copied from class:InventoryEventGets the view object itself- Overrides:
getViewin classInventoryEvent- Returns:
- InventoryView
-