Dice Tray

An Obsidian plugin. This page runs the real plugin code over a sample note in your browser, with Obsidian's look faked around it. Click any pill to roll again; hover one to see the dice.

Session 12 prep

Goblin boss attacks with dice: 1d20 + 5 to hit for dice: 2d6 + 3. The party rolls stats with dice: 4d6dl1 and saves at advantage with dice: 2d20kh1 + 2.

`dice: 1d20 + 5` `dice: 2d6 + 3` `dice: 4d6dl1` `dice: 2d20kh1 + 2`

Exploding dice dice: 3d6!, success counting dice: 6d10>=7, Fate dice: 4dF, percentile dice: d%, average damage dice: 8d6|avg.

`dice: 3d6!` `dice: 6d10>=7` `dice: 4dF` `dice: d%` `dice: 8d6|avg`

From your character, and other games

This note has str:: 4 and wis:: 1 in it. Longsword dice: 1d20 + str, perception dice: 1d20 + wis.

`dice: 1d20 + str` `dice: 1d20 + wis` (numbers from frontmatter or field lines in the note)

Genesys check dice: 2g1y2p1s, Fantasy AGE with stunt die dice: 1dS + 2.

`dice: 2g1y2p1s` `dice: 1dS + 2` (hover for each die)

Rolled once and kept: dice+: 4d6dl1 -> [5, 4, 3] -> 12

`dice+: 4d6dl1` (the result is written into the note; click to roll again)

From the Encounters note

Forest encounter: dice: [[Encounters#Forest]]

`dice: [[Encounters#Forest]]` (picks a random bullet under that heading)

Weather: dice: [[Encounters^weather]]

`dice: [[Encounters^weather]]` (a lookup table: rolls its d6 and shows the row)

Loot: dice: [[Encounters^loot]]|Item worth dice: [[Encounters^loot]]|Value

`dice: [[Encounters^loot]]|Item` `dice: [[Encounters^loot]]|Value`

Three encounters, no repeats: dice: 3d[[Encounters#Forest]]

`dice: 3d[[Encounters#Forest]]`

A whole section at random: dice: [[Encounters]]

`dice: [[Encounters]]` (a list, a table or a paragraph from the note)

From your tags

Who's at the inn tonight? dice: #npc|-

`dice: #npc|-` (one random note tagged #npc; plain `#npc` gives one from every tagged note, `|link` a link to one)

Try your own

While you write

Obsidian's Live Preview editor draws the rolls as you write. Below is a real editor with the plugin running. Put the cursor on a roll to edit its code (arrow keys, or click just after it); move away and it rolls. Click a roll to roll again.

The dice panel

For rolls that aren't written in a note. Open it from the ribbon and it sits in the sidebar: tap a die to add it (right-click takes one away), set a modifier, roll at advantage. Save a roll you make often. Click one in "This session" to roll it again.

Into your session log

With Session Log installed, each roll you click, here or in the panel, lands in your session note. Click a few above: