1
Death Activating Command Block
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
In a lot of my building I need to activate a command block every time a player dies. Could someone tell me how?
Thanks
Create an account or sign in to comment.
2
1
Yeah, so you need to create a scoreboard objective and call it for example deaths, with a criteria of 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:
And directly after this you would do this:
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.
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
Finally got it to work! Thank you!