The notebook can include markdown that rolls digital dice. You can roll dice with any number of sides
rollable([dice=]dicenotation,[dicelabel=label text,label=label text])
dice | Required | The dice notation for the roll. See below for more details. |
dicelabel | Optional | The text to display in the title bar of the roll notification. Will default to the dice notation if omitted. |
label | Optional | The text to show in the rendered markdown. Will default to the dice notation if omitted. |
If the only field used is dice=
, the field label can be omitted, so rollable(dice=1d20+2)
is can be shortened to rollable(1d20+2)
.
Dice Notation
Dice rolls are given in the form AdX
. A and X are variables, separated by the letter d, which stands for die or dice. The letter d is lower-case.
- A is the number of dice to be rolled.
- X is the number of faces of each dice.
To this basic notation, an additive modifier can be appended, yielding expressions of the form AdX+B. The plus sign can be replaced by a minus sign (“-“) to indicate subtraction. B is a number to be added to the sum of the rolls. So, 1d20+10
would indicate a roll of a single 20-sided die with 10 being added to the result. These expressions can also be chained (e.g. 2d6+1d8+4
).
Each dice group is resolved and the total re-calculated as it is processed left-to-right. No order of operations are used to calculate the final result.
Dice notation is usable in rollable()
markdown as well as the dice rolling panel.
Examples
1d20
will roll a 20-sided die and return the result.
2d6+4
will roll 2 6-sided dice, add them together and add 4.
Keep/Drop Highest/Lowest
Some systems allow for rolling multiple times and picking the highest or lowest dice from all those rolled. This can be accomplished with by adding the following the the dice notation
notationABX
- A is either
k
for keep ord
for drop - B is either
h
for highest orl
for lowest - X is the number of dice to keep or drop
Examples
4d6dl1
will roll 4 6-sided dice, drop the lowest, and add the remaining 3 together. This is functionally equivalent to 4d6kh3
(roll 4d6, keep the highest 3, add them together).
Open-ended rolling, exploding dice, and penetration rolls
Several games use mechanics that allow one or more dice to be rerolled (often a die that rolls the highest possible number), with each successive roll being added to the total.
The notation for exploding dice is to use an exclamation point: AdX!
or 6d6!.
number() and mod5e() in Statblocks
As well as the standalone rollable()
syntax, number()
and mod5e()
now also have the dice=
and dicelabel=
properties to allow dice to be rolled based on the numerical value of the field. This allows you to create a number that is editable via the UI then have that number used in the roll. To use the selected number in the roll, replace any of A
, X
or B
in AdX+B
with the character n
e.g. 1d20+n
or 2dn+4
.
Examples
Damage 1d6 + number(name=damage,label=Strength,value=4,dice=1d6+n,dicelabel=Damage)
Rolls 1d6+n
where n
is the numer()
value selected.
Strength number(name=str,label=Strength,value=12) (mod5e(show_symbol,value=str,dice=1d20+n,dicelabel=Strength Roll))
Rolls 1d20+n
where n is the mod5e()
value calculated from the number()
selected.
Referencing numbers in other dice rolls
You can include the value of a number()
or mod5e()
in the dice notation of another number or rollable by using the field[fieldname]
syntax in the dice notation. To include the number from a different object, use the field[objectid.fieldname]
syntax. This allows you to easily re-use the same field multiple times.
Example
**Strength:** number(name=strength,value=14) (mod5e(name=strengthmod,show_symbol,value=strength,dice=1d20+n,dicelabel=Strength Check))
**Reference Field:** rollable(1d20+field[strengthmod])

Rolling
When the dice are rolled, the result will appear at the top of the page.

- The title can be customised with the
dicelabel
option. - Shows the individual dice rolls. Groups will be shown in parenthesis, e.g.
2d6 + 2d4 + 2
will show the2d6
grouped together, the2d4
grouped together and the+ 2
by itself. Max die rolls are highlighted green, min die rolls are highlighted red. If you specify keep/drop high/low then the rolls kept will be highlighted in green and the rolls dropped will be greyed and crossed out. - The final total.
- The original roll notation.
You can close the notification by clicking the X button or swiping it away on a touch screen. Rolling again will also update the notification. There is no history of rolls kept.
Roll Modifiers
Rolls are often altered slightly based on game rules, for example in D&D 5e advantage means rolling the d20 twice and using the higher number before adding your modifier, or critical hits mean rolling all the dice twice then adding the normal modifier.
For things like advantage and disadvantage, you can just click the roll button twice and use the higher or lower value, but critical hits are slightly more complicated as you don’t add everything twice. So these variations can be configured in the notebook and rolled from the context menu without you having to manually do anything when the roll is called for.
Just right-click the dice rolling icon to see the available variants that can be rolled.
Dice are rolled with the modifier rule name appended to the dice label.

As the notebook supports many game systems, and house rules exist, especially around critical hits, you can configure these rules to suit your system and table. There are a few default templates that can be quickly added or you can add your own rule if needed.
The below is an example setup for D&D 5e, giving advantage and disadvantage options for d20 rolls and critical hit rolls for rolls that include d4s-d12s.

Rules will only show in the context menu for a roll if the rule criteria matches, so for the above, rolls of 1d20+n
(e.g. ability check, saving throws, and attack rolls) will give the advantage/disadvantage options, and rolls that include d4s-d12s (e.g. weapon damage) will show the critical hit option.
Configuring Rules
No rules are included by default but rules can be added from the campaign settings, in the roll modifiers section.
Add a rule, name it, and click the edit button to open the properties.

Template rules allow you to select a pre-made template. See below for the details.
Simple rules allow you to provide an exact-match text replacement. Where the criteria text is found in the dice notation, the will be replaced with the modifier text. This is useful for modifying exact dice rolls, e.g. 1d20. This match only needs to match part of the notation.
Advanced rules allow for multiple criteria and uses regex matching, allowing capture groups to be used in the modifier. Groups can be referenced in the modifier with the {n}
syntax where n is the group number. This can be modified by adding, subtracting, multiplying, or dividing with a number, for example {1*2}
uses the result of capture group 1, multiplied by 2. Alternatively, instead of a number, it can reference another capture group by adding the other group reference, for instance {1*{2}}
uses the result of capture group 1 and multiplies it by the result of capture group 2.
Testing your rule
While creating a rule, you probably want to test to ensure it matches and modifies the dice notation as you expect it to. Just enter soe dice notation in the panel at the bottom to see what the modified version calculates as.
Templates
A few templates are provided for common modifier rules. If the rules you need is one of these, just select it from the list and save the rule.

- Roll 1d20 twice, take higher, add modifier – Any roll that includes 1d20, roll the die twice and take the higher of the two before adding any modifiers. e.g.
1d20+2
becomes1d20kh1+2
(1d20 keep highest 1, +2). This is advantage in D&D 5e. - Roll 1d20 twice, take lower, add modifier – Similar to above, but taking the lower of the two dice. This is disadvantage in D&D 5e.
- Roll all d4s-d12s twice, add modifiers – Double the quantity of d4s, d6s, d8s, d10s, and d12s rolled, before adding the normal modifier. e.g.
1d6+2d4+2
becomes2d6+4d4+2
. This is D&D 5e’s RAW critical hit rule. - Roll all d4s-d12s, add the max of each, add modifiers – Any d4s, d6s, d8s, d10s, and d12s get rolled and added to the max of each die. e.g.
1d6+2d4+2
becomes1d6+6+2d4+8+2
. This is a common house rule for critical hits. - Roll all d4s-d12s, add modifiers, then double the result – Any d4s, d6s, d8s, d10s, and d12s get rolled, modifiers added, the the whole result doubled. e.g.
1d6+2d4+2
becomes1d6+22d4+2*2
. This is PF2e’s RAW critical hit rule. - Roll all d4s-d12s twice, add double the modifiers – Double the quantity of d4s, d6s, d8s, d10s, and d12s rolled, before adding the twice the normal modifier. e.g.
1d6+2d4+2
becomes2d6+4d4+4
. This is a common house rule for critical hits.