Skip to content

CommandStorageSpell

JasperLorelai edited this page Aug 26, 2026 · 1 revision

Source Code

spell-class: ".targeted.CommandStorageSpell"

Important

Since 4.0 Beta 19.

Description:

Instant spell, capable of storing command storage data into MagicSpells variables. Numeric variables can store numeric storage data; string variables will attempt to parse the data of any type to string, but if it fails, it will store the raw NBT found (e.g. arrays will store the stringified ["a", "b"]).

Configuration:

These options support dynamic values through numeric or string expressions.

Option Type
tag String
container-id Namespaced key (Defaults to minecraft namespace)
variable Variable name

Example:

variables:
    temp_array: {type: playerstring}

storage:
    spell-class: ".ExternalCommandSpell"
    always-granted: true
    do-variable-replacement: true
    command-to-execute: ['data modify storage magicspells:temp array append value "item"']

storage_cmd:
    spell-class: ".instant.CommandStorageSpell"
    always-granted: true
    variable: temp_array
    container-id: magicspells:temp
    tag: array

Clone this wiki locally