Make item non-removable (Minecraft)?

ga
- in Plugins
2

I program with Spigot Minecraft plugins and would like to know how you can put items in an inventory. My solution was to put the unenchanted compass in my inventory and then make an InventoryClickEvent listener that closes the player's inventory when he clicks on the compass. But that's not possible…

Make item non-removable Minecraft

here is a photo of the listener.

I look forward to any answers!

Wa

Do you mean fixed? If so then just set the event with event.setCancel (true); back

ga

Thank you, it never occurred to me, where should I place it?