Deny dropping lapis from enchanting table ?

Discussion in 'Spigot Plugin Development' started by Drawethree, May 5, 2017.

  1. Hey guys, I'm putting automatically lapis on enchant open, but when player closes the inventory, the unusued lapis drops out. How can I disable that ?
     
  2. BananaPuncher714

    Supporter

    Maybe you could check if the inventory is an enchantment table on InventoryCloseEvent and set the lapis slot to air.
     
    • Agree Agree x 1
  3. To build on that, might also want to check InventoryClickEvent and stop the player from clicking/dragging the lapis at all so they dont just drag it out of the window to drop it without closing the inventory.
     
  4. That's already i did. I just need to doesnt drop lapis on inv close event