Add treasure property to monster statblocks (resolves #899) - #909
Merged
Merged
Conversation
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
force-pushed
the
fix-899-monster-treasure
branch
from
July 16, 2026 10:29
c224184 to
c8544a6
Compare
ebullient
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #899.
Problem
2024 creatures carry a
treasurefield, but it was never parsed or exposed onQuteMonster. Any template that references{resource.treasure}therefore fails at render time:Root cause
The
treasurearray (theme keys such as"arcana","relics") simply wasn't read inJson2QuteMonsteror surfaced onQuteMonster— the tool silently dropped it, so there was no property for a template to reference.Fix
Parse
treasureinJson2QuteMonsterand expose it onQuteMonsterastreasure, mirroring the existinggearhandling: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' owngetRenderedTreasure. Entries are sorted for stable output.monster2md.txttemplate now renders a Treasure line (right after Gear).docs/templates/dnd5e/QuteMonster/README.mdwas regenerated byprocess-sourcesfrom the new field's javadoc.treasureis kept distinct fromgear:gearis the items a creature carries,treasureis 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:(Themes resolve to their table links when the source is available, and degrade to plain title-cased text otherwise.)
./mvnw process-sourcesis clean.Happy to add a CHANGELOG entry under whichever heading you'd like — I left it out rather than guess the target version.