How do I make mobs slowly respawn up to a certain cap?

[BACK]
How do I make mobs slowly respawn up to a certain cap?
Posted On: January 27, 2023

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.


[BACK]
How do I make mobs slowly respawn up to a certain cap?
Posted On: January 27, 2023

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.


[BACK]

In Hogwarts a broken moth left me at 99 percent In Hogwarts a broken moth left me at 99 percent

Posted On: March 2, 2023
Question from user SirSquidrift at HogwartsLegacyGaming at reddit.com. Answer: Dont. For me, it was a bugged butterfly chest that left me at 99%, but seriously: The game is great anyway. Yeah, i...[More]


Can you move around Heart Containers in The Legend of Zelda: Tears of the Kingdom? Can you move around Heart Containers in The Legend of Zelda: Tears of the Kingdom?

Posted On: June 11, 2023
In The Legend of Zelda: Tears of the Kingdom, defeating the boss of one of the four regional Temples causes a Heart Container to drop. Is it possible to force one of these heart containers to move, th...[More]


Whats the Best Way to Grind XP in Dynasty Warriors 6 Whats the Best Way to Grind XP in Dynasty Warriors 6

Posted On: March 25, 2023
I'm trying to max out the level of all Heroes to get the Achievement: Completist. I'm not sure if I have to only max out heroes I can play in story mode, or all heroes. Does this affect the...[More]


Is the missable chest in the Mushroom Castle still in the remake? Is the missable chest in the Mushroom Castle still in the remake?

Posted On: November 26, 2023
In the original Super Mario RPG on SNES, there is a missable hidden treasure chest that could only be obtained by jumping on a Toad's head the first time you visit Mushroom Castle. Once you enter ...[More]


Whats wrong with my Pokemon Go curveball? Whats wrong with my Pokemon Go curveball?

Posted On: May 10, 2023
So I've got pretty good at landing curveballs. Well, according to How to throw a curveball that's what I think I'm doing. But I never seem to get the 10xp bonus for curveball, whether I hi...[More]


Where can I contact roblox support (a real person)? Where can I contact roblox support (a real person)?

Posted On: September 19, 2023
Can someone tell me how to contact Roblox support? I don't mean roblox/support, that's just a bot. I want to talk to a real human who works in Roblox support. Question from user comand100vi...[More]


Is shoving enemies supposed to make you an oath breaker? Is shoving enemies supposed to make you an oath breaker?

Posted On: June 9, 2025
I'm confused. Got into a conflict in act one with zarys and her goons. They initiate combat and my paladin shoved one of them off a cliff. Immediate oathbreaker. I reloaded and just killed them normal...[More]


How can I recognize wanted criminals in Godlike Burger? How can I recognize wanted criminals in Godlike Burger?

Posted On: October 17, 2023
There's this event in Godlike Burger where your restaurant may sometimes be visited by wanted criminals that you can kill for a money reward. Problem is, I don't see any distinguishable marks ...[More]


Is there a minimum amount of Zen that I should offer to buy on the dilithium exchange? Is there a minimum amount of Zen that I should offer to buy on the dilithium exchange?

Posted On: January 20, 2023
I offered to buy ~20 Zen for 500 dilithium per zen on the exchange, but it hasn't been picked up yet. Is that because the exchange is now "broken" and exchanges take forever, or is it be...[More]


Are there enemies immune to quickhacks in Cyberpunk 2077? Are there enemies immune to quickhacks in Cyberpunk 2077?

Posted On: May 20, 2023
I'm pretty deep into the game, relying on quickhacks for damage so far, and I've yet to encounter enemies immune to quickhacks entirely. This seems to indicate that I don't need any other ...[More]