Skip to content

Add treasure property to monster statblocks (resolves #899) - #909

Merged
ebullient merged 1 commit into
ebullient:mainfrom
chaoz23:fix-899-monster-treasure
Jul 17, 2026
Merged

ebullient merged 1 commit into
ebullient:mainfrom
chaoz23:fix-899-monster-treasure

Conversation

@chaoz23

@chaoz23 chaoz23 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Resolves #899.

Problem

2024 creatures carry a treasure field, but it was never parsed or exposed on QuteMonster. Any template that references {resource.treasure} therefore fails at render time:

io.quarkus.qute.TemplateException: Rendering error: Property "treasure" not found on the
base object "dev.ebullient.convert.tools.dnd5e.qute.QuteMonster" in expression {resource.treasure}

Root cause

The treasure array (theme keys such as "arcana", "relics") simply wasn't read in Json2QuteMonster or surfaced on QuteMonster — the tool silently dropped it, so there was no property for a template to reference.

Fix

Parse treasure in Json2QuteMonster and expose it on QuteMonster as treasure, mirroring the existing gear handling:

  • Known treasure themes (arcana, armaments, implements, relics) link to the Random Magic Items tables ({@table Random Magic Items - Arcana|XDMG|Arcana}), and any other value is passed through title-cased — matching 5eTools' own getRenderedTreasure. Entries are sorted for stable output.
  • The default monster2md.txt template now renders a Treasure line (right after Gear).
  • docs/templates/dnd5e/QuteMonster/README.md was regenerated by process-sources from the new field's javadoc.

treasure is kept distinct from gear: gear is the items a creature carries, treasure is the thematic Random Magic Items tables suggested for its loot.

Verification

Reproduced the exact error above with a 2024 creature ("treasure": ["arcana", "relics"]) and a template referencing {resource.treasure}. After the change, the same conversion succeeds and renders:

- **Treasure** Arcana, Relics

(Themes resolve to their table links when the source is available, and degrade to plain title-cased text otherwise.) ./mvnw process-sources is clean.

Happy to add a CHANGELOG entry under whichever heading you'd like — I left it out rather than guess the target version.

@chaoz23
chaoz23 requested a review from ebullient as a code owner July 16, 2026 10:25
2024 (XDMG) creatures carry a `treasure` field (an array of theme keys
such as "arcana", "relics"), but it was never parsed or exposed, so any
template referencing {resource.treasure} failed with:
  Property "treasure" not found on ... QuteMonster

Parse the field in Json2QuteMonster and expose it on QuteMonster as
`treasure`, mirroring the existing `gear` handling. Known themes link to
the Random Magic Items tables in the 2024 DMG (XDMG) and unknown values
are title-cased, matching 5eTools' getRenderedTreasure (sorted, joined).
The default monster template now renders a **Treasure** line.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chaoz23
chaoz23 force-pushed the fix-899-monster-treasure branch from c224184 to c8544a6 Compare July 16, 2026 10:29
@ebullient
ebullient merged commit 286eb17 into ebullient:main Jul 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Treasure property gives error on convert

2 participants