Skip to content

YAML format

Misat11 edited this page Apr 10, 2020 · 7 revisions

YAML Format

This library use .yml files for guis!

How to load .yml? (For Developers)

Just load it as any other .yml configuration file!

import org.screamingsandals.simpleguiformat.SimpleGuiFormat;
import org.screamingsandals.simpleguiformat.inventory.Options;

...
Options options = new Options();

// some configuration

SimpleGuiFormat format = new SimpleGuiFormat(options);

try {
  format.loadFromDataFolder(plugin.getDataFolder(), "gui.yml");
} catch (Exception e) {
  e.printStackTrace();
}
...

Gui.yml example (For Server Owners)

data:
- stack:
    ==: org.bukkit.inventory.ItemStack
    v: 1519 # version of ItemStack (1519 = 1.13, 1952 = 1.14, on legacy versions don't use this variable)
    type: DIAMOND_CHESTPLATE
    amount: 1
    meta:
      ==: ItemMeta
      meta-type: UNSPECIFIC
      display-name: "Armor"
  items:
  - myCustomVariable: myCustomValue
    myCustomVariable2: myCustomValue2
    stack: # another item stack
    ...
  - stack: # another item stack
    ...
    items: # childs
    - stack: # another child item stack
      ...
      items: # childs 
      ...
Clone this wiki locally