WesJD / AnvilGUI

Capture user input in Minecraft through an anvil GUI in under 20 lines of code
MIT License
475 stars 114 forks source link

builder.onClose get reason. #311

Open N08I40K opened 9 months ago

N08I40K commented 9 months ago

I need to find out why the player closed the inventory, but there is no corresponding method, as in the InventoryCloseEvent event::getReason

mastercake10 commented 9 months ago

As for now, this is not possible. To make this work, I think we need to pass the underlying InventoryCloseEvent to the onClose method, either in the stateSnapshot or as a new, optional parameter. We can't work with the Reason (as in just passing the Reason instead of the Event) since it seems to be a Paper only method.