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.
-
Have you tried anything yourself?– rivermontCommented Jun 18, 2016 at 14:00
-
1You may want to take a look into creating an objective with the "teamkill" criterion and then use "/scoreboard players test @a <objective> 1" to determine a kill of a member of the team. Instantly afterwards resetting with "/scoreboard players set @a <objective> 0". Do this for both teams.– RimaNariCommented Jun 18, 2016 at 14:47
Add a comment
|
1 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