Loading custom values from a config file

Discussion in 'Plugin Development' started by Danoth, Nov 8, 2011.

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

    Danoth

    Hi all
    Im making a plugin which loads a list of groups from a config file, with prices that players can buy into.

    Since the groups will be added after the plugin is coded, im having trouble understanding how to load in the group names.

    So for example:
    Code:
    Groups:
        Group1:
            Price:10
        Group2:
            Price: 20
    
    How would I load each group and its price into my plugin?

    ANY help would be really appreciated :)

    Thanks
    Danoth
     
  2. Offline

    feildmaster

    getConfig().getConfigurationSection("Groups").getKeys();

    That will return a list of keys. Using that:
    getConfig().getConfigurationSection("Groups").getConfigurationSection(keyHere).get("Price");
     
  3. Offline

    Danoth

    Thanks a lot :)
     
Thread Status:
Not open for further replies.

Share This Page