How do I set up command blocks to teleport the winning team?

How do I set up command blocks to teleport the winning team? -

Summary: I am making a mini game in Minecraft where you kill the other teams which you can select from either a wolf or ocelot (it's already tamed).

Question: How can I set it up to teleport all the players and say the team that won.

What I tried: I tried using /scoreboard objectives add leader_stat stat.killEntity.Ozelot. Then in another command block I typed /testfor @a[score=leader_stat=1] so when 1 kill happens it will activate but I can't add the two teams, then I get all lost.



Best Answer

The command to check if anyone on team red has killed an ocelot is

/testfor @a[score_leader_stat=1, team=red]

Note that there's an underscore between score and leader_stat, not an equal sign! Get the output of that command block and hook it into two other command blocks with

/tp @a[team=red] x y z
/tellraw @a {text:"Red Team has slain the Ocelot!", color:red}

In a 1.8 snapshot, you could also use

/title @a title {text:"Red Team has slain the Ocelot!", color:red}

to get a large text display. You will need a set of such command blocks for every team and every possible leader. Note that if red team's leader is an Ocelot as well, they will also win the game by killing their own leader.




Pictures about "How do I set up command blocks to teleport the winning team?"

How do I set up command blocks to teleport the winning team? -
How do I set up command blocks to teleport the winning team? - Woman Wearing Black Bra and White Tank Top Raising Both Hands on Top
How do I set up command blocks to teleport the winning team? - Photo of a Winning Cheering Team



How do you use command blocks to teleport?

Type this command in when having the command block GUI open /teleport @p <x> <y> <z> . Then, activate the command block with redstone (including buttons, levers, and pressure plates), and they will be sent to their destination. The player can set up multiple different teleports.

How do you teleport to a team in Minecraft?

You can teleport other players, too. Just type their username before the coordinates \u2014 so if you're trying to teleport a player named JohnDoe, you'll type: /tp JohnDoe 70 70 70. And if all you want is to teleport yourself to JohnDoe (or any other player), just type: /tp JohnDoe.

How do you make a command block team in Minecraft?

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"}


  • Why is my teleport command block not working?

    You'll need to replace the @s with either your in-game name, or @a for all players. If you want it to teleport only the person who activates the command block then that might work with @p, or you may need an /execute command that uses a target selector argument .



    Minecraft How To Detect Winner, Random Teleports - Minigame Commands (Vanilla Bedrock)




    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Geometric Photography, Geometric Photography, Tirachard Kumtanom, cottonbro