1

Death Activating Command Block

That_PricklyPair 10/27/16 4:42 pm
10k
10/29/2016 11:15 am
Hello,
In a lot of my building I need to activate a command block every time a player dies. Could someone tell me how?
Thanks
Posted by
That_PricklyPair
Level 1 : New Miner
1

  Have something to say?

JoinSign in

2

Heklo
10/27/2016 6:05 pm
Level 25 : Expert System
Yeah, so you need to create a scoreboard objective and call it for example deaths, with a criteria of deathCount.
Click to reveal
/scoreboard objectives add deaths deathCount

What this does it creates an objective that increases by 1 every time a player dies.

From here you can do a few things, but here is how I would approach it:
Click to reveal
/execute @a[score_deaths_min=1] ~ ~ ~ [put some command here]


And directly after this you would do this:
Click to reveal
/scoreboard players reset @a deaths


What this does it forces a player with at least 1 death to execute a command, and the second part resets their score. Run the first execute command on a repeating command block, and have the scoreboard reset be attached to it on a chain command block.
1
That_PricklyPair
10/29/2016 11:15 am
Level 1 : New Miner
Finally got it to work! Thank you!
1

Welcome