ConfigurationSection

Discussion in 'Plugin Development' started by Koningpeter, Mar 13, 2016.

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

    Koningpeter

    Hi all, I need help with my config...
    This is what I have:
    Code:
    if (label.equalsIgnoreCase("ConfigCheck")){
                if(sender instanceof Player){
                    ConfigurationSection CS = getConfig().getConfigurationSection("A");
                    if (CS != null) {
                        for (String key : sec.getKeys(false)) {
                            System.out.println(key);
                            return false;
                        }
                    }
                    System.out.println("Empty!");
                }         
            }
    It says "Empty!" all the time...

    This is my Config:
    Code:
        A:
            Helloo:
     
  2. Offline

    Zombie_Striker

    @Koningpeter
    You should add more detail to your debug messages. Print out if CS is null first, then print out the amount of values "sec.getKeys(false)" returns. If CS is not null, then most likely there are no values.
     
  3. Offline

    Scorpionvssub

    you can also just use getconfig.get which probs returns it, not sure why configurationsection differs but sometimes that doesnt get it while get and getstring do
     
  4. @Koningpeter
    You haven't provided much code, but it looks like you're looping through the wrong ConfigurationSection's keys.
     
Thread Status:
Not open for further replies.

Share This Page