[SOLVED]Why do entity selectors with coordinates never work?

Such an intricate part of Minecraft that it deserves a whole section dedicated to it. Post your most amazing Redstone creations here!

Post Permalink
by Hallowizer » 6/19/2017

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.
Last edited by Hallowizer on 6/20/2017, edited 1 time in total.
Level 7
Apprentice Network
Posts: 17
Joined: 8/11/13

Post Permalink
by WorldEditor » 6/19/2017

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
User avatar
Level 24
Expert Modder
Posts: 1
Joined: 2/11/16

Post Permalink
by Bertiecrafter » 6/19/2017

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!
Image
Image
User avatar
Level 26
Expert Engineer
Posts: 445
Joined: 2/15/15
Says: gibi.minecraftr.us
Minecraft: Bertiecrafter
mc_server: GIBI - Gather It, Build It

Post Permalink
by Hallowizer » 6/20/2017

Thanks, it worked! (if you are reading this thread because you need help, this thread was created at version 1.12)
Level 7
Apprentice Network
Posts: 17
Joined: 8/11/13


Return to Redstone