1
[SOLVED]Why do entity selectors with coordinates never work?
Hi! I think the title explains it, coordinate selectors never work. For example:
/tp @a[x=0,y=0,z=0] ~ ~1 ~
inside of a repeat-always-on command block will keep teleporting me above the command block, even if I never stood at 0,0,0 in the first place. And I see other examples of this working fine, by other people.
Is this because mojang decided to be stupid and use the windows encoding instead of UTF-8? This probably isn't the case because other selectors like tags and scoreboard objectives still work.
/tp @a[x=0,y=0,z=0] ~ ~1 ~
inside of a repeat-always-on command block will keep teleporting me above the command block, even if I never stood at 0,0,0 in the first place. And I see other examples of this working fine, by other people.
Is this because mojang decided to be stupid and use the windows encoding instead of UTF-8? This probably isn't the case because other selectors like tags and scoreboard objectives still work.
Create an account or sign in to comment.
6
1
HallowizerHi! I think the title explains it, coordinate selectors never work. For example:
/tp @a[x=0,y=0,z=0] ~ ~1 ~
inside of a repeat-always-on command block will keep teleporting me above the command block, even if I never stood at 0,0,0 in the first place. And I see other examples of this working fine, by other people.
Is this because mojang decided to be stupid and use the windows encoding instead of UTF-8? This probably isn't the case because other selectors like tags and scoreboard objectives still work.
Why are u putting an xyz format?
NO NON NNOONONONONONNOO
U are doing it wrong.
To target an entity, u have to do either :-
@p @a or @e or even @r
example if u want to teleport a zombie.
/tp @e[type=zombie] ~ ~ ~1
or if you want it to execute continuous teleportation
/execute @e[name="Zombie"] ~ ~ ~ /tp @e[name="Zombie"] ~ ~ ~1
Simple as a piece of cake. U were complicating this.
1
try putting r=1 at the end
1
Thanks, it worked! (if you are reading this thread because you need help, this thread was created at version 1.12)
1
You got two things wrong
the xyz arguments define the coords of execution (not the filtered location), add dx=#,dy=#,dz=# OR r=# to define a cube or sphere where the player has to be in.
So for everyone EXACTLY in the coords 1 5 8: /tp @a[x=1,y=5,z=8,dx=0,dy=0,dz=0] ~ ~1 ~
Secondly, the tp command teleports whatever entity relative to the entities position.
So if you would do: /tp @e ~ ~1 ~, it will tp anything 1 block upwards in the same position.
There are two ways to fix this:
/tp (...) 0 1 0
- You use stationary coords to teleport whatever to 0 1 0
Or
/teleport (...) ~ ~1 ~
- The teleport command teleports whatever entity relative to the command executor's position, which in this case is the block above the command block.
Good luck!
the xyz arguments define the coords of execution (not the filtered location), add dx=#,dy=#,dz=# OR r=# to define a cube or sphere where the player has to be in.
So for everyone EXACTLY in the coords 1 5 8: /tp @a[x=1,y=5,z=8,dx=0,dy=0,dz=0] ~ ~1 ~
Secondly, the tp command teleports whatever entity relative to the entities position.
So if you would do: /tp @e ~ ~1 ~, it will tp anything 1 block upwards in the same position.
There are two ways to fix this:
/tp (...) 0 1 0
- You use stationary coords to teleport whatever to 0 1 0
Or
/teleport (...) ~ ~1 ~
- The teleport command teleports whatever entity relative to the command executor's position, which in this case is the block above the command block.
Good luck!
1
Thats technicaly not the way xyz works. The Argument xyz selects Enties based on their distance from that position. If you specify no distance (Radius, or as you said, Volume) all entities will get selected. If you specify a Volume dx,dy,dz or a radius r it only selects Entities in a radius/volumen from that position.
Edit: Sry, read your reply again, it seems you said just that *facepalm*
Edit: Sry, read your reply again, it seems you said just that *facepalm*
1
Try this
~ ~ ~ - x y z
Armor stand tp @e[type=ArmorStand,r=1] ~ ~ ~
Zombie - tp @e[type=Zombie,r=1] ~ ~ ~
Player - tp @a -1983 35 2890
~ ~ ~ - x y z
Armor stand tp @e[type=ArmorStand,r=1] ~ ~ ~
Zombie - tp @e[type=Zombie,r=1] ~ ~ ~
Player - tp @a -1983 35 2890