Solved InventoryClickEvent Keyboard

Discussion in 'Spigot Plugin Development' started by Leniency, Oct 15, 2016.

Thread Status:
Not open for further replies.
  1. Is it possible to check if an inventory click was caused by them pressing a button on their keyboard and not using the mouse. I have tried e.getHotbarButton() but it always returns -1 even if the button was a keyboard button.
     
  2. Choco

    Moderator

    Well that should definitely return the keyboard button that was used. Check if the ClickType was NUMBER_KEY and print that out. If it returns true and you're still getting -1, then it's a bug
     
  3. Just realized the whole issue was due to InventoryClickEvent acting wierd when in creative. Thanks for you help, made me figure this out.
     
    • Like Like x 1
Thread Status:
Not open for further replies.