0

So let's say I have 2 teams, Winner and Player. When a player is the only one left on Player, I want to add them/switch them to Winner and remove them from Player. I already have all the testing for figuring out how many players there are on a team, but I still need the command for switching the players.

1 Answer 1

2

To switch a person still on the Player team to the Winner team:

/scoreboard teams join Winner @a[team=Player]

You can only be in one team at once, so this will also automatically remove them from the Player team.

7
  • Any person on the Player team will be switched to the Winner team, not just a person. Feb 15, 2016 at 16:32
  • @sharpturn It'll only switch one person if OP has it set up as they say they have (though the command does have the ability to switch more people if the Player team has more than one person left).
    – SirBenet
    Feb 15, 2016 at 16:48
  • Ah, yes, I suppose so. I just normally use @p when switching one player. The word "the" used to describe an @a command with no count target selector var just the me off a bit. Sorry for the confusion! Feb 15, 2016 at 20:47
  • @sharpturn @p doesn't select dead players, so may not always move the player from the Player team to the Winner team.
    – SirBenet
    Feb 15, 2016 at 21:06
  • Ah. And I suppose. @a[c=1] would be kind of pointless here. Feb 15, 2016 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .