Solved Retrieve A List Of Config Sections?

Discussion in 'Plugin Development' started by Junrall, May 10, 2013.

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

    Junrall

    Is there a way to retrieve a list of sections from within a config file?
    For instance, how would I retrieve just the player names from this config?
    Code:
    Players:
        junrall:
            houses: 4
        bignose:
            houses: 1
        gatorman:
            houses: 20
    
    Thanks a bunch!
     
  2. Offline

    Minecrell

    Junrall
    Code:java
    1. Set<String> players = getConfig().getConfigurationSection("Players").getKeys(false);
    Where players contains every player in the configuration.
     
  3. Offline

    CubieX

    Make sure to use the correct case for the path "Players". ;)
     
    Junrall and Minecrell like this.
  4. Offline

    Minecrell

    CubieX Thank you! Changed it in my post above ;)
     
    Junrall likes this.
  5. Offline

    Junrall

  6. Offline

    Minecrell

    Junrall Mark it as solved please ;)
     
Thread Status:
Not open for further replies.

Share This Page