How to set up teams with command blocks?
I am making a mini game in Minecraft where when you first spawn in you are in a lobby where there are two 2 3x2 caves, one blue, the other red. When someone walks into one of the caves it adds them to the blue or red team.
I am wanting to know how to
Add someone to a team when they walk into one of the respective caves
Set it so when they press start game it teleports the players to their respective bases, not to the same one
Finally, its going to be a game where you kill the other team's leader (a wolf or ocelot) but how can i keep them from moving around without a fence or barrier because they are the leader.
It would be easy to set up something that will check for players at X. example it would check for players at 93 9 20 then activate another command block.
Pictures about "How to set up teams with command blocks?"



How do you make a Minecraft team with a command block?
How to Enter the CommandHow do you use the teams command?
How to get a Command BlockMapmaking: The Basics #10 - /Team Command | Minecraft Java Edition
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Joshua Miranda, Joshua Miranda, Cup of Couple, Karolina Grabowska
