Started by
thatgirllinzi
on
Topic category: Troubleshooting, bugs, and solutions
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.

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.
See https://mcreator.net/wiki/minecraft-crashes-when-i-open-my-gui