I am currently working on a mini game that involves two teams. I'm wondering if I can make a random team generator in Minecraft that varies with the amount of players that are in the game. For example if I had 8 players, I could have the two teams have 4 players on each. But if I had 10 players, I could have 5 players on each team. Can this be done with command blocks? I know how to make teams and assign people to them already with the scoreboard command, but I don't know how I can make a player amount varied team generator.