So, in my plugin, every time a player is in the block on the floor, I add +1 to their respective place in the configuration, see: Code: --- Steve: 431. Alex: 125 Mia: 654 Vicent: 334 ... I wanted to have three of those who put a majority of the blocks, but I can not think of any method that I can do this. Any help is welcome, thank you.[/Code]
If your question is finding the top three of all of them.. Use arsort() PHP: //class extending PluginBase$path = $this->getDataFolder()."config.yml";$array = yaml_parse_file($path);arsort($array);$players = array_keys($array);/*** If you just want the top 3 player names,* you can end here.* Top 3:* * $players[0]* * $players[1]* * $players[2]** Their scores:* * $array[$players[0]]* * $array[$players[1]]* * $array[$players[2]]*/$top3 = [];for($i = 0; $i < 3; ++$i){ $top3[$players[$i]] = $array[$players[$i]];}/**$top3 = [ "Mia" => 654, "Steve" => 431, "Vicent" => 334];*/