SamJakob / SpiGUI

A comprehensive GUI API for Spigot with pages support.
MIT License
107 stars 21 forks source link

Need a Support quickly #29

Closed xyndex closed 1 year ago

xyndex commented 1 year ago

How to use another events except InventoryClickEvent one's?

SamJakob commented 1 year ago

You can use a Listener as normal, the built-in SGMenuListener shows how this can be done.

Specifically, you can see on lines 87 - 95 how to test if an inventory is an SGMenu and how to get the SGMenu in question:

https://github.com/SamJakob/SpiGUI/blob/edde839de579038fd2f5c1135c2c9cb1fb2a7c46/src/main/java/com/samjakob/spigui/menu/SGMenuListener.java#L87-L95