1

Command Block Help - Selected target carried to next command

GhostlyFaced 8/30/21 11:06 pm history
151
8/31/2021 3:57 pm
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.
Posted by
GhostlyFaced
Level 38 : Artisan Architect
50

  Have something to say?

JoinSign in

10

SUPERIONtheKnight
08/31/2021 12:04 am
Level 30 : Artisan System
Just remove the tag from everyone, then give it back to those who are in the area.

/tag @a[tag=inTraining] remove inTraining/execute positioned ~-20 ~-17 ~-55 run tag @a[dx=42,dy=15,dz=54] add inTraining
That should work, unless I am missing something, or don't have enough information.
Hope this helps! :)
2
GhostlyFaced
08/31/2021 12:06 am
Level 38 : Artisan Architect
history
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.
1
SUPERIONtheKnight
08/31/2021 12:10 am
Level 30 : Artisan System
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.
2
GhostlyFaced
08/31/2021 12:13 am
Level 38 : Artisan Architect
history
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.
1
SUPERIONtheKnight
08/31/2021 12:41 am
Level 30 : Artisan System
history
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:
Setup


Hope this helps!
2
GhostlyFaced
08/31/2021 1:01 am
Level 38 : Artisan Architect
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!
2
DoomKittyAttack
08/30/2021 11:24 pm
Level 16 : Journeyman Modder
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
2
GhostlyFaced
08/30/2021 11:46 pm
Level 38 : Artisan Architect
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.
1
DoomKittyAttack
08/31/2021 10:46 am
Level 16 : Journeyman Modder
2
GhostlyFaced
08/31/2021 3:57 pm
Level 38 : Artisan Architect
That makes sense. I'll probably use that in a different system of the arena.
1

Welcome