1
Command Block Help - Selected target carried to next command
So, I'm trying to make it so that whenever someone leaves the given area they lose the "inTraining" tag so that a number of other effects occur. I have a command giving the tag in the area every tick, but even so, I can't have people who are inside lose their "inTraining" tag for even a tick, which, as my code is currently written, I think it will. Any assistance is greatly appreciated.
/execute positioned ~-20 ~-17 ~-55 unless entity @a[dx=42,dy=15,dz=54] run tag @a[tag=inTraining] remove inTraining
I've tried '/execute as @a at @s' to no avail, and the combinations of @a then @s, @s then @a, and @s then @s.
/execute positioned ~-20 ~-17 ~-55 unless entity @a[dx=42,dy=15,dz=54] run tag @a[tag=inTraining] remove inTraining
I've tried '/execute as @a at @s' to no avail, and the combinations of @a then @s, @s then @a, and @s then @s.
10
Just remove the tag from everyone, then give it back to those who are in the area.
That should work, unless I am missing something, or don't have enough information.
Hope this helps! :)
/tag @a[tag=inTraining] remove inTraining/execute positioned ~-20 ~-17 ~-55 run tag @a[dx=42,dy=15,dz=54] add inTrainingThat should work, unless I am missing something, or don't have enough information.
Hope this helps! :)
The problem is that that causes those inside to not have the tag for a tick. In this case that means they will have the equipment given to them cleared when it shouldn't be.
Are you running the next command via a repeater or something? If you run them via a function, or repeating/chain command blocks, it should run in a single tick.
I have the command that gives the tag in an area on repeat, and the one that removes tied to a clock. In how you have it shown would the first be repeating and the second on chain?
I could share pictures or the world download if you were willing to/wanted to have a look.
I could share pictures or the world download if you were willing to/wanted to have a look.
I believe that is backwards actually. You should have the one that removes the tag on repeat, and the one that gives the tag in the chain command block.
If that doesn't work, then yes a world download/pictures could definitely be helpful!
Here's some pictures demonstrating what I'm talking about, notice how the repeating command block points into the chain command block:


Hope this helps!
If that doesn't work, then yes a world download/pictures could definitely be helpful!
Here's some pictures demonstrating what I'm talking about, notice how the repeating command block points into the chain command block:
Setup


Hope this helps!
Ah! That's fixed it! I didn't realize having chained command blocks would execute all commands within the same tick, thus not having one where the tag is not applied to those it should be. Awesome, thank you!
if you dont have any way to teleport out of that area you could make it so if you enter the area around there you lose that tag
like 1=remove tag 0 = give tag
11111111111111111
10000000000000001
10000000000000001
10000000000000001
11111111111111111
you get the idea
like 1=remove tag 0 = give tag
11111111111111111
10000000000000001
10000000000000001
10000000000000001
11111111111111111
you get the idea
The problem is that the area is an arena you are expected to die in which would lead to people tp'ing to there own spawn areas and keeping the tag. Worst case scenario I can force a spawn area, but I'd prefer it to be more flexibly used.
hmmm maybe remove the tag on death
https://gaming.stackexchange.com/questions/202816/can-you-use-testfor-to-detect-the-death-of-a-player
https://gaming.stackexchange.com/questions/202816/can-you-use-testfor-to-detect-the-death-of-a-player
That makes sense. I'll probably use that in a different system of the arena.
