Contents
Class InventoryActiveSlotRequestEvent
java.lang.Object
com.hypixel.hytale.component.system.EcsEvent
com.hypixel.hytale.component.system.CancellableEcsEvent
com.hypixel.hytale.server.core.event.events.ecs.InventoryActiveSlotRequestEvent
- All Implemented Interfaces:
ICancellableEcsEvent
A cancellable event that is fired when an entity requests a change to their active inventory
slot. If cancelled, the slot switch will not occur.
This event is fired before the change is applied. To react after the slot has changed, listen
for InventorySetActiveSlotEvent instead.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInventoryActiveSlotRequestEvent(int inventorySectionId, int previousSlot, byte newSlot, boolean serverRequest) Default Constructor for aInventoryActiveSlotRequestEventinstance. -
Method Summary
Methods inherited from class CancellableEcsEvent
isCancelled, setCancelled
-
Constructor Details
-
InventoryActiveSlotRequestEvent
public InventoryActiveSlotRequestEvent(int inventorySectionId, int previousSlot, byte newSlot, boolean serverRequest) Default Constructor for aInventoryActiveSlotRequestEventinstance.- Parameters:
inventorySectionId- The inventory section ID where the slot switch is occurring.previousSlot- The index of the previously active slot.newSlot- The index of the new active slot.serverRequest- Whether the slot switch was requested by the server.
-
-
Method Details
-
getPreviousSlot
public int getPreviousSlot()- Returns:
- the index of the previously active slot.
-
getNewSlot
public byte getNewSlot()- Returns:
- the index of the new active slot.
-
setNewSlot
public void setNewSlot(byte newSlot) - Parameters:
newSlot- The index of the new active slot to set.
-
isServerRequest
public boolean isServerRequest()- Returns:
trueif the slot switch was requested by the server,falseotherwise.
-
isClientRequest
public boolean isClientRequest()- Returns:
trueif the slot switch was requested by the client,falseotherwise.
-
getInventorySectionId
public int getInventorySectionId()- Returns:
- the inventory section ID where the slot switch is occurring.
-