Minecraft wiki entry for Scoreboard, associated text: Commands can be used to check whether team members exist by using target selection with the "team" argument. (The '!' character may be placed before a name to check for entities not on a team.) For example, inputting /execute if entity @a[team=red] into a command block provides comparator output if any player exists on the red team. Conversely, /execute if entity @a[team=!red] provides output when there are no players on the red team. /execute if entity @a[team=!] allows output when any player is on at least one team, and /execute if entity @a[team=] allows output when no players are on any teams.