[SOLVED] Block won't replace itself with next stage

Started by akisephila on Mon, 06/28/2021 - 06:34

Topic category: Help with modding (Java Edition)

Last seen on 23:51, 1. Aug 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
[SOLVED] Block won't replace itself with next stage
Wed, 07/07/2021 - 02:05 (edited)

I have a block which spawns mobs around it each time it randomly ticks. But it's also supposed to only do this three times, via using several blocks and replacing itself with the next stage after spawning entities three times, using a local variable that goes up every time it activates. If block at xyz = Spawner1, replace block at xyz with Spawner2, If block at xyz = Spawner2, replace block at xyz with Spawner3

However, this does not work. I have no idea why.
Here's a screenshot of the full procedure each of the spawner blocks uses (Except for the last stage, because that is when the spawner is set to deactivate)
The procedure the blocks use

Edited by akisephila on Wed, 07/07/2021 - 02:05
Last seen on 02:01, 27. Aug 2021
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Think I know the problem.  …
Wed, 06/30/2021 - 04:14

Think I know the problem.

 

The variable resets everything the procedure is ran because the local variable doesn't exist until the procedure is ran and after the procedure has run its course, it drops the variable. This is why Global variables exist separate from Local.

Save the variable as an NBT tag on the block then make the block keep NBT tags when its replaced so you can keep calling from it.

Last seen on 23:51, 1. Aug 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Ah, ok. Thanks so much!
Sat, 07/03/2021 - 23:58

Ah, ok. Thanks so much!