Game MastersMythForge

Format reference

Mythcode

Mythcode is MythForge’s portable stat-block format: plain YAML that any text editor (or any Game Master in a group chat) can read and write. Every block carries a schema: line that says what it is (mythforge/creature/v1, mythforge/item/v1, or mythforge/spell/v1); the app routes the import from that field alone, wherever it sits in the block. Blocks shared before mid-2026 may carry the older npcroller/ prefix instead; those still import, and re-saving or re-sharing writes the modern id.

Unknown fields are preserved, not rejected. Add your own keys (a campaign note, a source page number) and they survive import, edit, and re-share untouched. The one exception: inside the small fixed-shape objects (a save block, a damage[] entry, a spell slots[] entry) unknown keys are dropped on import.

To import: open the Compendium tab on any shelf and tap the Import (tray) icon in the header, then paste and tap Import. The app confirms what it imported and lands you on the right shelf; if a block fails, each offending field is called out by name. To go the other way, every creature, item, and spell in the app has a Share Mythcode action that emits this same format. Shared blocks spell out every default the original author left implicit, so they read a little longer than the templates below.

Templates below are minimal: required fields plus enough to be worth playing. Field tables list everything the format accepts. Every template and example on this page is imported verbatim by MythForge’s test suite before it ships.

Beast (creature)

Creatures use schema: mythforge/creature/v1. Only schema, name, ac, hp.average, and the six ability scores are required; everything else has a sensible default. Tags drive shelving and appearance: a creature-type tag (aberration, beast, celestial, construct, dragon, elemental, fey, fiend, giant, humanoid, monstrosity, ooze, plant, undead) picks the icon, and a size tag (tiny, small, medium, large, huge, gargantuan) shows a size badge. A few alias tags pick icons too: human, goblinoid, devil, demon, titan, shapechanger, and any tag starting with swarm.

Anywhere a table below says dice, the notation is validated: NdM with an optional modifier (6d8+12), keep clauses (4d6kh3, 2d20kl1), and an adv or dis suffix. Die counts run 1–100 and sides 2–1000. A damage string is dice first, then an optional damage type: 2d6+2 slashing, flat 1 piercing, or bare 2d6 with no type at all.

Template: paste this into Import

schema: mythforge/creature/v1
name: Cave Lurker
ac: 13
hp:
  average: 22
  formula: 4d8+4
speed:
  walk: 30
  climb: 20
abilities:
  str: 14
  dex: 12
  con: 13
  int: 3
  wis: 10
  cha: 5
attacks:
  - name: Bite
    to_hit: 4
    damage: 1d8+2 piercing
    type: melee
tags:
  - monstrosity
  - medium

Top-level fields

FieldTypeRequiredNotes
schemaliteralrequiredMust be exactly `mythforge/creature/v1`.
namestringrequiredNon-empty.
systemstringdefault `dnd5e`Game system id.
roleenumdefault `independent`One of `leader`, `minion`, `independent`.
influenceinteger 0–5optionalOnly allowed when role is `leader`.
acinteger ≥ 1requiredArmor class.
hpobjectrequiredSee the hp table.
speedmap of string → integer ≥ 0optionale.g. `walk: 30`, `fly: 60`, `climb: 20`.
abilitiesobjectrequiredSee the abilities table.
attacksarraydefault `[]`See attacks[] entries.
traitsarraydefault `[]`See traits[] entries.
resourcesarraydefault `[]`Tracked charges. See resources[] entries.
spellcastingobjectoptionalSee the spellcasting table.
inventoryarraydefault `[]`See inventory[] entries.
actionsarraydefault `[]`Non-attack actions. See actions[] entries.
legendaryActionsarraydefault `[]`See legendaryActions[] entries.
reactionsarraydefault `[]`See reactions[] entries.
alignmentstringoptionalFree text, e.g. `chaotic evil`.
xpinteger ≥ 0optionalXP awarded.
languagesstringoptionalFree text, e.g. `Common, Draconic`.
sensesarray of stringsdefault `[]`Verbatim, e.g. `darkvision 120 ft.`.
passivePerceptionintegeroptional
savesobjectoptionalProficient save modifiers only: any of `str dex con int wis cha`, each an integer.
skillsmap of string → integeroptionale.g. `perception: 6`.
damageResistancesarray of stringsdefault `[]`
damageImmunitiesarray of stringsdefault `[]`
damageVulnerabilitiesarray of stringsdefault `[]`
conditionImmunitiesarray of stringsdefault `[]`
tagsarray of stringsdefault `[]``npc` shelves the creature under NPCs; type + size tags drive icon and badge.
imagestringoptionalLocal path inside the app; stripped when publishing.
imageFocusobjectoptional`x` and `y`, each a number 0–1: the image’s cover-crop focus. Center when absent. Publishing strips `image` but keeps `imageFocus`.
sourceobjectoptionalSee the source table.

