Get ArrayList of config.yml

Discussion in 'Plugin Development' started by mig4ng, Mar 16, 2013.

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

    mig4ng

    Hi to all,
    I'm having troubles trying to load an array from my config file.
    The array on config.yml is like this:
    Code:
    customlore:
    - Line 1
    - Line 2
    - Line 3
    What is the code to load a array from config?
     
  2. Offline

    MCForger

    Looks like this:
    Code:
    List<String> temp = getConfig().getList("the.path.list");
    So using how you have the YAML above it would look like:
    Code:
    List<String> temp = getConfig().getList("customlore");
     
  3. Offline

    gomeow

    Code:
    ArrayList<String> list = (ArrayList<String>) config.getStringList(String path);
     
  4. Offline

    mig4ng

    Thank you all ;)
    Edit: how can i change the title to SOLVED?
     
Thread Status:
Not open for further replies.

Share This Page