1

Testfor command

MrDimeren 4/6/14 2:53 pm
374
4/6/2014 3:02 pm
So how can i test if in an arena is 1 player left...
eg: i want that in a last man standing pvp...the comand block testfor only 1 player left in the arena
Posted by
MrDimeren
Level 27 : Expert System
3

  Have something to say?

JoinSign in

1

Jmal116
04/06/2014 3:02 pm
Level 34 : Artisan System
a comparator with a testfor will give off a signal strength, depending on how many people it finds. So /testfor @a will give off a signal strength of 5 if it finds 5 people, 10 if it finds 10 people, or 1 if it only finds one person.

To see who is left in the arena, you could use a scoreboard objective that tracks when a player loses. Let's say for now that I have an objective called "playing" which has a score of 1 if a player is in the game, and 0 if they are not. The command /testfor @a[score_playing_min=1] will testfor any player currently in the game, and output a signal strength based on how many it finds.
1

Welcome