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]

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]


In Beat Saber how do I disable TinyTAN avatars on BTS songs? In Beat Saber how do I disable TinyTAN avatars on BTS songs?

Posted On: March 3, 2023
Sometimes while playing Beat Saber's BTS Music Pack, TinyTAN avatars will appear mid-song and start flying around. The extra distraction makes it difficult to play Expert or Expert+ tracks. Is ...[More]


Why does this solution to 5-3 work? Didnt the Prince get eaten? Why does this solution to 5-3 work? Didnt the Prince get eaten?

Posted On: November 26, 2023
In Storyteller, a puzzle game about telling stories that fit a title, I accidentally solved Chapter 5.3 - Duplicity: A Kiss and a Curse without understanding why my solution worked. Kiss, Witch, Pr...[More]


Mob Spawning - Despawning in Minecraft Mob Spawning - Despawning in Minecraft

Posted On: May 30, 2023
So I've been building up my Villager Trading farms and halls and breeders, etc., and one of these builds is the converter - Using a zombie to convert the villager and back again to reduce trade co...[More]


How can I show the map layer ui? How can I show the map layer ui?

Posted On: October 20, 2023
With the release of version 4.0 layered maps are now in the game, allowing you to swap between surface level and lower levels. When you select something 'underground' the layers map ui is s...[More]


Is there an in-world explanation why Aloy needs to learn skills again? Is there an in-world explanation why Aloy needs to learn skills again?

Posted On: April 14, 2023
I just finished playing Horizon: Zero Dawn on PC. While waiting for a PC version of Forbidden West, or ability to buy PlayStation 5, I have read the reviews and it looks like in Forbidden West Aloy ne...[More]


Are there any Unicorns in Hogwarts Legacy? Are there any Unicorns in Hogwarts Legacy?

Posted On: July 20, 2023
I know in the first Harry Potter book, Voldemort uses Unicorn blood to sustain himself and keep himself alive. Later, Peter Pettigrew also uses Unicorn blood along with Nagini’s venom to create ...[More]


What do I do with the mysterious key in Across The Obelisk? What do I do with the mysterious key in Across The Obelisk?

Posted On: August 5, 2023
I found a mysterious key in the volcano area. What do I do with it? Question from user BlueRaja - Danny Pflughoeft at stackexchange. Answer: This is a part of the secret treasure quest which ...[More]


No reward for vault entrance completion in Hogwarts Legacy? No reward for vault entrance completion in Hogwarts Legacy?

Posted On: July 11, 2023
Some of those puzzles were somewhat difficult, I feel like you should get XP for completion and not just janky gear.  Question from user Pandy_45 at HogwartsLegacyGaming at reddit. Answer: ...[More]


Why are Fallouts computers so backwards? Why are Fallouts computers so backwards?

Posted On: April 16, 2024
The games are set in the future right? Circa 2077. But the terminals look like the computers back in the 1950's. When we actually had to type commands to get things done. Why is this? Im assuming it h...[More]