Package net.minecraftforge.event
Class ItemStackedOnOtherEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.ItemStackedOnOtherEvent
public class ItemStackedOnOtherEvent
extends net.minecraftforge.eventbus.api.Event
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 have a result. 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.
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final ClickActionprivate final ItemStackprivate final SlotAccessprivate final Playerprivate final Slotprivate final ItemStack
- 
Constructor SummaryConstructorsConstructorDescriptionItemStackedOnOtherEvent(ItemStack carriedItem, ItemStack stackedOnItem, Slot slot, ClickAction action, Player player, SlotAccess carriedSlotAccess) 
- 
Method SummaryModifier and TypeMethodDescriptionReturns the stack being carried by the mouse.Returns a fake slot allowing the listener to see and change what item is being carried.Returns the click action being used.Returns the player doing the item swap attempt.getSlot()Returns the slot being clicked on.Returns the stack currently in the slot being clicked on.Methods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
carriedItem
- 
stackedOnItem
- 
slot
- 
action
- 
player
- 
carriedSlotAccess
 
- 
- 
Constructor Details- 
ItemStackedOnOtherEvent@Internal public ItemStackedOnOtherEvent(ItemStack carriedItem, ItemStack stackedOnItem, Slot slot, ClickAction action, Player player, SlotAccess carriedSlotAccess) 
 
- 
- 
Method Details- 
getCarriedItemReturns the stack being carried by the mouse. This may be empty!- Returns:
- the stack being carried by the mouse
 
- 
getStackedOnItemReturns the stack currently in the slot being clicked on. This may be empty!- Returns:
- the stack currently in the slot being clicked on
 
- 
getSlotReturns the slot being clicked on.- Returns:
- the slot being clicked on
 
- 
getClickActionReturns the click action being used. By default ClickAction.PRIMARY corresponds to left-click, and ClickAction.SECONDARY is right-click.- Returns:
- the click action being used
 
- 
getPlayerReturns the player doing the item swap attempt.- Returns:
- the player doing the item swap attempt
 
- 
getCarriedSlotAccessReturns a fake slot allowing the listener to see and change what item is being carried.- Returns:
- a fake slot allowing the listener to see and change what item is being carried
 
 
-