Spawn zombies every tick

Started by ДанилаТрофимчук on

Topic category: Help with Minecraft modding (Java Edition)

Spawn zombies every tick

What am I doing wrong? The code should spawn zombies every second, but it starts spawning them every tick after a second.asd

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The 'wait 20 ticks then on…
Wed, 11/27/2024 - 14:11

The 'wait 20 ticks then on server-side' block does not act like a timer, it acts as a delay, which are different. To explain what is happening, the procedure is triggering every tick, and when it gets to the delay, the current iteration of the procedure pauses, but new iterations are still able to start. This leads to what you are saying, where it waits one second, then spawns every tick.

The solution to fix this would be to set up a potion effect, variable, or nbt-based timer. An example is where an nbt number value is increased by 1 on the player, every tick the condition is active, then, when it reaches 20, you summon a zombie and reset the nbt number to 0.