Solved error daving data players in folder

Discussion in 'Plugin Development' started by KAM202, Jul 2, 2019.

Thread Status:
Not open for further replies.
  1. Offline

    KAM202

    Hi. I cant create uuid.yml in plugin/players

    my create player file:
    Code:
    public void create(Player p) {
            cfile = new File(df, "players" + File.separator + p.getUniqueId() + ".yml");
            if (!df.exists()) df.mkdir();
            if (!cfile.exists()) {
                try {
                    cfile.createNewFile();
                } catch(Exception e) {
                    Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "Error creating " + cfile.getName() + "!");
                }
            }
            config = YamlConfiguration.loadConfiguration(cfile);
            config.set("warnings", "0");
        }
    what's wrong?
     
  2. Online

    timtower Administrator Administrator Moderator

    @KAM202 Do you get an error? What tells you that it isn't working? What is df?
     
  3. Offline

    KarimAKL

    @KAM202 Do you get any errors in the console? I'm guessing 'df' is 'JavaPlugin#getDataFolder()', try printing 'cfile.getPath()' to the console, then check if the path is correct. (you can post the path here)
     
Thread Status:
Not open for further replies.

Share This Page