Solved Custom configs

Discussion in 'Plugin Development' started by Betagear, Nov 8, 2015.

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

    Betagear

    Hi. I tried following guides to create a custom config file, but it doesn't works. Either it creates another config file like the first one, or it doesn't works at all. I would like to create an alternate config called "servers" and stored in "servers.yml", in the default plugin config folder. Could someone give me the proper code to use to access it, create it and modify it ?
     
  2. Offline

    Zombie_Striker

    @Betagear
    It would be nice to see what you tried...
     
  3. Offline

    Betagear

    I tried just that :
    Code:
    servers = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "servers.yml"));
     
  4. Offline

    teej107

    That's a good start. So what is the problem exactly?
     
  5. Offline

    Betagear

    @teej107 I can't modify it, and it's the exact copy of the config.yml

    Oups... I was using the wrong command to save the file... now I use server.save(serversfile) and it worked ! Thanks !

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 8, 2015
Thread Status:
Not open for further replies.

Share This Page