How To Spawn after a specific amount of time

[BACK]
How To Spawn after a specific amount of time
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 To Spawn after a specific amount of time
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]

Miraak is stealing all my dragon souls Miraak is stealing all my dragon souls

Posted On: January 15, 2023
After reading the book Waking Dreams and seeing Miraak, I couldn't absorb a dragon's soul. I killed more than 10 dragons and Miraak took all the souls. Is this supposed to happen? Question ...[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]


How to make dragons crash land in Skyrim? How to make dragons crash land in Skyrim?

Posted On: May 20, 2023
How to make a dragon fail landing/crash on the ground/fall from the sky ? I don't mean Dragonrend. I mean when a dragon falls from the sky and land badly, in a way they stop attacking for so...[More]


How does scoring work in Unidentified Falling Objects? How does scoring work in Unidentified Falling Objects?

Posted On: August 21, 2023
In Unidentified Falling Objects there are objectives to earn a certain amount of points in a single combo. The amount of points you earn seems to be affected by how many blocks you break at once and y...[More]


Why does my map have exclamation points marked on it? Why does my map have exclamation points marked on it?

Posted On: April 19, 2024
I have just started playing and some locations on my compass have an exclamation point marked and I have no idea what this is telling me. I have highlighted it below.What are these exclamation points ...[More]


Which stat does Eldritch Blast use when grabbing it from the Spell Sniper feat? Which stat does Eldritch Blast use when grabbing it from the Spell Sniper feat?

Posted On: September 2, 2023
Eldritch Blast is a Warlock cantrip, and Warlocks use their Charisma for their spells, even when you multiclass. If I have Gale the Wizard (whose spellcasting stat is Intelligence) learn the Spell ...[More]


Is there a way to turn off or not use auto battle? Is there a way to turn off or not use auto battle?

Posted On: April 29, 2024
So I like the idea of Pokemon following along outside their pokeball like in previous games, but I prefer to raise their experience manually myself. So my question is: is there a way to prevent Pokemo...[More]


How to you build a moving ship in Minecraft? How to you build a moving ship in Minecraft?

Posted On: June 2, 2023
I've recently become interested in minecraft redstone, and one of my biggest pet peeves is that there is no easy way to move across water apart from using a small boat that is not very practical o...[More]


Is there anyway to help a pinned down teammate? Is there anyway to help a pinned down teammate?

Posted On: June 12, 2023
A reoccurring theme in the game is you will often get jumped by a hostile who will pin you to the ground and pummel you until you mash a button enough times to get them off of you. If this happens to ...[More]


What does a segmented health bar mean on a hostile NPC? What does a segmented health bar mean on a hostile NPC?

Posted On: September 10, 2023
Starfield, PC via Steam. Most 'normal' hostiles have a health bar that looks like a single bar which decreases as you hurt them:. The screenshot above is from an animal on this planet I&...[More]