Skip to content

Variables

Session-only key-value storage scoped to your mod. Data is lost when the game closes.

No permission required.

Methods

get<T>(key)

Get a variable value.

typescript
const count = Variables.get<number>("sessionCount");

set(key, value)

Set a variable.

typescript
Variables.set("sessionCount", 42);

getAll()

Get all variables.

typescript
const vars = Variables.getAll();

remove(key)

Remove a variable.

typescript
Variables.remove("sessionCount");

clear()

Remove all variables for this mod.

typescript
Variables.clear();

For persistent storage, use Storage. For shared data between mods, use SharedStorage or SharedVariables.

HotBunny Interactive Entertainment Inc.