So the problem I have here is I want to teleport a player standing at 1 34 70 to 273 33 -5.

I have tried using a clock with testfor @a [x=1.3,y=34,z=70] hooked up to a tp @p 273 33 -5 but when I go to 1 34 70 I don't get teleported.


I can see several issues with your setup.

  • First of all, there is no need for testfor here. The beauty of target selectors is that they work the same in all commands, including tp.
  • Secondly, there must not be a space between @a and the [] (the target selector arguments)
  • You can specify a radius with your target coordinates in order to make the detection more reliable. I am not sure which value the game assumes by default, but manually setting it to 1 can't hurt.

All things considered, the command you are looking for is simply

tp @a[x=1,y=34,z=70,r=1] 273 33 -5

or using 4 argument shorthand:

tp @a[1,34,70,1] 273 33 -5

Problem 1:
You have a space between the selector and the arguments. Remove that space to make your selector: @a[x=1.3,y=34,z=70]

Problem 2:
The coordinates in selectors cannot be decimals. As you are looking for someone at 1, 34, 70, just use those coordinates: @a[x=1,y=34,z=70]

Problem 3:
You are testing if someone is at 1, 34, 70, and then if there is, teleporting the nearest player to the command block to 273, 33, -5. What you actually want to do is teleport the person at 1, 34, 70 to 273, 33, -5. You should put the selector arguments into the tp command.

Problem 4:
There's no radius specified. You need to specify a radius from that point to test for. I'd recommend either a radius of 0 if you want to test just that block.

Fixing this should give you a working command:

tp @a[x=1,y=34,z=70,r=0] 273 33 -5

You could also compact this down into:

tp @a[1,34,70,0] 273 33 -5

Here is the wiki page on commands, which may be useful to read up on:


  • 1
    beat me by 21 seconds – MrLemon May 27 '15 at 15:21

Your Answer

