Hard crash on opening super simple GUI

Started by thatgirllinzi on

Topic category: Troubleshooting, bugs, and solutions

Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hard crash on opening super simple GUI

Hello, does anyone know why this piece of code crashes the game as soon as I open the associated GUI? All it's supposed to do is move the item from slot 0 to slot 1. It's run in the "When slot change starts" event for slot 0.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm not certain this is the…
Sat, 04/04/2026 - 22:23

I'm not certain this is the case, but my best guess is that clearing slot 0, even if there's nothing in it, would re-trigger the slot change... Which clears slot 0, which triggers the change, which clears slot 0, etc. And that crashes the game.

If that is the case, it would probably be fixable by making sure that the item in slot 0 isn't equal to air before you clear it.