Yaml config ' '

Discussion in 'Plugin Development' started by ThrustLP, Aug 11, 2014.

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

    ThrustLP

    Hello! How can I put a string in my yaml config in those apostrophes: ' ' using addDefault?

    Thanks!
     
  2. ThrustLP When you're writing to config from plugin, it'll automatically add them if required.
     
  3. Offline

    patey

    my config for mysql settings as an example
    Code:java
    1. private void initconfig(){
    2. FileConfiguration config = getConfig();
    3.  
    4. config.addDefault("MySql.Enabled", true);
    5. config.addDefault("MySql.Host", "localhost");
    6. config.addDefault("MySql.DataBase", "database");
    7. config.addDefault("MySql.Port", "3306");
    8. config.addDefault("MySql.User", "root");
    9. config.addDefault("MySql.Password", "password");
    10.  
    11. config.options().copyDefaults(true);
    12. saveConfig();
    13. }


    edit - I should specify, name this method whatever you like and call it in your onEnable
     
Thread Status:
Not open for further replies.

Share This Page