Error parsing YAML

Discussion in 'Plugin Development' started by JellyRekt, May 16, 2019.

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

    JellyRekt

    My plugin is throwing an InvalidConfigurationException on its file messages.yml. I've combed through it a thousand times and can't find any spacing or quotation problems so I obviously must be missing something.

    Here is the error I'm getting, minus the stack trace:
    Code:
    ERROR:
    
    while parsing a block mapping
    in "<unicode string>", line 13, column 3:
    balance: "&6You have %AMOUNT% go ...
    ^
    expected <block end>, but found '<block mapping start>'
    in "<unicode string>", line 16, column 5:
    usage: "&7Usage: /deposit <amoun ...
    ^
    
    And here is my full messages.yml:
    Code:
    1 ################################################################################
    2 # Displays when attempting to execute a player-only command through the console.
    3 ################################################################################
    4
    5 must-be-player: "&7You must be a player to execute that command."
    
    ###########################################
    # These messages are activated by commands.
    ###########################################
    
    cmd:
    
      balance: "&6You have %AMOUNT% gold in your account."
    
      deposit: "&6%AMOUNT% gold has been deposited into your account."
        usage: "&7Usage: /deposit <amount | all>"
     
      withdraw: "&6%AMOUNT% gold has been withdrawn from your account."
        usage: "&7Usage: /withdraw <amount | all>"
    
      buy:
        buyer: "&6Bought %AMOUNT% %MATERIAL% for %TOTAL% gold."
        seller: "&6Someone just bought %AMOUNT% %MATERIAL% from you for %TOTAL% gold!"
        usage: "&7Usage: /buy <item> <1> <price>"
     
      sell: "&6Placed %AMOUNT% %MATERIAL% on market for %TOTAL% gold."
        usage: "&7Usage: /sell <item> <amount> <price>"
     
      economy:
        - "&7/economy  - Display this message."
        - "&7/balance  - Check your account balance."
        - "&7/deposit  - Deposit gold into your account."
        - "&7/withdraw - Withdraw gold from your account."
        - "&7/buy      - Buy an item from the market."
        - "&7/sell     - Place an item on the market."
    
     
    Last edited: May 16, 2019
  2. Offline

    KarimAKL

    Code:
    cmd:
    
      balance: "&6You have %AMOUNT% gold in your account."
    
      // Error here (Reason, you can't have a value AND an indented key/value pair)
      deposit: "&6%AMOUNT% gold has been deposited into your account."
        usage: "&7Usage: /deposit <amount | all>"
    
      // Error here (Reason, you can't have a value AND an indented key/value pair)
      withdraw: "&6%AMOUNT% gold has been withdrawn from your account."
        usage: "&7Usage: /withdraw <amount | all>"
    
      buy:
        buyer: "&6Bought %AMOUNT% %MATERIAL% for %TOTAL% gold."
        seller: "&6Someone just bought %AMOUNT% %MATERIAL% from you for %TOTAL% gold!"
        usage: "&7Usage: /buy <item> <1> <price>"
    
      // Error here (Reason, you can't have a value AND an indented key/value pair)
      sell: "&6Placed %AMOUNT% %MATERIAL% on market for %TOTAL% gold."
        usage: "&7Usage: /sell <item> <amount> <price>"
    
      economy:
        - "&7/economy  - Display this message."
        - "&7/balance  - Check your account balance."
        - "&7/deposit  - Deposit gold into your account."
        - "&7/withdraw - Withdraw gold from your account."
        - "&7/buy      - Buy an item from the market."
        - "&7/sell     - Place an item on the market."
    I marked the errors.
     
Thread Status:
Not open for further replies.

Share This Page