I am trying to make a command block that when powered, it will looks for a specific player in a 5 block radius of the command block. I tried
/testfor @p[r=5][name=<name of player>]
but it doesn't work.
Arqade is a question and answer site for passionate videogamers on all platforms. It only takes a minute to sign up.
Sign up to join this communityI am trying to make a command block that when powered, it will looks for a specific player in a 5 block radius of the command block. I tried
/testfor @p[r=5][name=<name of player>]
but it doesn't work.
You can't use two []
next to each other.
/testfor @p[r=5,name=<PlayerName>]
Use a comma to separate different values. Don't add another []
next to it.
name=!MyName
for that, i.e. "name equals (not MyName)". Same for other fields such as type
– MrLemon
Feb 25 '15 at 12:26
@a
instead of @p
is better.
– Anders Lindén
Jan 19 '17 at 18:49