Skip to content

Variables

BubbleFish edited this page Feb 25, 2026 · 3 revisions

Variables are defined by Vintage and can be used in the following places:

  • File & directory names, e.g. data/%[namespace]/function/load.mcfunction.
  • Inside of MCFunction files, e.g. execute as @e run say %[id].
  • Inside of JSON files, e.g. "key": "%[value]_test".

The format is %[<query>], where <query> must either be a GJSON query or an iterator using <iterator>.<index?>.

The value of variable must be a string, with the exception of special case.

Special case

In JSON files, if a value is "%[<key>]" (with no additional leading or following text), then it can be expanded into any value.

If the key ends with a question mark ?, then it will remove the key in the case that is isn't defined.

πŸ“ Input (Definition file)
// definitions/my_definition.json
{                                                 
    "key1": "Hello World!",
    "key2": {
        "abc": true
    }
}
πŸ“ Input (Some other file)
{                                                 
    "example": "%[key2]",
    "may_be_removed": "%[because_it_is_optional?]"
}
πŸ“¦οΈ Output
{                                                 
    "example": {
        "abc": true
    }
}

πŸ“€ Getting Started

πŸ“šοΈ Features

🎁 Tutorials

🎲 Extras

Clone this wiki locally