Zombie Minigame Spawning Procedure

Started by LaTortiia on

Topic category: Help with modding (Java Edition)

Last seen on 18:52, 20. Jan 2022
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Zombie Minigame Spawning Procedure

So, I'm trying to to program COD BO2's Tranzit in Minecraft, and for now, everything is going fine except the zombie spawning.

I was wondering if any of you know a way to program a procedure that spawns an "X" amount of zombies distributed in a couple of predefined coordinates.

Also, I've been struggling in figuring out how to code that zombies should despawn and respawn near the player in case he gets too far away.

Do any of you guys have any experience or ideas on how to code this?

Thanks!!

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
by predefined coordinated…
Thu, 09/23/2021 - 22:24

by predefined coordinated what do you mean? Also there is a checkbox on your entity editor "Despawn Entity When Idle"

Last seen on 21:45, 9. Mar 2024
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know some commands that…
Sun, 11/21/2021 - 06:45

I know some commands that could help you. You have to use a Function

First add a tag "killable" with:

/tag @e[type=minecraft:zombie] add killable

Then use this command after use [limit] for the amount of zombies you want:

/execute if entity @e[type=minecraft:zombie,limit=5] run execute as @e[type=minecraft:zombie,limit=5,sort=nearest] run tag @s add safe

Then add

/tag @e[type=minecraft:zombie,tag=safe] remove killable

Then add a procedure that kills the zombies that are tagged "killable" with a slight time delay so you dont wind up killing every zombie

/kill @e[tag=killable]