0

I have tried using commands from /testfor @a[r=4.5], /tp @a[r=4.5], /entitydata @e[type=Player,r=4.5], etc. and nothing works. I want it to teleport any player within range of my machine. It kind of works as a giant portal but it doesn't work without the teleporting part (duh).

Cons: I can't use @e because there's armor stands in the area for other reasons and eventually I'm going to start spawning zombie's in the area for (also) other reasons. I am using 1.10.2 so maybe that's the reason the commands aren't working. Please answer for me and those with similar problems.

3
  • Testfor @p[r=5] for a min range of 5 blocks Jul 14, 2016 at 19:48
  • Note - u can use type=Player with @e and it works like @a, u can also use type !=Armo...ur?Stand (i dont know how to spell it :P so it will teleport all entities except armour stands :)
    – HardnerPL
    Jul 15, 2016 at 17:48
  • Whether I do @p, @e or @a, the entity UUID is invalid.
    – BlueNinja
    Jul 18, 2016 at 19:03

1 Answer 1

2

You cannot use decimal points in selectors. Try something like:

/tp @a[r=4] X Y Z
3
  • Note that this solution works if the command block is in the center of the area to detect. Use a command such as /tp @a[x=0,y=0,z=0,r=4] X Y Z to test the radius around the block at (0,0,0). (You can also shorten this to /tp @a[0,0,0,4] X Y Z, since x, y, z, and r are the default first arguments of a target selector)
    – GamrCorps
    Jul 15, 2016 at 3:32
  • Colorfusion, /tp @a[0,0,0,4] 324 4 -298 didn't even give an output, Are you sure it's 1.10.2 friendly? Also, why is there two spots for typing coordinates?
    – BlueNinja
    Jul 18, 2016 at 18:59
  • @BlueNinja The first set of coordinates is the center of the radius where people will be teleported from. The command you've given will teleport anyone standing within 4 blocks of coordinates (0, 0, 0). If you don't specify coordinates, the radius will be centered around the thing executing the command (like the command block the command is in). You should use the coordinates of your machine for the first set, or leave them blank. The second set is where people are teleported to.
    – SirBenet
    Jul 18, 2016 at 22:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .