Need help with custom config

Discussion in 'Plugin Development' started by Barinade, Dec 14, 2012.

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

    Barinade

    f.createNewFile();
    pc = YamlConfiguration.loadConfiguration(f);
    pc.createSection("godmode");
    pc.createSection("fly");
    pc.addDefault("godmode", false);
    pc.addDefault("fly", false);

    The file is created, no errors, but I don't see anything when I open it.
     
  2. Offline

    chaseoes Retired Staff

    Did you save it?
     
  3. Offline

    Barinade

    Did YOU save it!?

    :(

    I'll try.

    Edit:
    f.createNewFile();
    pc = YamlConfiguration.loadConfiguration(f);
    pc.createSection("godmode");
    pc.createSection("fly");
    pc.addDefault("godmode", false);
    pc.addDefault("fly", false);
    pc.save(f);

    No workie :(

    Edit2:
    Changed addDefault to set, works now.
     
  4. Offline

    fireblast709

    Barinade why are you create a secion (which is a mapping) and set it default to a value (which is not a mapping)
     
  5. Offline

    NoLiver92

    rather then addDefauly put set
     
  6. Offline

    Dreeass

    There's a page on the wiki that explains the Bukkit configuration file and how to make a custom one, here's the page with the part where they explain how to make a custom config file based on the Bukkit config.
     
  7. Offline

    Barinade

    Because I have no idea what I'm doing :p
     
  8. Offline

    Dreeass

    Then why are you making a plugin?
     
  9. Offline

    youngbawss22

    Isn't this the plugin development section? People are here to learn, in case you didn't know.
     
  10. Offline

    fireblast709

    He knows how to code :3. But everyone has that moment when you start working on configurations
     
  11. Offline

    Dreeass

    You also need to start with some basic Java knowledge, I thought he didn't understand Java.
     
  12. Offline

    NoLiver92

Thread Status:
Not open for further replies.

Share This Page