About YAML (YML files)

You break it. You fix it.

YAML has very specific syntax spacing and does NOT tolerate any misplaced/missing spaces/symbols! Validate it!

When editing your YML files, please make sure you adhere to YAML's very specific syntaxing and formatting outside of any double-quoted-text lines.

YAML Formatting:

  • There will be a SPACE after any : character and the following value

  • Every 'Indent' level you see in the file is TWO SPACES for every level. (NO Tab)

  • Any line that begins with a # is a comment and will be ignored by the plugin

  • if you encounter any errors after altering your file, or are new to editing these files. USE AN ONLINE YAML PARSER to validate your file!. It will immediately identify any formatting errors that you will need to fix before proceeding

Common errors:

  • Bad spacing: (does not conform to even-numbered-space-character-indenting)

  • Missing space: after an expected value a space is missing.

    • ex (displayname:"<Missing Space Between The Colon And Double Quotes")

  • Missing 'block end/start': you forgot to surround the value with double-quotes somewhere

  • Absolutely NO TAB characters

Quick Explanation for each file:

Shops.yml:

spacing for shops.yml:

Armor: # No spaces anywhere in the shop section name, must have a : at the end. Name must match what is defined in the sections.yml
  '1': #TWO SPACES before the <index/item#>, must have a : at the end.
    material: GRASS_BLOCK #FOUR SPACES before the option, immediately followed by a : and a SINGLE SPACE, then the value you are defining
    buy: 20
    sell: -1
  '2': #Start of another item because the spacing is back to TWO
    material: IRON_INGOT
    buy: 10
    sell: 2
  'item3_milk_bucket': #the index does not have to be a number. numbers reccomended for 1.12 and below! custom index names are good for command-tab-complete in 1.13+
    material: milk_bucket
    buy: 20
    sell: 2
#Etc, and so on...

Sections.yml:

spacing for sections.yml:

ShopSections: #THIS MUST BE HERE. Do not touch this line
  Blocks: #TWO Spaces before this line
    enable: true #FOUR spaces before all values
    material: "GRASS_BLOCK"
    displayname: "&2&lBlocks"
    place: 19

Config.yml:

Spacing for config.yml:

'Full' Technical Explanation: (it's complicated. and simple)

#Shops file example:
#The first level in a YAML file will have ZERO spaces before it
####The shop section CANNOT HAVE SPACES in it, but can use _ underscores.
####The shop section MUST MATCH EXACTLY with what you have defined in the sections.yml for it.
Armor: #nothing follows the : after this field. It is a header for subsequent settings/items
  #The next level has TWO SPACES before it. These lines are sub-parts of the defined value above (Armor)
  ####(shops.yml specifc) Note: ESGUI does not require the following value to be numerical. you can use words and most characters. 
  ####This is the <index/item> that will be used with the /shopedit command. 
  ####It is reccomended to use numbers in 1.12 and lower, 
  ####1.13+ has command-tab-complete that can assist in filling out the command, and naming your items here can be helpfull in this case.

  '1': #again, nothing follows the : becasue it is the defieing valuse for the parts that follow...
  #
    #options are another level below the index/item, and have an additional two spaces fro mthe above line. 
    #This line has FOUR SPACES before it.
    material: GRASS_BLOCK 
      #There must be a space immediately after the : , Then a SINGLE SPACE, followed by the defined value.
      #Double quotes around the value are only required for values with special characters and spaces
    #still at FOUR SPACES as these options are more values for item '1'      
    buy: 20
    #### setting the value to a NEGATIVE number in either buy or sell will disable that option 'item cannot be bought/sold'
    sell: -1
    lore: #List lines start like a new sub-level, but use a - to define the start of each line in the list
    #in this case we are expecting lines of text, so we MUST enclose them with double-quotes ""
    #if you want to use double-quotes IN your line of text, you MUST 'Escape' it by printing it TWICE. (must still start and end with double-quotes)
    ####Minecraft chat color codes are supported
    - "example lore"
    - "&c""Second"" line of lore"
    enchantments:
    #another list-foramt is an array. mainly used for enchantments in ESGUI. 
    #it uses the Enchantment_name immediately followed by a : and again immediately followed by the enchantment level
    - EFFICIENCY:5 
    - FORTUNE:3

Last updated