Package net.neoforged.neoforge.event
Class GrindstoneEvent.OnTakeItem
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.GrindstoneEvent
net.neoforged.neoforge.event.GrindstoneEvent.OnTakeItem
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
- Enclosing class:
GrindstoneEvent
public static class GrindstoneEvent.OnTakeItem
extends GrindstoneEvent
implements net.neoforged.bus.api.ICancellableEvent
This event is
It is called from
If the event is canceled, vanilla behavior will not run, and no inputs will be consumed.
if the amount of experience is larger than or equal 0, the vanilla behavior for calculating experience will not run.
ICancellableEvent
GrindstoneEvent.OnTakeItem
is fired when the output in a grindstone are is taken. It is called from
GrindstoneMenu(int, Inventory)
. If the event is canceled, vanilla behavior will not run, and no inputs will be consumed.
if the amount of experience is larger than or equal 0, the vanilla behavior for calculating experience will not run.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.GrindstoneEvent
GrindstoneEvent.OnPlaceItem, GrindstoneEvent.OnTakeItem
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOnTakeItem
(net.minecraft.world.item.ItemStack top, net.minecraft.world.item.ItemStack bottom, int xp) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStack
net.minecraft.world.item.ItemStack
int
getXp()
This is the experience amount that will be returned by the event.void
setNewBottomItem
(net.minecraft.world.item.ItemStack newBottom) Sets the itemstack in the bottom slot.void
setNewTopItem
(net.minecraft.world.item.ItemStack newTop) Sets the itemstack in the top slot.Methods inherited from class net.neoforged.neoforge.event.GrindstoneEvent
getBottomItem, getTopItem, 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
-
newTop
private net.minecraft.world.item.ItemStack newTop -
newBottom
private net.minecraft.world.item.ItemStack newBottom
-
-
Constructor Details
-
OnTakeItem
public OnTakeItem(net.minecraft.world.item.ItemStack top, net.minecraft.world.item.ItemStack bottom, int xp)
-
-
Method Details
-
getNewTopItem
public net.minecraft.world.item.ItemStack getNewTopItem()- Returns:
- The item in that will be in the top input grindstone slot after the event.
-
getNewBottomItem
public net.minecraft.world.item.ItemStack getNewBottomItem()- Returns:
- The item in that will be in the bottom input grindstone slot after the event.
-
setNewTopItem
public void setNewTopItem(net.minecraft.world.item.ItemStack newTop) Sets the itemstack in the top slot.- Parameters:
newTop
-
-
setNewBottomItem
public void setNewBottomItem(net.minecraft.world.item.ItemStack newBottom) Sets the itemstack in the bottom slot.- Parameters:
newBottom
-
-
getXp
public int getXp()This is the experience amount that will be returned by the event.- Overrides:
getXp
in classGrindstoneEvent
- Returns:
- The experience amount given to the player.
-