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]

is my approval rating from Karlach okay for now? is my approval rating from Karlach okay for now?

Posted On: October 18, 2025
I sided with Brithvar against Nere, and Karlach disapproved lol.Anyways, is my approval rating from her okay or great, at least at this point of time?I want to romance her eventually.Question from use...[More]


Do HP increasing items work in Hardcore mode? Do HP increasing items work in Hardcore mode?

Posted On: October 20, 2023
In the shop there's a Hardcore mode that sets your HP to 1. What happens if you get an HP increasing item like Just Bandage or Piki Piki Piman while Hardcore mode is enabled? Do they have any effe...[More]


I spent 2 minutes laughing. So messed up. I spent 2 minutes laughing. So messed up.

Posted On: September 11, 2024
Question from user napalmblaziken at BaldursGate3 at reddit.com.Answer:Batman approves.Answer from user GabyFermi at BaldursGate3 at reddit.com....[More]


How to find the Dishonored combination of the underwater safe? How to find the Dishonored combination of the underwater safe?

Posted On: May 12, 2023
In Central Rudshore of the Flooded District before entering the Daud's base there is a safe in the flooded basement of a nearby building. Where am I supposed to find the combination of it in-game?...[More]


Can I use N.E.I. every time i play? Can I use N.E.I. every time i play?

Posted On: September 19, 2023
Is it possible to always have Not Enough Items set up every time I play Minecraft even without Forge? Can I for example open Minecraft and choose my normal profile not Forge, and when I play have Forg...[More]


This is why people ship them This is why people ship them

Posted On: January 27, 2025
Question from user OCDurge at BaldursGate3 at reddit.com.Answer:At the epilogue party, Dammon writes her a letter saying he thinks about her often and basically begs her to write him back!.Answer from...[More]


What is the console command to undo expulsion from House Hlaalu? What is the console command to undo expulsion from House Hlaalu?

Posted On: March 17, 2024
I accidentally got expelled from House Hlaalu in The Elder Scrolls III: Morrowind, and I'm not in a situation where I can easily make amends, so I would like to use the console to easily get out of th...[More]


In Civilization5, is there a hotkey for the general Next Move button? In Civilization5, is there a hotkey for the general Next Move button?

Posted On: April 8, 2023
I'm looking for a keyboard hotkey for the generalized "Next Move", "Choose Research", "Unit Waiting for Order" button in the bottom-right corner of the interface. ...[More]


Is there some bug with this in Hogwarts Legacy? Is there some bug with this in Hogwarts Legacy?

Posted On: April 22, 2023
The chest spawned but it doesnt give an option to open it. If i basic cast the bones, they fly away but still cant open the chest. Question from user PaletteSizeQueen at HogwartsLegacyGaming at red...[More]


How do I backup my Minecraft world on Xbox to a flash drive without realms? How do I backup my Minecraft world on Xbox to a flash drive without realms?

Posted On: June 10, 2023
How do I backup my Minecraft Bedrock world from my Xbox to a flash drive?. I don’t have realms and don’t want to get realms to backup my world. I want to keep it on a drive separate ...[More]