hp

FieldTypeRequiredNotes
averageinteger ≥ 1requiredStarting/max hit points.
formuladice stringoptionalValidated dice notation, e.g. `6d8+12`.

abilities

FieldTypeRequiredNotes
`str`, `dex`, `con`, `int`, `wis`, `cha`integer 1–30all six requiredRaw ability scores; modifiers are derived.

attacks[] entries

FieldTypeRequiredNotes
namestringrequired
to_hitintegerrequiredAttack bonus (may be negative).
damagestringrequiredDice, then an optional damage type: `2d6+2 slashing`. Flat damage like `1 piercing` is legal; so is bare `2d6` with no type.
typeenumrequired`melee` or `ranged`.

traits[] entries

FieldTypeRequiredNotes
namestringrequired
textstringrequired

actions[] entries

FieldTypeRequiredNotes
namestringrequired
textstringrequiredThe action’s prose.
toHitintegeroptionalFor the rare action that rolls to hit but has no attack damage.
saveobjectoptionalSee the save table.
damagearraydefault `[]`See the damage[] table.
resourceNamestringoptionalNames an entry in `resources`; two breath weapons can share one pool.

legendaryActions[] entries

FieldTypeRequiredNotes
namestringrequired
textstringrequired
costinteger ≥ 1default `1`Legendary action cost.
toHitintegeroptional
saveobjectoptionalSee the save table.
damagearraydefault `[]`See the damage[] table.

reactions[] entries

FieldTypeRequiredNotes
namestringrequired
textstringrequired
saveobjectoptionalSee the save table.

save objects (actions, legendary actions, reactions)

FieldTypeRequiredNotes
abilityenumrequired`str`, `dex`, `con`, `int`, `wis`, or `cha`.
dcinteger ≥ 1required
onSuccessenumrequired`none` or `half`.

damage[] entries (actions and legendary actions)

FieldTypeRequiredNotes
dicestringrequiredA validated damage string: `8d6`, or flat `10`.
typestringrequirede.g. `fire`.

resources[] entries

FieldTypeRequiredNotes
namestringrequiredReferenced by `resourceName` fields.
maxinteger ≥ 1required
rechargeenumdefault `none``none`, `turn`, `short_rest`, `long_rest`, `day`, `recharge_5_6`, `recharge_6`, `recharge_4_6`.

spellcasting

FieldTypeRequiredNotes
abilityenumoptional`int`, `wis`, or `cha`.
slotsarraydefault `[]`Entries of `level` (integer 1–9) and `max` (integer ≥ 1).
knownSpellsarraydefault `[]`See knownSpells[] entries.
proficiencyBonusinteger 0–10optional
saveDcintegeroptionalOverrides the derived DC.
attackBonusintegeroptionalOverrides the derived bonus.

spellcasting.knownSpells[] entries

FieldTypeRequiredNotes
spellIdstringrequiredReference id, e.g. `srd:bless`.
namestringrequired
levelinteger 0–9required0 = cantrip.
castModeenumdefault `slot``slot`, `at_will`, or `resource`.
resourceNamestringoptionalRequired in spirit when castMode is `resource`.

inventory[] entries

FieldTypeRequiredNotes
itemIdstringrequiredReference id, e.g. `srd:potion-of-healing`.
namestringrequired
quantityinteger ≥ 1default `1`
resourceNamestringoptionalTies consumption to a tracked resource.

source

FieldTypeRequiredNotes
licensestringrequirede.g. `CC-BY-4.0`, `Homebrew`.
attributionstringoptional

Worked example

schema: mythforge/creature/v1
name: Ashwing Drake
ac: 17
hp:
  average: 75
  formula: 10d10+20
speed:
  walk: 30
  fly: 60
abilities:
  str: 18
  dex: 12
  con: 15
  int: 8
  wis: 11
  cha: 14
saves:
  dex: 4
  con: 5
  wis: 3
skills:
  perception: 6
  stealth: 4
senses:
  - blindsight 30 ft.
  - darkvision 120 ft.
