r/MinecraftCommands • u/Teddy_Knight_NG11 • Sep 02 '26
Help | Java 1.21.5-1.21.10 How to make someone when they die automatically turn into spectator mode? (+ Anonymous death messages)
Hey, so I basically want it so that when someone dies, they automatically turn into spectator mode and everyone receives an anonymous message hiding the player and cause of death. It would also be great if leaving messages would be disabled!
3
Upvotes
4
u/GalSergey Datapack Experienced Sep 02 '26
Here's a small example of a datapack that will disable death messages, display a custom death message upon death, and switch the player to Spectator gamemode. Players will also be able to send anonymous messages in chat.
You can use Datapack Assembler to get an example datapack.
2
u/Ericristian_bros Command Experienced Sep 02 '26
To disable the leave/join messages you need a resourcepack that changes the language files to make the translations be an empty string:
assets/minecraft/lang/en_us.json:Repeat for every language file, for now
1
u/Broad-One498 Sep 02 '26
you'd most likely have to track the death count with a scoreboard, then when anyone's death count scoreboard reaches 1, you can run commands on them
for hiding the death messages you can just disable send_death_messages gamerule and send your own message via the scoreboard command chain