I'm Trying to make a door that opens when you shoot an arrow in the middle, but I can't find a way to add coordinates to the parameters. Is there a way? (the current working command is /testfor @e[type=Arrow]
)
-
5Possible duplicate of What are the basics of commands in Minecraft Java Edition? – pppery Aug 14 '20 at 23:05
-
(target selectors and limiting them are one of the things covered by the answer to that question) – pppery Aug 14 '20 at 23:06
You should use the x, y, z and r parameters to search radius r from point xyz. These specific arguments can actually be compressed so long as they are in that order, so your command can look like this:
/testfor @e[x=10,y=64,z=10,r=1,type=Arrow]
Or this:
/testfor @e[10,64,10,1,type=Arrow]
You can also use dx, dy, and dz instead of r if you want to create a cuboid search area. For a 3*3*3 box centered at 10,64,10 you would do:
/testfor @e[x=9,y=63,z=9,dx=3,dy=3,dz=3,type=Arrow]