It does not save "name" section of the file , can not find what's wrong .. (Google translate) Code: @EventHandler public void onJoin(PlayerJoinEvent e){ Player player = e.getPlayer(); String UUID = player.getUniqueId().toString(); settings.genPlayerFile(UUID); settings.getPlayerFile(UUID).set("name", player.getName().toString()); settings.savePlayerFile(UUID); } Code: public void genPlayerFile(String UUID){ File tempfile = new File(Main.plugin.getDataFolder() + File.separator + "/Players", UUID + ".yml"); if(!tempfile.exists()){ try{ tempfile.createNewFile(); }catch(IOException e){ e.printStackTrace(); } } } public FileConfiguration getPlayerFile(String UUID){ File tempfile = new File(Main.plugin.getDataFolder() + File.separator + "/Players", UUID + ".yml"); FileConfiguration temp = YamlConfiguration.loadConfiguration(tempfile); return temp; } public void savePlayerFile(String UUID){ Main.plugin.saveDefaultConfig(); File tempfile = new File(Main.plugin.getDataFolder() + File.separator + "/Players", UUID + ".yml"); FileConfiguration temp = YamlConfiguration.loadConfiguration(tempfile); try{ temp.save(tempfile); }catch(IOException e){ e.printStackTrace(); } }
@Grossen Its because your savePlayerFile() method does legitimately nothing, you get the file from disk, then just instantly save.
@Grossen Well, you should create a variable on the class for the File and FileConfiguration. on Load, just load that variable, and on Save, save it, but don`t load it on save because it`s the same as nothing