My config files are not saving on plugin disable

Discussion in 'Plugin Development' started by Zaary, Dec 14, 2020.

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

    Zaary

    Hello everyone, i have two config files but they are not saving when i turn off server.
    My code:
    Code:
    @Override
        public void onDisable(){
            this.saveResource("config.yml", true);
            this.saveResource("stats.yml", true);
        }
    Any idea why it doesnt save?
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Zaary It does not know what data it needs to save.
     
  3. Offline

    Zaary

    Oh but how do i make it then?
     
  4. Offline

    timtower Administrator Administrator Moderator

  5. Offline

    Zaary

    So config.save("config.yml") ?
     
  6. Offline

    timtower Administrator Administrator Moderator

    @Zaary That would save it next to the server jar though, need to have a path in the plugins folder.
     
  7. Offline

    Zaary

    config.save(this.getDataFolder() + "config.yml") ?
     
  8. Offline

    timtower Administrator Administrator Moderator

    @Zaary Something along those lines.
    Got my own config handlers because the Bukkit ones don't do what I want, so don't know everything.
     
Thread Status:
Not open for further replies.

Share This Page