Minecraft – Get the player with the highest score on the scoreboard

minecraft-java-edition

How can I get the player with the highest score on a scoreboard according to a player's kills in Minecraft? I have tried doing:

/tellraw @a[score_kill_min=1,team=Seekers] {text:"You won!"}

Best Answer

Test for how many people have a positive kill count:

testfor @a[score_kill_min=1, team=Seekers]

If there is more than 1 person, then decrease everyone's kill count then test again:

scoreboard players remove @a kill 1

When there is only 1 person, give the message:

tellraw @a[score_kill_min=1,team=Seekers] {text:"You won!"}

You will also probably want to set everyone's kills back to 0:

scoreboard players set @a kill 0