mojira.dev
MC-105792

Radius parameter prevents command from running?

I'm trying to testfor a named armor stand at a certain coordinate along the x-axis, using this command:
/testfor @e[type=ArmorStand,name=Torcher,x=248,r=2]
The command works without the radius parameter, as it should, but not with it.
The command leads into some other command blocks that aren't too relevant, but here they are anyways:

Command Block 1:
/execute @e[type=ArmorStand,name=Torcher] ~ ~ ~ /setblock ~ ~ ~ minecraft:torch

Command Block 2:
tp @e[type=ArmorStand,name=Torcher] ~-256 ~ ~5

Comments 6

I don't think you can use the radius parameter with an X coordinate and no Y coordinate.

if only x, y, or z is provided, the others default to 0, if you don't specify a radius then, nothing special will happen, aka, without the r=2 added you test everywhere in the world, with the r=2 you test in a radius of 2 at x=248, y=0, z=0.
Provide the y and z to the coordinated of the armor stand, and that will fix your command.

@CubeTheThird @FVbico
I want to test on an entire axis, but I made it just for the area I need. (I don't want to test around one set of coords.)
Would this be the correct command, then?
/testfor @e[type=ArmorStand,name=Torcher,x=248,y=63,z=-424,dx=248,dy=63,dz=-168]
It doesn't seem to work. Is dx, dy, and dz relative to x, y, and z?

EDIT: Nvm. It is relative. Thanks guys!

Yes they are relative to x y and z, try looking on the minecraft wiki for more info.

@@unknown The unspecified parameters default to the coordinates of the sender. They do not default to 0 unless the command block running the command is stationed at those coordinates.

Mason TWD

(Unassigned)

Unconfirmed

Minecraft 1.10.2

Retrieved