1.8 and later
/scoreboard players reset
removes a player's score in a specified objective completely, making it so that the player doesn't show up in the sidebar display slot.
First, set up a kill counter objective
/scoreboard objectives add killCounter playerKillCount Kills
Set up a 20 Hz. clock (or use 1.9's repeat/chain command blocks) and have it run:
/scoreboard players reset @a[name=!<player>]
where <player>
is replaced by the player's name. If you want to track more than one player's kills, you have to figure how to target all players whose kills you don't want to track. Most of the time, you should already know how to select these players based on how they were selected to be shown in the first place. If not, a simple way to do this is to use the scoreboard tags introduced in 1.9:
/scoreboard players tag <player> add trackKills
where <player>
is replaced by the player's name or a valid target selector. Run this once for every player to be tracked, then use @a[tag=!trackKills]
in the scoreboard reset command above.
1.7
Without reset
, we'll need two objectives. One to track all players' player kills, and one to store kills for certain players:
/scoreboard objectives add killCounter playerKillCount
/scoreboard objectives add selectKillCount dummy Kills
Set up a 20 Hz. clock and have it run these commands in order:
/scoreboard players add @a[name=<player>,score_killCounter_min=1] selectKillCount 1
/scoreboard players set @a killCounter 0
Replace <player>
with the name of the player to track. When tracking more than one player, you'll have to assign them some score in another dummy objective and use that in the target selector instead of name
.