类 ItemStackedOnOtherEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.ItemStackedOnOtherEvent
- 所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent
public class ItemStackedOnOtherEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.bus.api.ICancellableEvent
This event provides the functionality of the pair of functions used for the Bundle, in one event:
Item.overrideOtherStackedOnMe(ItemStack, ItemStack, Slot, ClickAction, Player, SlotAccess)
Item.overrideStackedOnOther(ItemStack, Slot, ClickAction, Player)
This event is cancellable, and does not
.
If the event is cancelled, the container's logic halts, the carried item and the slot will not be swapped, and handling is assumed to have been done by the mod.
This also means that the two vanilla checks described above will not be called.引用无效
have a result
-
字段概要
字段修饰符和类型字段说明private final ClickAction
private final ItemStack
private final SlotAccess
private final Player
private final Slot
private final ItemStack
-
构造器概要
构造器构造器说明ItemStackedOnOtherEvent
(ItemStack carriedItem, ItemStack stackedOnItem, Slot slot, ClickAction action, Player player, SlotAccess carriedSlotAccess) -
方法概要
修饰符和类型方法说明返回 the stack being carried by the mouse。返回 a fake slot allowing the listener to see and change what item is being carried。返回 the click action being used。返回 the player doing the item swap attempt。getSlot()
返回 the slot being clicked on。返回 the stack currently in the slot being clicked on。从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
字段详细资料
-
carriedItem
-
stackedOnItem
-
slot
-
action
-
player
-
carriedSlotAccess
-
-
构造器详细资料
-
ItemStackedOnOtherEvent
@Internal public ItemStackedOnOtherEvent(ItemStack carriedItem, ItemStack stackedOnItem, Slot slot, ClickAction action, Player player, SlotAccess carriedSlotAccess)
-
-
方法详细资料
-
getCarriedItem
返回 the stack being carried by the mouse。 This may be empty!- 返回:
- the stack being carried by the mouse
-
getStackedOnItem
返回 the stack currently in the slot being clicked on。 This may be empty!- 返回:
- the stack currently in the slot being clicked on
-
getSlot
返回 the slot being clicked on。- 返回:
- the slot being clicked on
-
getClickAction
返回 the click action being used。 By default ClickAction.PRIMARY corresponds to left-click, and ClickAction.SECONDARY is right-click.- 返回:
- the click action being used
-
getPlayer
返回 the player doing the item swap attempt。- 返回:
- the player doing the item swap attempt
-
getCarriedSlotAccess
返回 a fake slot allowing the listener to see and change what item is being carried。- 返回:
- a fake slot allowing the listener to see and change what item is being carried
-