Data
The game.getData() method provides access to the raw data defined in the engine editor. Use it when you need to reference editor-defined data for custom logic.
Note: By default, returns a deep copy of the data. You can safely modify the returned data without affecting the source.
API Reference
getData(path, original?)
Returns data from the registry. Most paths return a Map indexed by ID. Plugin single-file configs return a plain object.
| Parameter | Type | Description |
|---|---|---|
path | string | Data path to fetch |
original | boolean | If true, returns the original data without copying (faster, but do not mutate!) |
// Default: returns a deep copy (safe to modify)
const stats = game.getData("character_stats");
const healthStat = stats.get("health");
// With original=true: returns original data (faster, read-only)
const templates = game.getData("character_templates", true);
// Plugin single-file configs return plain objects
const battleConfig = game.getData("plugins_data/auto_battler/battle_config");
const rows = battleConfig?.rows_size || 3;
Performance tip: Pass true as the second parameter when you only need to read data and won't modify it. This skips the deep copy and improves performance.
Available Data Paths
Character Data
| Path | Description |
|---|---|
character_stats | Character stat definitions |
character_stats_visible | Stats marked as visible |
character_traits | Character trait definitions |
character_attributes | Character attribute definitions |
character_skin_layers | Skin layer definitions |
character_templates | Character template definitions |
character_statuses | Status effect definitions |
character_slot_templates | Character slot templates |
Skills & Abilities
| Path | Description |
|---|---|
skill_trees | Skill tree definitions |
skill_slots | Skill slot definitions |
ability_definitions | Ability definitions |
ability_templates | Ability templates |
Items
| Path | Description |
|---|---|
item_templates | Item template definitions |
item_inventories | Inventory template definitions |
item_traits | Item trait definitions |
item_slots | Equipment slot definitions |
item_recipes | Crafting recipe definitions |
Dungeons
| Path | Description |
|---|---|
dungeons/{id}/content_parsed | Parsed dungeon content (lines) |
dungeons/{id}/rooms | Room definitions |
dungeons/{id}/encounters | Encounter definitions |
Pools
| Path | Description |
|---|---|
pool_definitions | Pool definition data (source, filter fields) |
pool_entries | Pool entry data (weights, filters) |
Other
| Path | Description |
|---|---|
properties | Global property definitions |
assets | Asset definitions |
music | Music track definitions |
sounds | Sound effect definitions |
galleries | Gallery definitions |
custom_choices | Custom choice definitions |
locale | Locale string definitions |
character_views | View definitions used by skin layers and status spines |
Meta & Trait Key Definitions
These are the key definitions behind an entity's meta / traits field — the type, default, description and order of each key, as authored in the matching editor tab. The values live on the entity itself (status.meta.is_battle); these paths tell you what the keys are.
| Path | Description |
|---|---|
stat_meta | Per-stat meta key definitions (stat.meta.*) |
status_meta | Per-status meta key definitions (status.meta.*) |
asset_meta | Per-asset meta key definitions (asset.meta.*) |
dungeon_traits | Custom dungeon trait definitions (dungeon config .traits.*) |
inventory_traits | Custom inventory trait definitions (inventory.traits.*) |
// What does the status_meta key "power_scaling" expect?
const def = game.getData("status_meta").get("power_scaling");
console.log(def.type, def.description);
// Iterate every authored status_meta key, in editor order
for (const [key, def] of game.getData("status_meta")) {
console.log(key, def.type);
}
A game that has never opened the matching editor tab returns an empty Map rather than throwing.
Plugin Data
| Path | Description |
|---|---|
plugins_data/{plugin_id}/{schema_id} | Custom plugin schema data |
Examples
Get All Character Stats
const stats = game.getData("character_stats");
for (const [id, stat] of stats) {
console.log(id, stat.name);
}
Get a Specific Item Template
const items = game.getData("item_templates");
const sword = items.get("iron_sword");
console.log(sword.name, sword.description);
Access Dungeon Content
const lines = game.getData("dungeons/intro/content_parsed");
const specificLine = lines.get("greeting");
console.log(specificLine.val);
Check Stat Configuration
const stats = game.getData("character_stats");
const health = stats.get("health");
if (health.is_resource) {
console.log("Health is a resource stat");
}
Manifest
manifest.json is a structural file (game id, name, author, version, etc.) and is intentionally not accessible via getData() — it isn't moddable. Use the dedicated accessors:
getManifest()
Returns the current game's manifest object. Read-only.
const manifest = game.getManifest();
console.log(manifest.id); // "my_game"
console.log(manifest.name); // "My game"
console.log(manifest.author); // "dev99"
console.log(manifest.version); // "1.0.0"
console.log(manifest.description); // "..."
getId()
Shorthand for getManifest().id. Useful for building API paths or referencing the current game.
fetch(`/api/games/${game.getId()}/status`);
getMods()
Returns an array of active mod manifests (in load order). Empty if no mods are loaded.
const mods = game.getMods();
if (mods.length) {
console.log('Loaded mods:', mods.map(m => `${m.name} v${m.version}`).join(', '));
}