SlotChange

constructor(physicalSlot: Int, virtualSlot: Int, oldItem: ItemStack?, newItem: ItemStack?, virtualInventory: VirtualInventory)

Parameters

physicalSlot

The physical slot index in the player's inventory that was interacted with.

virtualSlot

The corresponding virtual slot index in the virtual inventory that is affected by the interaction.

oldItem

The item that was in the slot before the interaction. This can be null if the slot was empty.

newItem

The item that will be in the slot after the interaction. This can be null if the slot will be empty after the interaction.

virtualInventory

The virtual inventory that is being interacted with. This is used to determine which virtual inventory the slot change belongs to, as there may be multiple virtual inventories in the GUI.