Class AnvilCraftEvent.Pre

All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
Enclosing class:
AnvilCraftEvent

public static class AnvilCraftEvent.Pre extends AnvilCraftEvent implements net.neoforged.bus.api.ICancellableEvent
This event is fired when the player picks up the result of the anvil operation, but before any post-processing occurs.

Normal post-processing includes removing the input items from the anvil, charging the player XP, and damaging the anvil block. In addition, post processing is also responsible for firing AnvilCraftEvent.Post.

  • Constructor Details

  • Method Details

    • setCanceled

      public void setCanceled(boolean canceled)
      Cancels the event, preventing any post-processing that occurs when the output item is picked up.

      If you cancel this event, you must manually handle the post-processing yourself.

      Specified by:
      setCanceled in interface net.neoforged.bus.api.ICancellableEvent