I want to detect when there is only one player left on a team.

I am making "Hunger Games" style PvP arena/event. When you die you go to the "Dead" team, and if you are still alive you stay on the "InGame" team.

I need to make it so if there is only one player left on the "InGame" team that it announces the winner and everybody returns to the lobby.

  • 1
    This is pretty close to what you want, but the answer is for 1.8 and doesn't use the 1.9 command blocks. – MBraedley Jan 16 '17 at 2:38
  • Close but no, this tests if all the players in a team are dead, i need to test id only one is alive – HungryBoy02 Jan 16 '17 at 3:17
  • @HungryBoy02 the difference in the command blocks between one player and no players left alive in a team is actually pretty small these days. You change one value in one command block, and you're done. – MBraedley Jan 16 '17 at 11:16
  • @MBraedly I am kind of new to scoreboards, i just learned how they work yesterday, could you explain? – HungryBoy02 Jan 16 '17 at 18:38

The more players on the "InGame" team, the stronger the redstone output, so this is what i did. My Solution


All you need is a hopper clock and some redstone mechanics.

Inside the command block you should put:

/testfor @p[team=alive,playercount=1]

This works on 1.8 or lower, but for less lag, use the 1.9 command blocks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.