2
I'm trying to make a Minecraft Spleef minigame sort of thing and my redstone currently goes like this:
1. When the start button is pressed, the map clears, all the players get spread out, all the players get added to the team 'player', and the game begins. Once a player dies, they're added to a team called 'dead'.
2. This is the part I'm confused at. Here, I want to execute a command if exactly one player is on the team 'player'. I do not know how to do this.
3. Once the check is complete, it will teleport everyone back to a lobby and clear inventories.
So basically, I need to know how to run a command if only one person is on the team 'player'. Thanks.
1. When the start button is pressed, the map clears, all the players get spread out, all the players get added to the team 'player', and the game begins. Once a player dies, they're added to a team called 'dead'.
2. This is the part I'm confused at. Here, I want to execute a command if exactly one player is on the team 'player'. I do not know how to do this.
3. Once the check is complete, it will teleport everyone back to a lobby and clear inventories.
So basically, I need to know how to run a command if only one person is on the team 'player'. Thanks.
Create an account or sign in to comment.
1
3
The setup for this requires the use of a few more commands.
First, setup a scoreboard to keep track of how many players are on a team at a given time.
/scoreboard objectives add playerCount dummy
Then, on a repeating command block, store the result of the list of the players on the team to the scoreboard.
/execute store score players playerCount run team list player
Finally, run the command on a repeating command block to test for only one player on a team.
/execute if score players playerCount matches 1 run [Your tp command here]The setup for this requires the use of a few more commands.
First, setup a scoreboard to keep track of how many players are on a team at a given time.
/scoreboard objectives add playerCount dummy
Then, on a repeating command block, store the result of the list of the players on the team to the scoreboard.
/execute store score players playerCount run team list player
Finally, run the command on a repeating command block to test for only one player on a team.
/execute if score players playerCount matches 1 run [Your tp command here]
Also, keep in mind that if kept on the "player" team, the one player at the end will continuously teleport to that location.
First, setup a scoreboard to keep track of how many players are on a team at a given time.
/scoreboard objectives add playerCount dummy
Then, on a repeating command block, store the result of the list of the players on the team to the scoreboard.
/execute store score players playerCount run team list player
Finally, run the command on a repeating command block to test for only one player on a team.
/execute if score players playerCount matches 1 run [Your tp command here]The setup for this requires the use of a few more commands.
First, setup a scoreboard to keep track of how many players are on a team at a given time.
/scoreboard objectives add playerCount dummy
Then, on a repeating command block, store the result of the list of the players on the team to the scoreboard.
/execute store score players playerCount run team list player
Finally, run the command on a repeating command block to test for only one player on a team.
/execute if score players playerCount matches 1 run [Your tp command here]
Also, keep in mind that if kept on the "player" team, the one player at the end will continuously teleport to that location.