How to set up teams with command blocks?

How to set up teams with command blocks? - Wooden blocks placed in row on table

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

  1. Add someone to a team when they walk into one of the respective caves

  2. 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 to set up teams with command blocks? - Closeup of wooden blocks placed on top of each other for playing board game
How to set up teams with command blocks? - Free stock photo of apartment, cabinet, contemporary
How to set up teams with command blocks? - Set of shiny transparent amethysts grown together



How do you make a Minecraft team with a command block?

How to Enter the Command
  • Open the Chat Window. The easiest way to run a command in Minecraft is within the chat window.
  • Type the Command. In this example, we will create a team called "Team DigMinecraft" in Minecraft Java Edition (PC/Mac) 1.15 with the following command: /team add Team1 {"text":"Team DigMinecraft"}


  • How do you use the teams command?

    How to get a Command Block
  • Enable cheats in your world or Realm settings.
  • Turn on Creative Mode in your world or Realm settings.
  • Open the chat box and enter \u201c/give [your username] command_block\u201d
  • Place the block where you want it.




  • Mapmaking: 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