How to Track Health and Death Counts on Your HUD
Monitoring Player Stats
Tracking your survival statistics on screen helps you monitor how well you are coping with the mutant monsters and dangerous hordes. You can configure the scoreboard to display your current health and total deaths directly on the user interface.
Setting Up Scoreboard Objectives
Open your command input and create the health tracking objective by typing /scoreboard objectives add health health. To show player hearts in the player list, enter /scoreboard objectives setdisplay list health.
Next, track how many times each player dies by creating a death count objective using /scoreboard objectives add Deaths deathCount. Finally, display these player death counts directly under their names in the game world by typing /scoreboard objectives setdisplay belowname deaths.