Class AnvilCraftEvent.Pre
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.living.LivingEvent
net.neoforged.neoforge.event.entity.player.PlayerEvent
net.neoforged.neoforge.event.entity.player.AnvilCraftEvent
net.neoforged.neoforge.event.entity.player.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.
-
Nested Class Summary
Nested classes/interfaces inherited from class AnvilCraftEvent
AnvilCraftEvent.Post, AnvilCraftEvent.PreNested classes/interfaces inherited from class PlayerEvent
PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.ItemCraftedEvent, PlayerEvent.ItemSmeltedEvent, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.PlayerChangedDimensionEvent, PlayerEvent.PlayerChangeGameModeEvent, PlayerEvent.PlayerLoggedInEvent, PlayerEvent.PlayerLoggedOutEvent, PlayerEvent.PlayerRespawnEvent, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.TabListNameFormatNested classes/interfaces inherited from class LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEventNested classes/interfaces inherited from class EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetCanceled(boolean canceled) Cancels the event, preventing any post-processing that occurs when the output item is picked up.Methods inherited from class AnvilCraftEvent
getLeft, getMenu, getOutput, getRightMethods inherited from class PlayerEvent
getEntityMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled
-
Constructor Details
-
Pre
-
-
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:
setCanceledin interfacenet.neoforged.bus.api.ICancellableEvent
-