[SOLVED] My furnace procedure does not work and crashes

Started by Spleet2.0 on

Topic category: Help with modding (Java Edition)

Last seen on 21:38, 22. Apr 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[SOLVED] My furnace procedure does not work and crashes
Tue, 11/14/2023 - 21:02 (edited)

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
Last seen on 11:41, 17. May 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
While blocks can very easily…
Tue, 11/14/2023 - 16:10

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.)

Last seen on 21:38, 22. Apr 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank !
Tue, 11/14/2023 - 21:01

Thank !