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.
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.
| 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 |
| Path | Description |
|---|
skill_trees | Skill tree definitions |
skill_slots | Skill slot definitions |
ability_definitions | Ability definitions |
ability_templates | Ability templates |
| Path | Description |
|---|
item_templates | Item template definitions |
item_inventories | Inventory template definitions |
item_traits | Item trait definitions |
item_attributes | Item attribute definitions |
item_properties | Item property definitions |
item_slots | Equipment slot definitions |
item_recipes | Crafting recipe definitions |
| Path | Description |
|---|
dungeons/{id}/content_parsed | Parsed dungeon content (lines) |
dungeons/{id}/rooms | Room definitions |
dungeons/{id}/encounters | Encounter definitions |
| Path | Description |
|---|
pool_definitions | Pool definition data (source, filter fields) |
pool_entries | Pool entry data (weights, filters) |
| 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 |
| Path | Description |
|---|
plugins_data/{plugin_id}/{schema_id} | Custom plugin schema data |
const stats = game.getData("character_stats");
for (const [id, stat] of stats) {
console.log(id, stat.name);
}
const items = game.getData("item_templates");
const sword = items.get("iron_sword");
console.log(sword.name, sword.description);
const lines = game.getData("dungeons/intro/content_parsed");
const specificLine = lines.get("greeting");
console.log(specificLine.val);
const stats = game.getData("character_stats");
const health = stats.get("health");
if (health.is_resource) {
console.log("Health is a resource stat");
}
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:
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); // "..."
Shorthand for getManifest().id. Useful for building API paths or referencing the current game.
fetch(`/api/games/${game.getId()}/status`);
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(', '));
}