Solved Yaml configuration error help

Discussion in 'Plugin Development' started by mine-care, Dec 30, 2014.

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

    mine-care

    Hello! happy new year!
    I am working on a plugin and i load stuff from files.
    So i have this file:
    Code:
    KitName: "&7&lBuilder"
    KitGuiItemID: 2
    CoolDownSeocnds: 1800
    Cost: 70
    KitDescription: "&7Builder Kit%s&7Given as example."
    KitItems:
       - 2 10
       - 4 128
       - 5 256
       - 35 64
       - 275 1
       - 273 1
       - 274 1
       - 17 32
       - 45 64
    PotionEffects:[]
    Commands: []
    and i get this error:
    Code:
    [16:39:16 ERROR]: Cannot load plugins\SimpleKits\Kits\ExampleBuilder.yml
    org.bukkit.configuration.InvalidConfigurationException: while scanning a simple
    key
    in "<string>", line 16, column 1:
        PotionEffects:[]
        ^
    could not found expected ':'
    in "<string>", line 17, column 1:
        Commands: []
        ^
    What have i done wrong?
     
  2. Offline

    InkzzzMC

    Code:
    PotionEffects:[]
    Shouldn't there be a space between the colon and []?

    If not then I may need to see the portion of your code.
     
    1Rogue likes this.
  3. Offline

    xize

    @mine-care

    it looks for me that yaml don't like empty arrays atleast I think that is ment with those brackets [] what if you make them like a string like Commands: '[]' does that removes the error or does it still persists?

    when I look what happens to a ItemStack[] array in yaml they all seem to be defined as a serialized String list or something alike, so maybe the brackets are also illegal characters when not implied as String?
     
  4. Offline

    1Rogue

    [] denotes a list in yaml.

    {} denotes a dictionary or an object map.

    neither is required to be a string. @InkzzzMC hit the nail on the head about the space needing to be there
     
    xize likes this.
  5. Offline

    mine-care

    @InkzzzMC
    :eek: thanks i didnt notice! Solved!

    @xize @1Rogue Thanks the problem was solved it was a spacing issue.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 31, 2016
    InkzzzMC likes this.
  6. Offline

    InkzzzMC

    No worries ;)
     
Thread Status:
Not open for further replies.

Share This Page