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