Topic category: Troubleshooting, bugs, and solutions
So i'm having this issue, and i know what the problem is i just need help solving it. Basically, when you put this full set of armor on, and press a key, it makes you invisible, now since its a toggleable feature, i need to make a While -> do part of the Block.
It looks something like this...
-
-
-
-
-
-
-
Ive made a Bool (True/False) Var, and by default its False, now before that there an If that makes sure that the entire suit of armor is on, then when the key is pressed, if the variable is False. Set to True and vice versa
When Said variable is True, Give potion effect, then in order to break out of the loop ,check if Toggle is False.
I believe the issue lays upon the fact that the While Function is Spamming Minecraft with the invisibility, and minecraft cant keep up, so it crashes. Is there a way to add a pause?
Its rather that or i'm missing out on something completely.
All help would be appreciated :)
Minecraft only advances to the next tick when that while loop is broken, which it will never be
You can achieve the result you want just by doing the if statement.
Also, another problem is that your toggle soundness be in the same procedure as your effect, otherwise it will keep toggling itself every other frame. Instead, set an NBT tag to the item, block or mob as the toggle, an then check for that in the update tick
Soundness = shouldn't
Oh good, auto correct...