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]

What weapon talent tree combination provides the highest dps with the flail and shield? What weapon talent tree combination provides the highest dps with the flail and shield?

Posted On: October 14, 2023
New World has a new expansion, and with it, a new weapon. I've been having a lot of fun with it and am still playing around with combinations. With most of the other weapons in the game, I'...[More]


Sonic Mania, Do giant rings still appear after collecting all 7 Chaos Emeralds? Sonic Mania, Do giant rings still appear after collecting all 7 Chaos Emeralds?

Posted On: May 5, 2023
According to Polygon, Sonic Mania has at least 32 giant rings hidden throughout the game's 12 zones. A skilled player could collect all 7 emeralds before even finishing Studiopolis Zone. . ...[More]


My Arabella cosplay My Arabella cosplay

Posted On: July 24, 2024
Question from user FridaAih at BaldursGate3 at reddit.com.Answer:Don’t go stealing any idols, or your mom will feed you to a gnoll.Answer from user Tavminater at BaldursGate3 at reddit.com....[More]


Is 2 ranks in V.A.N.S. better than 2 ranks in Perception Training? Is 2 ranks in V.A.N.S. better than 2 ranks in Perception Training?

Posted On: September 27, 2023
Let's say I wanted +2 Perception. I could. Put two points into Perception. Put two points into VANS; the second rank gives you +2 Perception. Seems like for 2 points I could have +2 Pe...[More]


What is the max amount of rupees you can get in BoTW? What is the max amount of rupees you can get in BoTW?

Posted On: May 17, 2023
In BotW, they did away with the wallet sizes. You can always take in more and more rupees. But at some point, can you max the number of rupees you can get? Question from user Fredy31 at gaming.s...[More]


Act2 & Act3 Spoilers with Astarion Act2 & Act3 Spoilers with Astarion

Posted On: February 2, 2025
Hi, it’s me again. You’re going to see me asking lots of things. So, I did the quest for Raphael, for Astarion’s sake and now I have to fight Cazador while we have the tadpole so we have the adv...[More]


Should I turn in sebastion in Hogwarts Legacy? Should I turn in sebastion in Hogwarts Legacy?

Posted On: March 16, 2023
I already learned Avada Kedavra so there's no point for me to keep him around just wondering if there are any underlining consequences to doing so, plus he does say whatever happens he's glad ...[More]


How do I continue downloading a game in Steam while playing? How do I continue downloading a game in Steam while playing?

Posted On: May 28, 2015
I have many games on Steam and many more I will buy, but I have a problem and I hope you can point me a solution.When I download a game, is it possible to launch and play a single player game under St...[More]


So what is your favorite class So what is your favorite class

Posted On: October 19, 2025
I mean no multiclass allowed, just one and just a one class that is in your head superior than other classes at its own. I can start and I say Paladin.Question from user Tsipadidau420 at BaldursGate3 ...[More]


Is there any way to see progress towards achievements in Civ 5? Is there any way to see progress towards achievements in Civ 5?

Posted On: January 22, 2023
Is there a way to see how much more I have to do to achieve the various achievements? For example, Merchant King is Trade 100 resources over any number of playthroughs. I'd love to know how c...[More]