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 net.neoforged.neoforge.event.entity.player.AnvilCraftEvent
AnvilCraftEvent.Post, AnvilCraftEvent.Pre
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.player.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.TabListNameFormat
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
setCanceled
(boolean canceled) Cancels the event, preventing any post-processing that occurs when the output item is picked up.Methods inherited from class net.neoforged.neoforge.event.entity.player.AnvilCraftEvent
getLeft, getMenu, getOutput, getRight
Methods inherited from class net.neoforged.neoforge.event.entity.player.PlayerEvent
getEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
setCanceled
in interfacenet.neoforged.bus.api.ICancellableEvent
-