Started by
Spleet2.0
on
Topic category: Help with Minecraft modding (Java Edition)
I created a custom blender that works like an oven. I created a procedure for a recipe, but the game crashes because of two procedure blocks that I identified. I don't understand why this doesn't work.
Edited by Spleet2.0 on Tue, 11/14/2023 - 21:02
While blocks can very easily cause game-breaking issues, and while blocks with wait blocks are even more dangerous. Keep in mind that the while block loops things within the initial run of the procedure. So if you have a procedure that loops something until an end condition is reached, but the end condition is delayed, it will never resolve, because the procedure will keep running until the while bracket stops, but the delay means it won't ever reach the stop condition.
There aren't many situations where a While bracket is the preferable solution. Aside from searching for a specific block, or running something recursive, steer clear! =)
What you want to do instead is just use an if bracket. If the NBT tag is at a certain value, run whatever the completion code is and reset the tag. If it isn't, increase the tag by one. (Since this is presumably running every time the block ticks.)
Thank !