Detects dice formulas in your notes and provides a way to automatically roll them.
RPG Detect Dice Roll is an Obsidian plugin for tabletop role-playing notes. It detects dice formulas in reading view, turns them into clickable roll controls, and keeps recent results in a roll history panel.
Use it for session notes, solo RPG journals, encounter prep, oracle tables, random events, and any note where you want 1d20 + 4 or 2d6 to roll directly from the page.
d20, 1d20 + 4, 2d6 - 1, 4d6kh3, 2d20kl1, 4d6dl1, and 4d6dh1.d4, d6, d8, d10, d12, d20, and d100.Write dice formulas naturally in your notes, then switch to reading view. Detected formulas are styled as interactive text or buttons, depending on your settings.
The plugin supports standard dice terms with optional modifiers:
d20
1d20 + 4
2d6 - 1
4d6kh3
2d20kl1
4d6dl1
4d6dh1
Keep/drop suffixes mean:
kh: keep highestkl: keep lowestdh: drop highestdl: drop lowestFor example, 4d6kh3 rolls four six-sided dice and keeps the highest three.
Open Settings → Community plugins → RPG Detect Dice Roll to configure the plugin.
Custom formula dice add reusable buttons to the roll history panel. A formula die can be a full formula such as 1d3, 2d6 + 1, or a keep/drop suffix such as kh1.
Custom narrative dice choose from text outcomes instead of numeric totals. Each outcome can have optional relative odds, such as 1, 3, 40%, or 1/5. If weights are blank or invalid, the plugin treats those outcomes as equal odds.
<Vault>/.obsidian/plugins/rpg-detect-dice-roll/
main.js
manifest.json
styles.css
This project uses TypeScript, npm, and esbuild.
See CONTRIBUTING.md for contribution guidelines.
Install dependencies:
npm install
Start a development build in watch mode:
npm run dev
Create a production build:
npm run build
The Obsidian release artifact is main.js, generated at the plugin root.
Before creating a release, make sure the plugin builds successfully:
npm run build
Then prepare the release:
manifest.json to the new Semantic Versioning value, such as 1.0.0 for the initial release. Obsidian supports versions only in x.y.z format.versions.json so the plugin version maps to the minimum supported Obsidian version.manifest.json. Do not add a leading v.main.js
manifest.json
styles.css
styles.css is optional for Obsidian releases, but this plugin uses it, so include it.
RPG Detect Dice Roll runs locally in Obsidian. It does not make network requests, collect analytics, or send vault contents to external services.
This project is licensed under the terms in LICENSE.