Hotbar swap help

Discussion in 'Spigot Plugin Development' started by Eliminator, May 20, 2015.

  1. If you go into your inventory hover over an item not in your hot bar, then click 1-9 in your keyboard, that item will swap with the cosponsoring hot bar item.

    Is there any event that will trigger when this happens? Any way to stop it?
  2. I don't understand what are you trying to explain...
  3. [​IMG]
    I am pressing 1-9 in case you can't tell.
  4. The InventoryClickEvent is called for this. You can check #getHotbarButton(). It will return -1 if they did not click on a hotbar key, otherwise it will return 0-8 (0 being the first slot and 8 being the last).