1

Command Block testfor

ubiquitron 1/20/14 7:04 pm
1.6k
1/20/2014 7:18 pm
I am trying to do a simple TESTFOR <USERNAME>[r=3] to test if that specific user is within 3 blocks of the command block. It does not work. Is this supposed to work? I couldn't get it to work when I was trying TESTFOR <USERNAME>[x=XX,y=YY,z=ZZ] either.

So, am I doing something wrong or is there just not a way to test for a specified user in the vicinity of the command block?

Any help would be greatly appreciated.
Posted by
ubiquitron
Level 5 : Apprentice Miner
2

  Have something to say?

JoinSign in

3

MadOliveGaming
01/20/2014 7:18 pm
Level 34 : Artisan System
davidj919/testfor @p[r=3]
or if you need a specific player's name, do what Olive said.

For coordinates:
testfor @p[x=#,y=#,z=#,r=3]
Note: you need to have a radius! Set it to "1" if you want that exact block.
[/quote]

Em did you read the post? Cuz he clearly stated he wants to use a specific player name. Anyway, this works if you just want to tp the player that is the nearest to the commandblock out of all player that are within a range of 3 blocks from the commandblock.

Also if you enter cords you dont NEED to enter a range. If you dont put in a rage it will just asume you only mean to use that one specific block. If you just use @p without a range it will assume you dont want to limit its radius and pick the player who is the closest to the commandblock, however far away he might be.
1
DaSquyd
01/20/2014 7:15 pm
Level 32 : Artisan Toast
testfor @p[r=3]
or if you need a specific player's name, do what Olive said.

For coordinates:
testfor @p[x=#,y=#,z=#,r=3]
Note: you need to have a radius! Set it to "1" if you want that exact block.
1
MadOliveGaming
01/20/2014 7:10 pm
Level 34 : Artisan System
Do it like this: /testfor @p[r=3,name="enter username"]
1

Welcome