TransWikia.com

Is it possible for a player to be on two teams at once?

Arqade Asked on January 26, 2021

I am trying to make a game in 1.12.2 where players are divided into teams randomly. I’m using /scoreboard teams join teamA @r to randomly select players to join a team.

I am wondering, is it possible for a player to be on two teams at once? I am asking this because if the @r picks a player on teamA already and adds them to teamB, the entire map could break.

One Answer

From the Minecraft Wiki:

It is important to note that each individual team member can only be on one team; teams cannot share entities.

So the answer to your question is No, but however, if a player is already on a team and you try to assign it to another team, it overwrites the player's previous team. Meaning, if there are some players on teamA and you run /scoreboard teams join teamB @r, the random selection could pick a team member already on team A, and move them to team B.

You can fix this by making sure that the random selection selects players not on a team, like this:

/scoreboard teams join teamB @r[team=]

(team= selects entities that are not on any team.)

Correct answer by ExpertCoder14 on January 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP