Scoreboard

Create a death counter

Create and display a count of player deaths

Edition
Java Edition
Version
Java Edition 1.20.5 - 1.21.4
Difficulty
Intermediate
Prep time
3 minutes
Copied
11 times
Permission
Requires cheats to be enabled or operator permission

When to use it

Create an automatic Java death counter using deathCount, unlike a dummy counter requiring explicit score changes. The two steps create it and select the sidebar display; they do not reconstruct deaths from before creation.

Before running

Check existing objectives for a deaths name collision, then create it before selecting the display. Record the previous sidebar objective because this selection can replace an existing scoreboard.

Follow in order

All commands

1

Create the objective

/scoreboard objectives add deaths deathCount "จำนวนการตาย"

Creates a counter that updates automatically

2

Show it in the sidebar

/scoreboard objectives setdisplay sidebar deaths

Displays the score in the sidebar

What to customize

If renaming the deaths identifier, update both lines. The quoted Thai text is the display name and can change independently. Keep deathCount as the criterion for automatic counting.

Verify the result

Use a world copy and a disposable test inventory to confirm a death after objective creation increases the score. Do not put real players’ equipment at risk merely to make a scoreboard row appear.

When results differ

If the objective exists, inspect its criterion and data instead of deleting it and losing accumulated scores. An empty display may simply have no player scores yet; recreating the objective is not the remedy.

Related presets