1
Need Help With Command Blocks!!
I'm making an adventure map, and i've hit a brick wall developing it, because I can't figure out a way to add a death detector. All the video tutorials are really outdated, and I'm not sure how I would go about this.. Anyone help me?
6
It's really easy. You don't even need any command blocks. Just run these two from your chat. It won't look like it did anything, but as soon as you die, it will be displayed on the side of your screen.
/scoreboard objectives add Deaths stat.deaths
/scoreboard objectives setdisplay sidebar deaths
/scoreboard objectives add Deaths stat.deaths
/scoreboard objectives setdisplay sidebar deaths
Is there a testfor I can use to activate a command block whenever the player dies?
yeah.
/testfor @a[score_Deaths_min=1]
Or.
/execute @a[score_Deaths_min=1] ~ ~ ~ /whatever command you want here
Just don't forget to reset the players score, or the above commands will keep activating.
/scoreboard players set @a[score_Deaths_min=1] Deaths 0
/testfor @a[score_Deaths_min=1]
Or.
/execute @a[score_Deaths_min=1] ~ ~ ~ /whatever command you want here
Just don't forget to reset the players score, or the above commands will keep activating.
/scoreboard players set @a[score_Deaths_min=1] Deaths 0
I'd recommend making two scoreboards, one to show the deaths, and another that will test when the player dies, and gets reset back to 0 once the wanted command is executed.
You'd wanna use scoreboard, I think, set up to add 1 to a team made specifically to track deaths
That said, it's been a long time since I did anything with scoreboards or detection of deaths, so I may be mis-remembering.
That said, it's been a long time since I did anything with scoreboards or detection of deaths, so I may be mis-remembering.
I'm pretty sure that's the right thing, but whenever I try to set up the command blocks the way the almighty YouTube says, it gives me an invalid message.. would you happen to remember how you actually made the commands?
