Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Help' started by BearJW233, May 30, 2017.
How to monitor player press a number key? Is PlayerSwapHandItemsEvent ? but I found that not work...
Depends on which situation you to do check it. Are you in an inventory? (I guess so)
Give us some code, so we can try to help you
EDIT: If the player does not have anything in his hand, the event is not fired
it isn't in an inventory, I just want to do a fast skills casting by press key, hypxel has similar functions some games
I think the player must have an item in their Hotbar when swapping otherwise, the event is not fired. I'm not 100% certain about that though
OK......... maybe spigot doesn't have such a evnet.. The Evnet PlayerSwapHandItemsEvent 's
Called when a player swap items between main hand and off hand using the hotkey
Ops, my mistake. You need to use PlayerItemHeldEvent
Oh, thanks!! BTW, How to set player's chosen hotbar?