Article Categories
- Baldur's Gate 3
- Diablo
- Elder Scrolls
- General
- Hogwarts Legacy
- League of Legends
- Minecraft
- Pokemon Go
- Sims 4
- StarCraft
- Steam Platform
- Xbox Game Console
More Articles
How do I make mobs slowly respawn up to a certain cap?

I am currently making a Legend of Zelda themed adventure map. I am struggling to make it, so enemies spawn every few minutes but not spawn large amounts over time. I have tried using things like hopper clocks to time when enemies spawn but after a while it turns into a large swarm of unwanted enemies. I am looking to make it so if an enemy has already spawned another will not spawn.
Example: if there are 5 enemies in a room, there will never be more than 5. So even if a few are killed, a few minutes later more will respawn, but no more than 5 in total.
Question from user Opllusion at gaming.stackexchange.com.
Answer:
You can store the result of the execute if entity subcommand to count how many entities there are and then execute based on that.
You will need a dummy scoreboard objective (let's say count) and a fakeplayer to store the amount in (let's say $zombies).
Now we can count the amount of zombies and only summon another one if there are 4 or less zombies in total:.
execute store result score $zombies count if entity @e[type=zombie].
execute if score $zombies count matches ..4 run summon zombie.
Answer from user Plagiatus at gaming.stackexchange.com.

I am currently making a Legend of Zelda themed adventure map. I am struggling to make it, so enemies spawn every few minutes but not spawn large amounts over time. I have tried using things like hopper clocks to time when enemies spawn but after a while it turns into a large swarm of unwanted enemies. I am looking to make it so if an enemy has already spawned another will not spawn.
Example: if there are 5 enemies in a room, there will never be more than 5. So even if a few are killed, a few minutes later more will respawn, but no more than 5 in total.
Question from user Opllusion at gaming.stackexchange.com.
Answer:
You can store the result of the execute if entity subcommand to count how many entities there are and then execute based on that.
You will need a dummy scoreboard objective (let's say count) and a fakeplayer to store the amount in (let's say $zombies).
Now we can count the amount of zombies and only summon another one if there are 4 or less zombies in total:.
execute store result score $zombies count if entity @e[type=zombie].
execute if score $zombies count matches ..4 run summon zombie.
Answer from user Plagiatus at gaming.stackexchange.com.
What does glowing Mantis Blades mean?
How can you run Skyrim in borderless window mode?
Where does this blue cube-shaped object belong in Unpacking?
Can you die from an Unknown Location in Slay The Spire?
Could Phoenix tears cure Anne?
How do restaurants and markets differ in their functions and benefits in Tropico?
How to get the Steam Workshop to work with Civilization V for a Mac?
How do I kill these spiders in Hogwarts Legacy?
Why do I create 2 characters when starting a new playthrough?
What *exactly* is the action - event that fixes your choice of Grimm Troupe quest?


