Link to playeranvilupdate
The PlayerAnvilUpdate Event is fired when a player places items in both the left and right slots of a anvil.
- If the event is canceled, vanilla behavior will not run, and the output will be set to null.
- If the event is not canceled, but the output is not null, it will set the output and not run vanilla behavior.
- if the output is null, and the event is not canceled, vanilla behavior will execute.
Link to event-class
You will need to cast the event in the function header as this class:
You can, of course, also import the class before and use that name then.
Event interface extensions
Link to event-interface-extensions
PlayerAnvilUpdate Events implement the following interfaces and are able to call all of their methods/getters/setters as well:
ZenGetters & ZenSetters
Link to zengetters--zensetters
The following information can be retrieved from the event:
DescriptionThe left side of the input.
DescriptionThe right side of the input.
DescriptionSet this to set the output stack.
DescriptionThe name to set the item, if the user specified one.
DescriptionThe base cost, set this to change it if output != null.
DescriptionThe number of items from the right slot to be consumed during the repair. Leave as 0 to consume the entire stack.
Link to zenmethods
event.cancel()sets the event as cancelled.