ttrpg-stats

unlisted

by ThopDev

TTRPG Stats allows you create your character sheet with dynamic components that allow you to track your hp, spellslots, gold and way more.

3 starsUpdated 14d agoMIT
View on GitHub

TTRPG Stats

TTRPGStats is a plugin for Obsidian that lets you build your character sheet with dynamic components for tracking HP, spell slots, currency, skills, and more.

Disclaimer

This plugin is currently pending submission to the Obsidian community plugins list.

Pull request

Workaround: Install BRAT and add the following repo: https://github.com/thopdev/TTRPGStats

How to use

Create a component by adding a code block with the component name:

```ttrpgstats-hp
```

The plugin saves all data to your note's frontmatter properties, so you can read and edit them without the plugin as well.

Component Configurator

You can also insert and edit components using the built-in configurator instead of writing YAML by hand.

To insert a new component: Click the + circle icon in the ribbon, or run the command TTRPG Stats: Insert component from the command palette. Pick a component, fill in the form, and click Insert — the code block is added at your cursor.

To edit an existing component: Place your cursor inside an existing ttrpgstats-* code block and open the configurator. It will detect the block, pre-fill all fields with the current values, and replace the block when you click Insert.


Components

HP — Hit Points

Code block: ttrpgstats-hp

No configuration needed. The component reads and writes to property names configured in the plugin settings.

Shows current/max HP with Heal and Damage buttons. When HP reaches 0, death save checkboxes appear automatically (3 successes / 3 failures).

Settings (configured in plugin settings, not the code block):

SettingDefault
Max health property namemax_health
Current health property namecurrent_health
Death save success propertydeath_save_success
Death save failure propertydeath_save_failure

Examples:

hp component hp with death saves


Tracker

Code block: ttrpgstats-tracker

Tracks a countable resource (spell slots, ki points, etc.) as a row of checkboxes with optional event buttons.

id: spellslots_1
name: Spell Slots (1st)
max: 4
color: Blue
events:
  - name: short
    calc: devideMaxUp
  - name: long
    calc: max

TrackerConfig

NameTypeRequiredDefaultDescription
idstringYesProperty name used to save the current value
namestringNoLabel shown above the tracker
maxnumberYesMaximum value
colorstringNoBlueCheckbox fill color
eventsTrackerEvent[]NoButtons that trigger value changes

TrackerEvent

NameTypeRequiredDefaultDescription
namestringYesButton label
calczero max decrease increase devideMaxUp devideMaxDown doubleNozeroAction triggered by the button

Examples:

tracker


Tracker Buttons

Code block: ttrpgstats-button

A row of buttons that fire events on all trackers on the page. Use this alongside multiple trackers to trigger rest actions etc. in one click.

buttons:
  - name: Short Rest
    id: short
    color: green
  - name: Long Rest
    id: long
    color: red

TrackerButtonListConfig

NameTypeRequiredDefaultDescription
buttonsTrackerButtonConfig[]YesList of buttons to render
namestringNoLabel shown above the buttons

TrackerButtonConfig

NameTypeRequiredDefaultDescription
namestringYesButton label
idstringYesEvent id to fire — matches name in TrackerEvent
colorstringNoWhiteButton color

Examples:

tracker-buttons


Valuta — Currency Tracker

Code block: ttrpgstats-valuta

Tracks multiple currency denominations with Add and Remove buttons. Supports automatic conversion between denominations.

id: coins
allowNegative: false
convert: false
displayNull: true
valutas:
  - platinum: 1000
  - gold: 100
  - electrum: 50
  - silver: 10
  - copper: 1

ValutaConfig

NameTypeRequiredDefaultDescription
idstringNocoinsProperty name used when convert: true to store the total value
allowNegativebooleanNofalseAllow values to go below zero
convertbooleanNofalseStore a single total value and always display in optimal denominations
displayNullbooleanNotrueShow denominations that are currently 0
valutasValuta[]YesList of denominations. Each entry is name: multiplier

Each entry in valutas is a key/value pair where the key is the currency name and the value is its worth in base units. Example: gold: 100 means 1 gold = 100 copper.

Modes:

  • convert: false (default) — each denomination is stored as its own property. When removing, if a denomination doesn't have enough, it automatically borrows from higher denominations (e.g. removing 1 silver from 10 gold → 9 gold 9 silver). A Simplify button collapses values into the fewest coins possible.
  • convert: true — all value is stored as a single total in base units and always displayed in the optimal breakdown.

Skills

Code block: ttrpgstats-skills

Displays a skill list with ability modifiers, proficiency bonuses, and totals. Reads ability scores and proficiency bonus from your note's properties.

proficiency: proficiency_bonus
modifiers: false
sort: ability
abilities:
  str: str
  dex: dex
  con: con
  int: int
  wis: wis
  cha: cha
skills:
  - name: Athletics
    ability: str
  - name: Stealth
    ability: dex
    proficient: true
  - name: Perception
    ability: wis
    proficient: true
  - name: Persuasion
    ability: cha
    expertise: true
    comment: Bardic inspiration

SkillConfig

NameTypeRequiredDefaultDescription
proficiencystringNoproficiency_bonusProperty name to read proficiency bonus from
abilitiesRecord<string, string>Nostr/dex/con/int/wis/cha → same namesMaps ability abbreviation to property name. Override to point to different properties
modifiersbooleanNofalseWhen true, treats ability scores as already-computed modifiers instead of raw scores
sortname abilityNoDefault display order. name = alphabetical, ability = grouped by ability
skillsSkillItem[]YesList of skills to display

SkillItem

NameTypeRequiredDefaultDescription
namestringYesSkill name
abilitystringYesstrAbility abbreviation this skill uses
proficientbooleanNofalseAdds proficiency bonus to the total
expertisebooleanNofalseAdds double proficiency bonus to the total
commentstringNoSmall italic note shown below the skill name

The component displays columns: proficiency icon (○ / ● / ★), skill name, ability modifier, proficiency bonus, and total. A sort button in the header cycles between Default / A–Z / Ability grouping.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.