passivePerception: 16
languages: Draconic
alignment: chaotic evil
xp: 1800
damageImmunities:
  - fire
attacks:
  - name: Bite
    to_hit: 7
    damage: 2d10+4 piercing
    type: melee
  - name: Claw
    to_hit: 7
    damage: 2d6+4 slashing
    type: melee
resources:
  - name: Fire Breath
    max: 1
    recharge: recharge_5_6
actions:
  - name: Fire Breath
    text: >-
      The drake exhales fire in a 30-foot cone. Each creature in that area
      must make a DC 14 Dexterity saving throw, taking 8d6 fire damage on a
      failed save, or half as much damage on a successful one.
    save:
      ability: dex
      dc: 14
      onSuccess: half
    damage:
      - dice: 8d6
        type: fire
    resourceName: Fire Breath
legendaryActions:
  - name: Tail Swipe
    text: The drake makes one tail attack.
    cost: 1
    toHit: 7
    damage:
      - dice: 1d8+4
        type: bludgeoning
reactions:
  - name: Wing Buffet
    text: >-
      When a creature the drake can see hits it with a melee attack, the
      drake beats its wings. The attacker must succeed on a DC 14 Strength
      saving throw or be knocked prone.
    save:
      ability: str
      dc: 14
      onSuccess: none
tags:
  - dragon
  - large
source:
  license: Homebrew

NPC

An NPC is not a separate schema: it is a creature (schema: mythforge/creature/v1) whose tags include npc. That one tag is what shelves it under NPCs instead of Beasts; every creature field above applies unchanged.

By convention, generated NPCs also carry a race tag and an occupation tag, which power the NPC shelf’s browsing. Races: human, elf, dwarf, halfling, gnome, half-orc, tiefling, dragonborn. Occupations: shopkeeper, innkeeper, blacksmith, farmer, guard, priest, scholar, thief, hunter, bard, healer, sailor. Both lists are conventions, not validation; any tag imports fine.

Template: paste this into Import

schema: mythforge/creature/v1
name: Marta Thistledown
ac: 10
hp:
  average: 9
  formula: 2d8
abilities:
  str: 11
  dex: 10
  con: 12
  int: 11
  wis: 14
  cha: 13
attacks:
  - name: Iron skillet
    to_hit: 2
    damage: 1d6 bludgeoning
    type: melee
traits:
  - name: Heard It All
    text: Advantage on Insight checks against obvious lies.
tags:
  - npc
  - halfling
  - innkeeper

NPC tag conventions

FieldTypeRequiredNotes
`npc`tagrequired for the NPCs shelfWithout it the creature shelves under Beasts.
race tagtagconventionOne of: human, elf, dwarf, halfling, gnome, half-orc, tiefling, dragonborn.
occupation tagtagconventionOne of: shopkeeper, innkeeper, blacksmith, farmer, guard, priest, scholar, thief, hunter, bard, healer, sailor.

Worked example

schema: mythforge/creature/v1
name: Brother Aldous
role: independent
ac: 12
hp:
  average: 27
  formula: 5d8+5
speed:
  walk: 30
abilities:
  str: 10
  dex: 10
  con: 12
  int: 11
  wis: 16
  cha: 13
attacks:
  - name: Mace
    to_hit: 2
    damage: 1d6 bludgeoning
    type: melee
traits:
  - name: Devout
    text: Advantage on saving throws against being frightened.
skills:
  medicine: 5
  religion: 2
languages: Common, Dwarvish
spellcasting:
  ability: wis
  proficiencyBonus: 2
  saveDc: 13
  attackBonus: 5
  slots:
    - level: 1
      max: 4
    - level: 2
      max: 2
  knownSpells:
    - spellId: srd:sacred-flame
      name: Sacred Flame
      level: 0
      castMode: at_will
    - spellId: srd:bless
      name: Bless
      level: 1
      castMode: slot
inventory:
  - itemId: srd:potion-of-healing
    name: Potion of Healing
    quantity: 2
tags:
  - npc
  - human
  - priest

Spell

Spells use schema: mythforge/spell/v1. Level 0 is a cantrip. The components block is required (all three flags default to false). castingTime, range, and duration are free-text strings, exactly as they read on a spell card.

Template: paste this into Import

schema: mythforge/spell/v1
name: Ember Lash
level: 1
school: evocation
castingTime: 1 action
range: 60 feet
components:
  verbal: true
  somatic: true
duration: Instantaneous
classes:
  - sorcerer
  - wizard
