Save usernames from essentials

Discussion in 'Spigot Plugin Development' started by DerMaart99, Jun 28, 2015.

Thread Status:
Not open for further replies.
  1. Hey :)

    I want to save all usernames, which are saved by the popular plugin "Essentials" in a mysql database.

    Essentials have saved the names of all players separate as PLAYERNAME.yml files and now I want to get only the names of the files and put them in the mysql.

    Iam happy about all your answers, bye :)
     
  2. You can get all player names/UUID's with:

    Code (Text):
            File[] files = new File("plugins/Essentials/userdata").listFiles();
            if (files.length > 0) {
                for (File uuidFile : files) {
                    FileConfiguration ymalFileUUIDPlayer = YamlConfiguration.loadConfiguration(uuidFile);
                 
                    UUID uuid = UUID.fromString(uuidFile.getName().replace(".yml", ""));
                    String playerName = ymalFileUUIDPlayer.getString("lastAccountName");
                 
                }
            }
     
    #3 F_o_F_1092, Jun 28, 2015
    Last edited: Jun 28, 2015
  3. Thank you so much! :)

    It works perfect and I saved all essentials data in my mysql.

    Best greetings :)


    //CLOSE
     
Thread Status:
Not open for further replies.