This plugin uses a Forge mod to get when a player opens an UI and when they close it. It has a simple API as described below.
- Tested Minecraft Versions:
Code (Text):Gui Object:
GuiOpenEvent.getGui() returns GUI
GuiOpenEvent.getPlayer() returns Player
GuiOpenEvent.getkillPlayer() Kills the player. for funs
GuiCloseEvent.getGUI() returns GUI
GuiCloseEvent.getPlayer() returns Player
You can cancel the event, but that will NOT prefent the player from opening/closing the UI it will just prevent Bukkit from noticing it.
It's aproved. yay! \(^-^)/