Started by
Bulb
on
Topic category: Help with Minecraft modding (Java Edition)
So, how to make a keybind, which can open and close the same GUI. You open it, for example with "K", and close it with "K", not only ESC button.
My MCreator version is 2024.1 , I'm making a mod for Java Minecraft 1.20.1 Forge.
The only thing I want is a Java code for opening GUI with the same keybind with commentaries or a MCreator procedure screenshot.
Thank you in advance, sincerely!
Edited by Bulb on Sat, 09/28/2024 - 15:04
if have gui open, close
if not have gui open, open it
Please, send a screenshot or smth, because it doesn't work
On key [K] pressed
If [is gui {custom gui} currently opened for event target entity] = [true]
Close open gui
Else [open gui {customgui} ]
It still doesn't work. The GUI opens, but doesn't close![](https://media.discordapp.net/attachments/998507913381429308/1292925766362988607/image.png?ex=67058274&is=670430f4&hm=4b789f7d6592b53ef96f2e6470df9fd8dd6ce234ebff63ca4712271bd59e0fd6&=&format=webp&quality=lossless)