Change YAML ID (Effect) — skript-yaml

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

Syntax

(change|rename|update) y[a]ml id [from] %string% to %string%

Description

Changes the ID of a loaded YAML file or reassigns its file path. - The first syntax changes the ID of a YAML file. Any changes to the ID are made at your own risk as this can cause issues with any other scripts that use the YAML file. - The second syntax reassigns the file path of a YAML file. This is useful when a file has been deleted but kept in memory. - The YAML file must be loaded before changing its ID or file path. - The new ID must not already be in use by another loaded YAML file.

Examples

# Change the ID of a YAML file
change yaml id from "config" to "newconfig"
 
# Change the ID of a YAML file with variables
set {_oldId} to "oldconfig"
set {_newId} to "newconfig"
change yaml id from "%{_oldId}%" to "%{_newId}%"
 
# Reassign the file path of a deleted YAML
change yaml "config" file path to "plugins/MyPlugin/newconfig.yml"
 
# Change multiple YAML IDs
change yaml id from "config1" to "newconfig1"
change yaml id from "config2" to "newconfig2"

View source