I have skywars plugin where I have created .yml class for every joined player. In config player has score example: Code: score: 101001 How I get score in all these files and get best score? I dont have any idea now
Take a look at my factions plugin, specifically these lines of code: https://github.com/TheDiamondYT1/Po...etFactions/provider/JSONProvider.php#L60-#L69 Instead of json_decode, use yaml_parse and change any mentions of json to yml. Example PHP: $scores = [];$directory = $this->plugin->getDataFolder() . "players/";foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory)) as $file => $players) if(pathinfo($file)["extension"] === "yml") { $players = yaml_parse(file_get_contents($players)); $scores[$players["score"]] = $players["score"]; echo max($scores); }} This code is not tested. Written on a phone