I have commented here before about a bonfire-like system, though I still have the same issue with it as I did then. So I will try to elaborate more on the issue that I have currently with a bonfire system.
So I'm trying to make a bonfire-like system akin to the famous Dark Souls games. Where you are near a thing, and all enemies respawn. Though, it's the detection of being at a bonfire that makes this slightly difficult.
We decided to use tags as to make the bonfire respawn system happen only once. Otherwise it will endlessly kill and respawn mobs for as long as you stand by the bonfire, and that is extremely laggy.
So we made a Bonefire, and in it, an invisible armor stand named "NexusTestWaystone"
Me and my friend have created the commands to be like this:
Command Chain 1: senses when player is near bonfire---------------------------------------------------------------------------------------------
As a repeating command, always active- purpose= to detect when player is near the bonfire, it adds tag "inZone"
/execute as @e[tag=NexusTestWaystone,tag=!inZone] at @s if entity @p[distance=..1]
As a chain command, always active, behind the command above- Purpose = kill all mobs in gameplay area
/kill @e[name=TestZOMBIEE]
As a chain command, always active, behind the other chain command above- Purpose = initiate redstone contraption that respawns all the mobs.
one way you could do it uses some redstone where a comparator is used to create a signal if a player is in range. if a player is then a impulse and chain block are set off killing all mobs, then when it detects that a player has gone away the opposite happens using a torch that gets switched off when redstone signal hits it (repeater into block). This would prevent it going off repeatedly but wouldnt work for multiplayer but i assume you have already come across that issue. Let me know if you have any more questions
Good morning, evening, or night,
I have commented here before about a bonfire-like system, though I still have the same issue with it as I did then. So I will try to elaborate more on the issue that I have currently with a bonfire system.
So I'm trying to make a bonfire-like system akin to the famous Dark Souls games. Where you are near a thing, and all enemies respawn. Though, it's the detection of being at a bonfire that makes this slightly difficult.
We decided to use tags as to make the bonfire respawn system happen only once. Otherwise it will endlessly kill and respawn mobs for as long as you stand by the bonfire, and that is extremely laggy.
So we made a Bonefire, and in it, an invisible armor stand named "NexusTestWaystone"
Me and my friend have created the commands to be like this:
Command Chain 1: senses when player is near bonfire---------------------------------------------------------------------------------------------
As a repeating command, always active- purpose= to detect when player is near the bonfire, it adds tag "inZone"
As a chain command, always active, behind the command above- Purpose = kill all mobs in gameplay area
As a chain command, always active, behind the other chain command above- Purpose = initiate redstone contraption that respawns all the mobs.
Command Chain 2: detects when player leaves bonfire area--------------------------------------------------------------------------------------
As a repeating command, always active- purpose= sense when players leave bonfire area, and remove tag "inZone"
As a chain command, always active, behind the repeating command above- purpose= turn off redstone contraption by removing redstone block
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
ISSUE: COMMAND CHAIN 2 DOES NOT DO ANYTHING
It doesn't do anything on my end. Nothing happens. It's as if I wrote the command wrong.
Can someone please give insight as to what is going on here? Especially with the setup I have going.
Could it perhaps be that this system is not compatible? Perhaps I wrote something in Command Chain 2 wrong? Anything will be of great help.
I hope you all have a great week.
Sincerely,
I.S.
one way you could do it uses some redstone where a comparator is used to create a signal if a player is in range. if a player is then a impulse and chain block are set off killing all mobs, then when it detects that a player has gone away the opposite happens using a torch that gets switched off when redstone signal hits it (repeater into block). This would prevent it going off repeatedly but wouldnt work for multiplayer but i assume you have already come across that issue. Let me know if you have any more questions
- Cubic
just use a scoreboard. @s has always been a bit finnicky
/scoreboard objectives add inRange dummy
repeating command block to see if anyone is in range: execute as @e[tag=NexusTestWaystone] run scoreboard players set @a[distance=..1] inRange 1
repeating command block to reset anyone out of range: execute as @e[tag=NexusTestWaystone] run scoreboard players reset @a[distance=1..] inRange