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.

ParameterTypeDescription
pathstringData path to fetch
originalbooleanIf 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

PathDescription
character_statsCharacter stat definitions
character_stats_visibleStats marked as visible
character_traitsCharacter trait definitions
character_attributesCharacter attribute definitions
character_skin_layersSkin layer definitions
character_templatesCharacter template definitions
character_statusesStatus effect definitions
character_slot_templatesCharacter slot templates

Skills & Abilities

PathDescription
skill_treesSkill tree definitions
skill_slotsSkill slot definitions
ability_definitionsAbility definitions
ability_templatesAbility templates

Items

PathDescription
item_templatesItem template definitions
item_inventoriesInventory template definitions
item_traitsItem trait definitions
item_attributesItem attribute definitions
item_propertiesItem property definitions
item_slotsEquipment slot definitions
item_recipesCrafting recipe definitions

Dungeons

PathDescription
dungeons/{id}/content_parsedParsed dungeon content (lines)
dungeons/{id}/roomsRoom definitions
dungeons/{id}/encountersEncounter definitions

Pools

PathDescription
pool_definitionsPool definition data (source, filter fields)
pool_entriesPool entry data (weights, filters)

Other

PathDescription
propertiesGlobal property definitions
assetsAsset definitions
musicMusic track definitions
soundsSound effect definitions
galleriesGallery definitions
custom_choicesCustom choice definitions
localeLocale string definitions

Plugin Data

PathDescription
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(', '));
}