One of the most fundamental applications of the Minecraft scoreboard is its ability to store objectives, or variables that store information about players. For example, you can have objectives that track players’ health or show how much damage each player has dealt. You can even have an objective that can be incremented via command block whenever a player completes an achievement.
The commands for objectives are as follows.
scoreboard objectives add <name> <criteriaType> [display name ...]
In a new world, the scoreboard has no objectives and does essentially nothing. You use the scoreboard objectives command to add a new objective to the scoreboard. <name> is the name of the objective (cannot contain spaces). <criteriaType> is the type of objective you’re creating, which can take the following values:
<any achievement or statistic name>: Use the official name of an achievement or statistic (found via autocompletion) to track it with this objective.
deathCount: Tracks the number of times the player has died.
dummy: This command never updates itself — it’s changed by command blocks, or players with cheating powers.
health: Tracks the player’s health. This is the only command that cannot be changed manually, and it changes only when the player’s health changes. Health is measured in half-hearts, so a player with a full 10 hearts has a health value of 20.
killedByTeam.<color>: Tracks the number of times the player was killed by a member of a team with a certain team color. For example, if a world is set up to be a fight between a red team and a blue team, members of the red team might have a killedByTeam.blue objective.
playerKillCount: Tracks the number of players that the tracked player has killed.
teamkill.<color>: The inverse of killedByTeam, tracks the number of kills the player has performed on players with a certain team color.
totalKillCount: Tracks the number of mobs (including other players) that the player has killed.
trigger: Like the dummy objective, can be changed only manually. However, even players without cheats can modify it, if given permission.
Lastly, [display name] is the name used whenever the objective is displayed. This name can contain spaces. If no display name is provided, the <name> is used instead.
Minecraft supports a wide range of characters, which is useful when making objectives look pretty.
scoreboard objectives list
Lists all the objectives you’ve created, including their display names and types.
scoreboard objectives remove <name>
Deletes the objective with a certain name (official name, not display name).
scoreboard objectives setdisplay <slot> [objective]
Displays an objective in a certain place in the world. <slot> can take the following values:
belowName: The objective’s name and value are displayed beneath the name tags of players. You cannot see this objective above your own character — only other players.
list: If you press the List Players button (Tab by default) you can see a list of all players on the server. If you use this objective display, the objective is displayed as a yellow number along with the player’s name on the list. Note that with this setting, the objective’s name is not displayed.
sidebar: A menu appears at the side of the screen. The top of the bar shows the objective name, and each row contains a player name along with her score in that objective. The sidebar doesn’t appear unless the objective has updated for at least one player.
sidebar.team.<color>: A suboption of the preceding command, this one causes the objective to be displayed on the sidebar, but only to characters with the specified team color.
If an objective name isn’t provided, the display slot is cleared so that any objective already there is removed.