getting config keys

Discussion in 'Plugin Development' started by donsavage, May 25, 2014.

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

    donsavage

    I have a config file that looks like this:
    Code:
    effected mobs:
      skeleton:
        lower hp limit:
        upper hp limit:
      zombie:
        lower hp limit:
        upper hp limit:
      spider:
        lower hp limit:
        upper hp limit:

    and I want to get a list/array that would contain [skeleton, zombie, spider] by getting the child nodes of "effected mobs". I have tried the following code:

    Code:java
    1. mobsEffected = config.getConfigurationSection("effected mobs").getKeys(false);
    2. Bukkit.getLogger().info(String.valueOf(mobsEffected.size() ));

    but the size results in 0, which should obviously be 3... Any advice?
     
  2. Offline

    mrkirby153

    donsavage

    Config keys cannot have spaces in them. Use Underscores or camelCase instead. Also effected is spelled with an "a", not an "e"
     
Thread Status:
Not open for further replies.

Share This Page