GUI/Keybind Issue

Started by The Typholorian on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
GUI/Keybind Issue

Making a new GUI that opens when a button is pressed. I got it to work (mostly), but every time you press the button it opens and closes almost instantly. I added chat messages to help with debugging. Here's the code (had to type it):

 

Set [Local: Disabler] to: (false);

If (GUI open AND [Local: Disabler] = (false) {

Send chat to all players: {close};

Close any GUI open for (Event/target entity);

Set [Local: Disabler] to: (true);

}

If (GUI not open AND [Local: Disabler] = (false) {

Send chat to all players: {open};

Open the GUI;

Set [Local: Disabler] to: (true);

}