description: >-
  A whip of embers lashes one creature you can see within range. The target
  must succeed on a Dexterity saving throw or take 2d8 fire damage.

Top-level fields

FieldTypeRequiredNotes
schemaliteralrequiredMust be exactly `mythforge/spell/v1`.
namestringrequired
levelinteger 0–9required0 = cantrip.
schoolenumrequired`abjuration`, `conjuration`, `divination`, `enchantment`, `evocation`, `illusion`, `necromancy`, `transmutation`.
castingTimestringrequiredFree text, e.g. `1 action`.
rangestringrequiredFree text, e.g. `60 feet`, `Self`.
componentsobjectrequiredSee the components table.
durationstringrequiredFree text, e.g. `Concentration, up to 1 minute`.
concentrationbooleandefault `false`
ritualbooleandefault `false`
classesarray of enumsdefault `[]``bard`, `cleric`, `druid`, `paladin`, `ranger`, `sorcerer`, `warlock`, `wizard`.
descriptionstringdefault `''`
higherLevelsstringoptionalThe “At Higher Levels” paragraph.
tagsarray of stringsdefault `[]`
sourceobjectoptional`license` (required string), `attribution` (optional).

components

FieldTypeRequiredNotes
verbalbooleandefault `false`
somaticbooleandefault `false`
materialbooleandefault `false`
materialDescstringoptionale.g. `a handful of thorns`.

Worked example

schema: mythforge/spell/v1
name: Veil of Brambles
level: 2
school: conjuration
castingTime: 1 action
range: 90 feet
components:
  verbal: true
  somatic: true
  material: true
  materialDesc: a handful of thorns
duration: Concentration, up to 1 minute
concentration: true
ritual: false
classes:
  - druid
  - ranger
description: >-
  Grasping brambles erupt across a 20-foot square of ground you can see
  within range. The area becomes difficult terrain, and a creature that
  enters the area or starts its turn there must succeed on a Dexterity
  saving throw or take 2d6 piercing damage.
higherLevels: >-
  When you cast this spell using a spell slot of 3rd level or higher, the
  damage increases by 1d6 for each slot level above 2nd.
tags:
  - area
  - control

Item

Items use schema: mythforge/item/v1. Only schema, name, and category are required. A weapon’s damage is a validated damage string, dice first with an optional damage type after, exactly as in creature attacks. properties and the armor-ish armorClass are free-form strings, and stealthDisadvantage a simple boolean, so the rest of the format never fights a homebrew item.

Template: paste this into Import

schema: mythforge/item/v1
name: Lantern of Steady Light
category: wondrous
rarity: common
weight: 2
cost: 50 gp
description: >-
  This hooded lantern burns without oil, shedding bright light in a 30-foot
  radius. Speaking its command word extinguishes or relights it.

Top-level fields

FieldTypeRequiredNotes
schemaliteralrequiredMust be exactly `mythforge/item/v1`.
namestringrequired
categoryenumrequired`weapon`, `armor`, `ammunition`, `gear`, `tool`, `potion`, `ring`, `rod`, `scroll`, `staff`, `wand`, `wondrous`, `mount`.
weightnumber ≥ 0default `0`Pounds.
coststringoptionalFree text, e.g. `50 gp`.
rarityenumdefault `none``none`, `common`, `uncommon`, `rare`, `very-rare`, `legendary`, `artifact`, `varies`.
attunementbooleandefault `false`
attunementNotestringoptionale.g. `by a spellcaster`.
damagestringoptionalWeapons: a validated damage string, e.g. `1d4 piercing`. Dice first; the damage type is optional. See the dice note in the Beast section.
propertiesarray of stringsoptionale.g. `finesse`, `light`, `thrown (range 20/60)`.
armorClassstringoptionalArmor: free text, e.g. `14 + Dex modifier (max 2)`.
stealthDisadvantagebooleanoptionalArmor.
descriptionstringdefault `''`
tagsarray of stringsdefault `[]`
sourceobjectoptional`license` (required string), `attribution` (optional).

Worked example

schema: mythforge/item/v1
name: Duskfang Dagger
category: weapon
rarity: rare
attunement: true
weight: 1
cost: 2000 gp
damage: 1d4 piercing
properties:
  - finesse
  - light
  - thrown (range 20/60)
description: >-
  You gain a +1 bonus to attack and damage rolls made with this magic
  weapon. While you hold it in dim light or darkness, you can take the
  Hide action as a bonus action.
tags:
  - magic