TransWikia.com

How to limit a scoreboard team to have 1 player

Arqade Asked on December 25, 2020

I am trying to make teams that have a limit of 1 entity on them, for example, a game of hide and seek, where there is 1 seeker and 5 hiders. I need to have some of the teams in my world to have a limit of 1, somewhat incorporating a random selection process to select random players to place them on teams.

One Answer

There are no team properties to control limits, but what you can do is change your command setup to make sure that no more than one entity is assigned to each team.

Assuming you are using @r to select random players, let's try this:

/scoreboard teams join seeker @r

This command will add a random player to the seeker team. Now, just don't run that command again, and the seeker team will only have 1 player!

Now let's add everyone else as hiders:

/scoreboard teams join hiders @a[team=!seeker]

Answered by ExpertCoder14 on December 25, 2020

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