1

I would like to execute from the red ArmorStand to the blue ArmorStands. And the blue ArmorStands should say "hi".

enter image description here

My problem is, that I can't use tags. So if I use "r=2" only the ArmorStands next to the red one will say "hi".

How can I select all eight blue ArmorStands without tags?

3

Easiest way would be to fiddle with execute's vertical offset until r=2 only selects the 8 you want:

/execute @e[name=Red] ~ ~1 ~ /execute @e[r=2,name=!Red] ~ ~ ~ /say hi

By placing the start of the spherical selection further up, you can avoid selecting the further away ones that you don't want to select.

A side view of this will look something like:

Spherical offset


Alternatively, you can use the dy, dx, dz cuboid volume selectors, again with an initial offset:

/execute @e[name=Red] ~-1 ~ ~-1 /execute @e[dx=2,dy=1,dz=2,name=!Red] ~ ~ ~ /say hi

Which looks like this:

Cuboid offset

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.