I'm making a multiplayer minigame, I don't know how to test for another player in a radius, the command that i want is like when a player get near to another player in a radius of 3 then a command will run, execute @a ~ ~ ~ testfor @a[r=*radius*]
don't help because it will just target you in it, add the [c=*count*]
don't help me neither, because the command also return true if there's one match (and that's you)
1 Answer
You almost got it. Use the rm
parameter, which specifies the minimum distance:
/execute @a ~ ~ ~ testfor @a[r=R,rm=RM]
Where RM is less then R, logically.
Or, if you would like to execute a command after this one returns true, combine them together:
/execute @a ~ ~ ~ execute @a[r=R,rm=RM] ~ ~ ~ /your-command
-
-
@ĐặngQuốcTrung Thanks for coming back and marking this answer as accepted. By this you help future visitors. Dec 4, 2016 at 10:41
-
yea i know :) Hope that everyone know to minecraft awesome commands to do some amazing things Dec 5, 2016 at 12:54