Skip to content

✨ exposed missing spell fields#804

Merged
ebullient merged 2 commits into
ebullient:mainfrom
foxcub99:feat/spell-fields
Mar 9, 2026
Merged

✨ exposed missing spell fields#804
ebullient merged 2 commits into
ebullient:mainfrom
foxcub99:feat/spell-fields

Conversation

@foxcub99
Copy link
Copy Markdown
Contributor

@foxcub99 foxcub99 commented Nov 3, 2025

Resolves issue #780, adds spell fields from the json that are currently omitted

First time writing java so bear with me.

Exposes the json fields from spells to Qute. All are a string

  • ability checks
  • affected creature types
  • area tags (converted to words)
  • condition immunities
  • conditions inflicted
  • damage immunities
  • damage inflicted
  • damage resistances
  • damage vulnerabilities
  • misc tags (converted to words)
  • saving throws
  • scaling damage dice
  • spell attack melee or ranged
  • higher levels text

Testing process:

  • I haven't got testing up and running due to a few errors but it builds fine for me using and I get the expected result in obsidian afterwards.

Notes:

  • most are lists so could send through a list of strings as well as a string if desired. I went with what I assume convention was and made them all just a string
  • Could send through the raw values of area/misc tags but I figured just sticking with the converted versions was fine. Also, I'm not sure if the converted text is 100% accurate I got AI to do it
  • some of the larger fields have a higher change of having a quote in them so will usually break when inserting into the properties field from qute. I've left that in and got around this by using .replace('"', "'") in the qute templates because I'm not sure if there's a convention to do it in the java.
  • mostly got claude sonnet to do the work for me then tidied it up. Happy to take any feedback and make any style changes
spell2md-custom.txt
---
obsidianUIMode: preview
cssclasses:
- json5e-spell
{#if resource.tags }
tags:
{#for tag in resource.tags}
- {tag}
{/for}
{/if}
{#if resource.classes }
classes:
{#each resource.classList}
- {it}
{/each}{/if}
aliases:
- {resource.name}
CastingTime: "{resource.time}{#if resource.ritual} unless cast as a ritual{/if}"
Range: "{resource.range}"
Components: "{resource.components}"
Duration: "{resource.duration}"
{#if resource.higherLevels }
Upcast: True
HigherLevels: "{resource.higherLevels.replace('"', "'")}"
{/if}
{#if resource.ritual} 
Ritual: True
{/if}
{#if resource.areaTags }
Area: "{resource.areaTags}"
{/if}
{#if resource.damageInflict }
Damage: "{resource.damageInflict}"
{/if}
{#if resource.savingThrows }
SavingThrow: "{resource.savingThrows}"
{/if}
{#if resource.conditionInflict }
Conditions: "{resource.conditionInflict}"
{/if}
{#if resource.abilityChecks }
AbilityChecks: "{resource.abilityChecks}"
{/if}
{#if resource.spellAttacks }
AttackRoll: "{resource.spellAttacks}"
{/if}
{#if resource.affectsCreatureTypes }
AffectsCreatures: "{resource.affectsCreatureTypes}"
{/if}
{#if resource.conditionImmune }
ConditionImmunities: "{resource.conditionImmune}"
{/if}
{#if resource.damageImmune }
DamageImmunities: "{resource.damageImmune}"
{/if}
{#if resource.damageResist }
DamageResistances: "{resource.damageResist}"
{/if}
{#if resource.damageVulnerable }
DamageVulnerabilities: "{resource.damageVulnerable}"
{/if}
{#if resource.miscTags }
MiscTags: "{resource.miscTags}"
{/if}
{#if resource.scalingLevelDice }
ScalingDice: "{resource.scalingLevelDice}"
{/if}
{#if resource.duration.contains('Concentration') } 
Concentration: True
{/if}
Source: "{resource.source.replace('"', "'")}"
---
# {resource.name}
%%-- Embedded content starts on the next line. --%%
*{resource.level}, {resource.school}{#if resource.ritual} (ritual){/if}*  
{#if resource.hasImages }{resource.showPortraitImage}{/if}

- **Casting time:** {resource.time}{#if resource.ritual} unless cast as a ritual{/if}
- **Range:** {resource.range}
- **Components:** {resource.components}
- **Duration:** {resource.duration}

{resource.text}

{#if resource.hasSections }
## Summary

{/if}{#if resource.hasMoreImages }
{resource.showMoreImages}

{/if}{#if resource.classes }
**Classes**: {resource.classes}

{/if}
*Source: {resource.source}*

@ebullient
Copy link
Copy Markdown
Owner

Sorry for being slow.. I will get to this! Thank you!

@ebullient ebullient force-pushed the main branch 6 times, most recently from 9c98bab to 21e9c71 Compare December 15, 2025 18:18
@ebullient ebullient force-pushed the main branch 2 times, most recently from 383888f to e1794dd Compare December 31, 2025 13:34
@cdloh
Copy link
Copy Markdown

cdloh commented Feb 24, 2026

@ebullient any chance this can go in?

@ebullient ebullient force-pushed the feat/spell-fields branch from ece2daa to 3c51ba6 Compare March 9, 2026 13:03
@ebullient
Copy link
Copy Markdown
Owner

For your templates, note two things:

  • This will quote/escape your strings (template extension): HigherLevels: {resource.higherLevels.quotedEscaped}
  • There is very often more than one source. You could comma-separate them, or process as an array:
sources:
{#each resource.sourceAndPage}
- {it.longName.quotedEscaped}
{/each}

@ebullient ebullient merged commit b4bf7f3 into ebullient:main Mar 9, 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.

3 participants