YAML getStringList Issues

Discussion in 'Spigot Plugin Development' started by bobdabiulder, Jun 19, 2018.

Thread Status:
Not open for further replies.
  1. Good evening from Wisconsin! I am struggling to figure out why running
    Code (Java):
            List<String> ranks = plugin.getConfig().getStringList("grouplist.list");
            plugin.getLogger().info("Checking ranks. List size: " + ranks.size());
    with
    Code (YAML):
    grouplist:
      list
    :
        - default
        - comrade
        - partyofficial
        - premier
        - dictator
        - marx
        - helper
        - moderator
        - admin
        - co-owner
        - owner
    in the config outputs "Checking ranks. List size: 0".
     
    #1 bobdabiulder, Jun 19, 2018
    Last edited: Jun 19, 2018
  2. Pretty sure this is just a formatting issue. Try doing it this way:

    Code (YAML):

    grouplist
    :
      list
    :
      - default
      - comrade
      - partyofficial
      - premier
      - dictator
      - marx
      - helper
      - moderator
      - admin
      - co-owner
      - owner
     
     
    • Winner Winner x 1
  3. Thanks! The YAML checker websites didn't catch that one ;)
     
Thread Status:
Not open for further replies.