Package net.minestom.server.event.player
Class PlayerChangeHeldSlotEvent
java.lang.Object
net.minestom.server.event.Event
net.minestom.server.event.CancellableEvent
net.minestom.server.event.player.PlayerChangeHeldSlotEvent
public class PlayerChangeHeldSlotEvent extends CancellableEvent
Called when a player change his held slot (by pressing 1-9 keys).
-
Constructor Summary
Constructors Constructor Description PlayerChangeHeldSlotEvent(Player player, byte slot)
-
Method Summary
-
Constructor Details
-
Method Details
-
getPlayer
Gets the player who changed his held slot.- Returns:
- the player
-
getSlot
public byte getSlot()Gets the slot which the player will held.- Returns:
- the held slot
-
setSlot
public void setSlot(byte slot)Changes the final held slot of the player.- Parameters:
slot
- the new held slot- Throws:
java.lang.IllegalArgumentException
- ifslot
is not between 0 and 8
-