Load YAML (Effect) — skript-yaml

Addon: skript-yaml · Category: Effect · Since: 1.0.0

Syntax

[re]load [(non[(-| )]relative)] y[a]ml %strings%

Description

Loads a YAML file into memory. - The first input is the YAML file path (ie. "plugins/MyAwesomePlugin/config.yml"). - The second input allows you to choose your own ID for this file. - If the second input isn't used then the files name minus the extention is used as the ID for example `config.yml` becomes `config`. - When using non-relative, the file path should be relative to root directory of the pc (ie. "C:/MinecraftServer/plugins/MyAwesomePlugin/config.yml")

Examples

#Both examples produce the same id for use in other effects/expressions
load yaml "plugins/MyAwesomePlugin/config.yml"
load yaml "plugins/MyAwesomePlugin/config.yml" as "config"
 
#to get similar function as the other addons you would do this sort of thing with the id...
	load yaml "plugins/MyAwesomePlugin/config.yml" as file path
	set yaml value "version" from "plugins/MyAwesomePlugin/config.yml" to 1.0
	broadcast "%yaml value ""version"" from ""plugins/MyAwesomePlugin/config.yml""%"

View source