1

Death Activating Command Block

That_PricklyPair's Avatar That_PricklyPair10/27/16 4:42 pm
1 emeralds 9.5k 2
10/29/2016 11:15 am
That_PricklyPair's Avatar That_PricklyPair
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's Avatar
That_PricklyPair
Level 1 : New Miner
1

Create an account or sign in to comment.

2

1
10/27/2016 6:05 pm
Level 23 : Expert Engineer
Heklo
Heklo's Avatar
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
10/29/2016 11:15 am
Level 1 : New Miner
That_PricklyPair
That_PricklyPair's Avatar
Finally got it to work! Thank you!
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome