Reputation: 35
In bukkit, I need a method that can return what hotkey a player has selected. I can't find a way to do this, the bukkit api doesn't have anything along those lines, is there another api that does include this?
Upvotes: 1
Views: 2054
Reputation: 460
What you want to do get the held item slot:
int itemSlot = Player.getInventory().getHeldItemSlot();
Keep in mind, the held item slot is an index. This means that slot #1 is 0, and slot #2 is 1, and so on.
Upvotes: 2