What... why do you. I don't know... let level implement ConfigurationSerializable then creat a static method "deserialize" that accepts a single Map< String, Object> and returns the class? Just dont forget to call ConfigurationSerialization.registerClass(Level.class)?
Oh ok. Create a file per player that is named after his uuid. Then write a value inside using the Yaml configuration API from Spigot. When loading just get the file 'uuid'.yml and load the value(s) again.
Hi, try this... it seems to work Code (Java): public class Experience extends JavaPlugin implements Listener { public File players; public FileConfiguration pl; public void onEnable() { Bukkit.getPluginManager().registerEvents(this, this); players = new File("players.yml"); if (!players.exists()) { try { players.createNewFile(); } catch (Exception e) { System.out.println("[Experience] An error as occured while creating the players.yml file."); } } YamlConfiguration.loadConfiguration(players); } @EventHandler public void onJoin(PlayerJoinEvent e) { if (isNewPlayer(e.getPlayer())) { pl.set(e.getPlayer().getUniqueId().toString(), e.getPlayer().getExpToLevel()); } } @EventHandler public void expModify(PlayerExpChangeEvent e) { pl.set(e.getPlayer().getUniqueId().toString(), e.getPlayer().getExpToLevel()); } public boolean isNewPlayer(Player player) { try { pl.getString(player.getUniqueId().toString()); return false; } catch (Exception e) { return true; } } }