ATTENTION: You need
Skript and
skRayFall to make this script work.
I wanted my survival players to start forgetting about commands and using buttons, but there are very few opportunities to have buttons without modifying the game heavily.
That's why I found how to detect when a player clicks any of the slots in the "Crafting" area in the player's inventory.
With a resource pack, the illusion of functional buttons is completed as seen here:
Features:
- Add a command to any of the 5 slots in the crafting area of the player inventory.
- (Optional) Close the player's inventory after executing the command (Useful when the commands triggers something outside the inventory).
Dependencies:
This was a fundamental part of my gameplay experience in my survival server. I hope it helps someone.