Allow players to remove items but not add from GUI

Discussion in 'Spigot Plugin Development' started by Lockett, Jun 1, 2018.

  1. I have been trying a number of different things, however, can't seem to come to a working conclusion.
  2. Cancel the event if the inventory clicked is the top inventory, and the action (Event.getAction()) is something other than picking stuff up.
    Cancel shift-clicks if the clicked inventory is the players, do nothing if it's the top inventory.
    You may want to stop the player from picking up items from their inventory as well to stop them from getting things on their cursor, so just check if the top inventory is the inventory you only want to be able to pick up from and cancel pickup events if the clicked inventory is the players.