So this works for like 1 hour but then it just breaks, as in all the "kills" become 0. The stats's are still there (like in the player file) but it doesn't show up on the list. I don't know why... Code:java public final HashMap<String, Integer> kills = new HashMap<>(); public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) { List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet()); Collections.sort(list, new Comparator<Map.Entry<K, V>>() { public int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2) { return (o1.getValue()).compareTo(o2.getValue()); } }); Map<K, V> result = new LinkedHashMap<>(); for (Map.Entry<K, V> entry : list) { result.put(entry.getKey(), entry.getValue()); } return result; } public void onSortKills(String s, Player player) { switch (s.toLowerCase()) { case "kills": String path = plugin.getDataFolder().getAbsolutePath(); String plugins = path.substring(0, path.lastIndexOf(File.separator)); File users = new File(plugins + File.separator + "PVPScores", "userdata"); if (users.exists()) { for (File file : users.listFiles()) { String ss = file.getName().toLowerCase().replace(".yml", ""); YamlConfiguration config = YamlConfiguration.loadConfiguration(file); int i = config.getInt(ss + ".kills"); String name = config.getString(ss + ".name"); kills.put(name, i); } } String msg = plugin.getConfig().getString("statstop.kills"); List<String> strings = new ArrayList<>(); int count = 0; for (Map.Entry<String, Integer> in : sortByValue(kills).entrySet()) { count++; strings.add(msg.replace("{NAME}", in.getKey()).replace("{KILLS}", Integer.toString(in.getValue()))); if (count == 10) { break; } } count = 0; Collections.reverse(strings); if (plugin.getConfig().getBoolean("statstop.this-before-kills")) { for (String pm : plugin.getConfig().getStringList("statstop.before-kills")) { player.sendMessage(ChatColor.translateAlternateColorCodes('&', pm)); } } for (String fin : strings) { count++; player.sendMessage(ChatColor.translateAlternateColorCodes('&', fin.replace("{RANK}", Integer.toString(count)))); } if (plugin.getConfig().getBoolean("statstop.this-after-kills")) { for (String pm : plugin.getConfig().getStringList("statstop.after-kills")) { player.sendMessage(ChatColor.translateAlternateColorCodes('&', pm)); } } break; } }