Solved Getting config interval

Discussion in 'Plugin Development' started by Alvarez96, Feb 20, 2013.

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

    Alvarez96

    Currently in my config I ask the user how many commands they would like to create, and the that amount of information from the config as shown below:
    Code:
    NumberOfCommands: 2
      Command:
        1: 'TestCommand'
        2: 'AnotherTestCommandName'
    
    How would I go about getting as many lines of commands as there is without asking for the number?
     
  2. Offline

    chasechocolate

    Code:java
    1. Set<String> cmds = this.getConfig().getConfigurationSection("numberofcommands.command");

    Just check if the configuration section exists, it might throw a NullPointerExceptiom.
     
  3. Offline

    RealDope

    getConfig().getConfigurationSection("Command").getKeys(false);

    Will return a Set<String> with all the keys (1, 2, 3, 4 etc)

    Ninja'd :(
     
  4. Offline

    Alvarez96

Thread Status:
Not open for further replies.

Share This Page