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]

How do supercharged slots work? How do supercharged slots work?

Posted On: April 19, 2024
I came back to No Man's Sky and a few things regarding the inventory have changed in the last months. Now I have some violet slots that are marked as supercharged.As I understood, the tech installed i...[More]


Can I abandon my Kerbonaut in space in Kerbal Space Program? Can I abandon my Kerbonaut in space in Kerbal Space Program?

Posted On: February 20, 2023
My little Kerbonaut is currently circling the planet in a stable orbit, and seems to be having a grand ol' time with it. You should see the smile on his face. He's been circling now for what l...[More]


Can you get duplicate standees from the Poplin Shop? Can you get duplicate standees from the Poplin Shop?

Posted On: November 5, 2023
When I buy a Standee Surprise from the Poplin Shop it gives me a random Standee. Is it possible to get a duplicate Standee I already have? Question from user Stevoisiak at stackexchange. Answer:...[More]


Does being in full darkness prevent you from being detected in ToTK? Does being in full darkness prevent you from being detected in ToTK?

Posted On: May 16, 2023
* minor spoilers *. I'm trying to sneak my way underground early to try to find some goodies, and there's a lot. Fortunately it's not densely populated with enemies everywhere. Came acr...[More]


What exactly are Paladins? What exactly are Paladins?

Posted On: June 8, 2024
Hi everyone. I'm completely knew to Baulder's Gate and the DnD world. So I was wondering if someone could explain a few basic things to me:.I'm currently a drow lolth sworn bard and I've just finished...[More]


Be honest: did any parts in BG3 make you cry? Be honest: did any parts in BG3 make you cry?

Posted On: July 14, 2024
Anything from misty eyes and sniffles to bawling your eyes out will count! ?.I can think of a few (and mind you, I get really attached to the sympathetic NPC's in the games I play!):.Astarion's defea...[More]


Donkey Kong 64 - What do the Chimpy Cam options do? Donkey Kong 64 - What do the Chimpy Cam options do?

Posted On: March 17, 2023
In the options for Donkey Kong 64 I can set Chimpy Cam to either Free or Follow. What's the difference between Free and Follow? Question from user Stevoisiak at gaming.stackexchange.com. Ans...[More]


Why isnt Diep.io loading? Why isnt Diep.io loading?

Posted On: February 2, 2023
I have just got on to diep.io, and it is stuck on the "Connecting" screen. The tab also keeps refreshing. I see many errors on my developer tools when I press the F12 key.I am using a Windows 10 Surfa...[More]


Anyone else not using the Hogwarts Legacy curses? Anyone else not using the Hogwarts Legacy curses?

Posted On: June 8, 2023
Question from user Zealousideal_Chef137 at HogwartsLegacyGaming at reddit.com. Answer: I did on one of my playthroughs; I put a lot of points into potions and plants. It was a great time. I e...[More]


Do pawns take their inventory with them when they leave your party? Do pawns take their inventory with them when they leave your party?

Posted On: April 23, 2024
As I have been exploring the countryside I often bump into pawns who would like to join my party. Sometimes they are higher level than the folks already accompanying me, so I tend to add them and dism...[More]