Skip to content

Open GUI on right click #561

Discussion options

You must be logged in to vote

It is possible to open GUIs like that, however keeping them open is much more difficult.
Most GUIs that are attached to blocks include checks to make sure the block is still in range and hasn't been destroyed. Of course if there's no such valid block in the first place, the check fails immediately and the GUI never opens.

That said, here is an example from the Discord for opening a GUi (it is on world login, but swapping it for block right click would be easy enough). Note that the classpath
(here its com.wildfire.gui.screen.WildfirePlayerListScreen) needs to be set to the classpath of the screen you want to open. Have a look at the mods source for that. The Screen constructor (the new Wi…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DevStark22
Comment options

Answer selected by DevStark22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants