Dice Roller in Javascript Block #389
Answered
by
ThaddaeusWiedemer
ThaddaeusWiedemer
asked this question in
Q&A
-
|
I'm making heavy use of the javascript blocks to create a custom layout. However, I'm unable to figure out how to integrate a dice roller in there. Consider this super simple example: const myDiv = document.createElement('div');
myDiv.textContent = 'Bite Attack: +5 to hit, 1d4+3 damage`;
return myDiv;These dice rolls do not get parsed automatically. How can I enable dice parsing in a javascript block, and ideally create custom dice callbacks? |
Beta Was this translation helpful? Give feedback.
Answered by
ThaddaeusWiedemer
May 18, 2024
Replies: 1 comment 6 replies
-
|
In the JavaScript block, you should be using the API from the Dice Roller plugin. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! With that hint, I've figured it out. Here's a minimal working example for use in a JavaScript Block if anyone else was wondering: