1

I'm trying to test if an entity is positionned at a very specific coordinate to then and only then tag itself and others.

Here's the command:

execute as @e[type=minecraft:armor_stand,tag=pillar_first,tag=bot] positioned ~ 45.518 ~ at @s run tag @e[type=minecraft:armor_stand,tag=pillar_first] add complete

The command block is litterally ignoring the positionned condition and tags right away.

What have I done wrong?

1

There are two different problems with the command:

  1. The second at @s repositions the command to the armor stand, negating the previous positioned ~ 45.518 ~.
  2. Target selectors by default have no range limit, so even if the command were positioned correctly, it would still find the armor stand wherever on the map it is.

The corrected command would be:

execute as @e[type=minecraft:armor_stand,tag=pillar_first,tag=bot] at @s positioned ~ 45.518 ~ if entity @s[distance=...1] run tag @e[type=minecraft:armor_stand,tag=pillar_first] add complete

This command checks if the armor stand is within one tenth of a block of the given coordinates, since checking if it is there exactly does not work for reasons I can't figure out. This may not be what you want.

| improve this answer | |
  • Thank you, but why is there "if entity @s[distance=0]"? The command in itself now does nothing, which is not what I want of course. And when I remove the "if entity @s[distance=0]" it does as before. – MaxAnimator Aug 4 at 18:05
  • @MaxAnimator That is the meat of the command, checking if the armor stand is actually there. Without that command it checks if the armor stand is anywhere. Anyway, the answer should be fixed now. – pppery Aug 4 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.