I'm trying to make map where if you die, it says in the chat that the player in question has died. For example, if a guy named BlehBlehBleh died, it would say in the chat, "BlehBlehBleh has died!" or something like that.
P.S I think it has something to do with scoreboards.
Minecraft – way to find out a player’s name using commands
minecraft-commandsminecraft-java-edition
Related Topic
- Minecraft – How to delete all items but one in a players inventory
- Minecraft-Java-Edition – How to Make a Scoreboard Score Increase by a Percentage in Minecraft 1.10
- Minecraft – way to give point to only those who have certain points
- Minecraft – How to trigger Command Blocks when a player walks in a certain area
- Minecraft Java Edition – How to Skip a Line with Multiple Text in Tellraw
- Minecraft – How to put a player’s name in a /title command
- Minecraft Commands – How to Attribute Damage to a Particular Source in Minecraft Java Edition 1.14
Best Answer
Using selectors, you can easily say BlehBlehBleh died! With the say command
/say @a[deaths=1] has died!
That will say any player with the score deaths = 1 has died. Then you would set his deaths to 0 to avoid a loop :) Also, detect IF a player has died first before doing the command. So order of the commands:scoreboard players test @a deaths 1
Then
say @a[deaths=1] has died!
scoreboard players set @a[deaths=1] deaths 0
So you would be right thinking its about scoreboards.
Edit: To store someones name in a scoreboard just make an objective then type this in
scoreboard players set @a objectiveName 0
That would make the score of every player set to 0. To add a deathcount just doscoreboard objectives set deaths deathCount
I believe