Spell and Magic Item JSON (5etools)
Structured spells and magic items follow the same idea as
creatureStats:
- Data files live under
src/content/docs/world/**with suffixes.spell.jsonand.item.json. - Astro collections
spellsanditemDataload them; each file’s collection id is the path relative toworldwithout.json(same rule as creatures). - Docs frontmatter may reference them with
spellStatsanditemDataStats(validated withSpellDataSchemaandItemDataSchemafrom@bastion-falls/5e-schema-zod).
Spells (*.spell.json)
Section titled “Spells (*.spell.json)”The same files can drive inline <Spell /> tooltips in prose via the
json or spell props; see
5etools: Inline spell, feat, and condition references.
YAML example:
spellStats: demoFireBolt: misc/examples/fire-bolt.spellimport SpellBlock from '../../../../components/SpellBlock.astro';
<SpellBlock spell={frontmatter.spellStats.demoFireBolt} />Magic items (*.item.json)
Section titled “Magic items (*.item.json)”The collection is named itemData so it does not collide with the
existing MDX item collection (src/content/docs/world/items).
Frontmatter uses itemDataStats:
itemDataStats: demoPotion: misc/examples/potion-of-healing.itemimport ItemBlock from '../../../../components/ItemBlock.astro';
<ItemBlock item={frontmatter.itemDataStats.demoPotion} />Live samples (collection entries)
Section titled “Live samples (collection entries)”Fire Bolt
You hurl a mote of fire at a creature or object within range. Make a ranged spell attack against the target. On a hit, the target takes 1d10 fire damage. A flammable object hit by this spell ignites if it isn't being worn or carried.
This spell's damage increases by 1d10 when you reach 5th level (2d10), 11th level (3d10), and 17th level (4d10).
Potion of Healing
A character who drinks the magical red fluid in this vial regains 2d4 + 2 hit points. Drinking or administering a potion takes an action.
entriesandentriesHigherLeveluse the same mixed 5etools shapes as the bestiary; the UI flattens them to plain text (including stripping{@...}tags to readable text where possible).- Item
valuein 5etools is typically in copper pieces; the block displays a simple gp / sp / cp conversion. - Do not register
*.spell.jsonor*.item.jsonas a separate Starlight doc glob withdocsSchema— only this project’s collections + frontmatter extension, matching thecreatureStatspattern.