Package net.neoforged.neoforge.event
Class GrindstoneEvent.OnPlaceItem
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.GrindstoneEvent
net.neoforged.neoforge.event.GrindstoneEvent.OnPlaceItem
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
- Enclosing class:
GrindstoneEvent
public static class GrindstoneEvent.OnPlaceItem
extends GrindstoneEvent
implements net.neoforged.bus.api.ICancellableEvent
This event is
The following rules apply:
ICancellableEvent
GrindstoneEvent.OnPlaceItem
is fired when the inputs to a grindstone are changed. The following rules apply:
- If the event is canceled, vanilla behavior will not run, and the output will be empty.
- If the event is not canceled
- and the output is empty, the output will be determined by vanilla.
- and the output is not empty, the output will be set, without running vanilla behavior.
- Vanilla XP calculation logic will be used unless all of the following criterias are met:
- the amount of experience is greater than or equal to
0
; - the event is not canceled;
- the output is not empty.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.GrindstoneEvent
GrindstoneEvent.OnPlaceItem, GrindstoneEvent.OnTakeItem
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class net.neoforged.neoforge.event.GrindstoneEvent
getBottomItem, getTopItem, getXp, setXp
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, setCanceled
-
Field Details
-
output
-
-
Constructor Details
-
OnPlaceItem
-
-
Method Details
-
getOutput
This is the output as determined by the event, not by the vanilla behavior between these two items.
If you are the first receiver of this event, it is guaranteed to be empty.
It will only be non-empty if changed by an event handler.
If this event is cancelled, this output stack is discarded.- Returns:
- The item to set in the output grindstone slot.
-
setOutput
Sets the output slot to a specific itemstack.- Parameters:
output
- The stack to change the output to.
-