How to detect if a player out of one team dies

How to detect if a player out of one team dies - From below of crop multiethnic team of professional basketball players gathering and putting hands together while standing on playground before game

I've got a vanilla server for 1.10 and I already did a scoreboard with two different Teams (red, blue). Now I want to check if either a player on team red or a player on team blue dies and to have a redstone output out of it.



Best Answer

Set up an objective to keep track of deaths:

/scoreboard objectives add Deaths deathCount

To test if a a player on red team had died, run this command:

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

To test if a player on blue team had died, run this command:

/testfor @a[team=blue,score_Deaths_min=1]

You'll then probably need to set their Deaths back to 0 after doing what you want to do:

/scoreboard players set @a[score_Deaths_min=1] Deaths 0



Pictures about "How to detect if a player out of one team dies"

How to detect if a player out of one team dies - Man Catching Soccer Ball on Field
How to detect if a player out of one team dies - Faceless multiracial sport team stacking hands on court
How to detect if a player out of one team dies - Back view of African American teenage football player sitting on field ground and holding grid of gate while preparing to start play football match



How can you tell if someone died in Minecraft?

To testfor player's death, put in another command block: /testfor @a[score_deaths_min=<number of deaths>] . And there you go!

How can you tell if a player sneaks?

Create a scoreboard objective that counts player deaths. When it does, decrease it to 0, and execute the commands you want.



Player Death Detection - Mapmaking techniques




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

Images: Andrea Piacquadio, Pixabay, Monstera, RF._.studio