
**** New Version Available **** Hi All, This is my new Mod for displaying an NPC Stat Block in chat. It's for the D&D 5E (2014) by Roll20 character sheet. It requires the Scriptcards API mod. ******This will work on 2024 content just not with the new beacon sheets**** What Does This Mod Do? This mod displays the selected token's NPC Stat Block in chat, it is displayed as closely to the 2014 monster manual stat block as I could get it. There are buttons for all Skills, Saves, Traits and Actions; including bonus, reaction, legendary and mythic actions.
Installation Instructions
This mod requires a custom template to be installed. To create a custom template, create a new character called "ScriptCards_TemplateMule" without the quotes, it is case sensitive. Then create two new abilities on the character. One called "Reset Templates" and put !sc-reloadtemplates as the macro(use this to reset templates any time you make a change to one.).
For the second ability, name it "statblock" without the quotes. This is the template/style for the Mod. Add the code below:
boxcode::{div style='background-image: url(&quot;<a href="https://files.d20.io/images/105716505/oymO0pnVyLCv-tQDw2vddA/med.png&quot" rel="nofollow">https://files.d20.io/images/105716505/oymO0pnVyLCv-tQDw2vddA/med.png&quot</a>;) ; background-size: 100% 100% ; display: block ; text-align: left ; font-size: 12px ; padding-top: 1em ; font-family: serif ; font-style: normal ; line-height: 1.2em ;'}||
titlecode::{div style='background-image: url(&quot;<a href="https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&quot" rel="nofollow">https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&quot</a>;) !important ; background-size: 101% 4px ; width: 101% ; height:4px; display: block ; border: 1px solid #2f2112; border-radius: 2px ; vertical-align: top ; position: relative ; top: -15px ; left: -3px'}{/div}{div style='margin: 0em .25em 0em .25em ; font-size: 24px ; font-variant: small-caps ; font-family: serif ; color: #6e2425 ; display: block ; font-weight: bold ; font-style: normal ; vertical-align: top ; position: relative ; top: -10px; left: 4px';}||
textcode::{/div}{div}{div style='color: #611b1c ; font-weight: normal; display: inline-block; margin: 0 1em 0 1em; vertical-align: top ; position: relative ; top: -10px';'}||
buttonwrapper::{div style='display: block ;'}{div style='background-image: url(&quot;<a href="https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&quot" rel="nofollow">https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&quot</a>;) !important ; background-size: 111% 4px ; width: 111% ; height:4px; display: block ; border: 1px solid #2f2112; border-radius: 2px ; vertical-align: bottom ; position: relative ; bottom: -10px ; left: -14px'}{/div}||
buttonstyle::style='color: #611b1c ; background-color: transparent ; padding: 2px ; border: none'||
footer:: Run your Reset Templates Now create your new macro and add the code below: !Script{{
--/|Script Name : Tim's NPC Statblock Mod (Scriptcards) for D&D 5E 2014
--/|Version : 2.2.0
--/|Author : Timothy Beasley
--/|Description : This script displays an NPC statblock that mimics the 2014 Monster Manual in chat that has buttons for all
--/| rolls; Skills, Saves, Traits, and Actions(bonus, reaction, Legendary, Mythic).
--/|
--/|Usage : This script is for the 2014 edition of the official D&D 5E Character Sheet by Roll20 and requires the
--/| installation of the ScriptCards MOD using a pro account with API access.
--/| This script also requires the installation of a custom ScriptCards template. Instructions for installing
--/| a custom style template can be found on the Roll20 wiki page for ScriptCards. The code for the scriptcard
--/| template can be found in the post associated with this Script on the Roll20 forums below;
--/| <a href="https://app.roll20.net/forum/post/12267264/tims-npc-stat-block-mod-scriptcards-d-and-d-5e-2014" rel="nofollow">https://app.roll20.net/forum/post/12267264/tims-npc-stat-block-mod-scriptcards-d-and-d-5e-2014</a>
--/| or on my GitHub below as statblock.css;
--/| <a href="https://github.com/VirulentArc/ScriptCards" rel="nofollow">https://github.com/VirulentArc/ScriptCards</a>
--/| Make sure the template "macro" name is stablock or change #overridetemplate to whatever name you'd prefer
--/| it to have.
--#Debug|0
--#overridetemplate|statblock
--#Whisper|self
--#sourceToken|@{selected|token_id}
--&CharID|[*S:character_id]
--#title|[*S:npc_name]
--#emoteState|0
--?"[*S:npc_actype]" -ne ""|&NPCactype;([*S:npc_actype])
--?"[*S:hp]" -ne ""|&BaseHP; [*S:hp] /
--&Divider|[t][tr][td height=5px][/td][/tr][/t][t][tr][td width=100% style="border: none; border-top: 0.10em solid transparent; border-bottom: 0.25em solid transparent; border-left: 14em solid #7e2d40; line-height: 1.25em; font-size: 1.4em; display: block;"][/td][/tr][/t][t][tr][td height=5px][/td][/tr][/t]
--&Space|[t][tr][td height=8px][/td][/tr][/t]
-->BeforeActions|
--~|array;define;SectionTypes;trait;action;bonusaction;reaction;action-l;action-m
--%SectionLoop|foreach;SectionTypes
--Rfirst|[&CharID];repeating_npc[&SectionLoop]
--?"[*R:name]" -ne "NoRepeatingAttributeLoaded"|>ActionLoop;[&SectionLoop]
--%|
-->SkillBlock|
--~|array;delete;actionarray
--X|
--:BeforeActions|
--&HeaderBlock|[t width=100%]
--&HeaderBlock|+[tr][td][F::12][#000][i][*S:npc_type]&nbsp;[/i][/#][/F][/td][/tr]
--&HeaderBlock|+[tr][td][&Divider][/td][/tr]
--&HeaderBlock|+[tr][td][F::12][b]Armor&nbsp;Class[/b]&nbsp;[*S:npc_ac]&nbsp;[&NPCactype][br][/F][/td][/tr]
--&HeaderBlock|+[tr][td][F::12][b]Hit&nbsp;Points[/b][&BaseHP]&nbsp;[*S:hp^]&nbsp;([*S:npc_hpformula])[br][b]Speed[/b]&nbsp;[*S:npc_speed][/F][/td][/tr][/t]
--+|[&HeaderBlock]
--+|[&Divider]
--&StatsBlock|[t width=106% style="text-align: center; position: relative ; left: -6px"][tr]
--&StatsBlock|+[td width=80px][F::14][b][button]STR&nbsp;[*S:strength]&nbsp;([*S:strength_mod])::~selected|npc_str[/button]&nbsp;&#124;[/b][/F][br][button]save::~selected|npc_str_save[/button][/td]
--&StatsBlock|+[td width=80px][F::14][b][button]DEX&nbsp;[*S:dexterity]&nbsp;([*S:dexterity_mod])::~selected|npc_dex[/button]&nbsp;&#124;[/b][/F][br][button]save::~selected|npc_dex_save[/button][/td]
--&StatsBlock|+[td width=80px][F::14][b][button]CON&nbsp;[*S:constitution]&nbsp;([*S:constitution_mod])::~selected|npc_con[/button][/b][/F][br][button]save::~selected|npc_con_save[/button][/td][/tr]
--&StatsBlock|+[tr][td width=80px][F::14][b][button]INT&nbsp;[*S:intelligence]&nbsp;([*S:intelligence_mod])::~selected|npc_int[/button]&nbsp;&#124;[/b][/F][br][button]save::~selected|npc_int_save[/button][/td]
--&StatsBlock|+[td width=80px][F::14][b][button]WIS&nbsp;[*S:wisdom]&nbsp;([*S:wisdom_mod])::~selected|npc_wis[/button]&nbsp;&#124;[/b][/F][br][button]save::~selected|npc_wis_save[/button][/td]
--&StatsBlock|+[td width=80px][F::14][b][button]CHA&nbsp;[*S:charisma]&nbsp;([*S:charisma_mod])::~selected|npc_cha[/button][/b][/F][br][button]save::~selected|npc_cha_save[/button][/td]
--&StatsBlock|+[/tr][/t]
--+|[&StatsBlock]
--+|[&Divider]
--&SecondBlock|[t width=100%][tr][td style="width: 240px ; display: block ; font-size: 12px ; "]
--~|array;define;SaveArray;str;dex;con;int;wis;cha
--%SaveLoop|foreach;SaveArray
--?"[*S:npc_[&SaveLoop]_save_base]" -gt 0|[
--~SaveTitle|string;totitlecase;[&SaveLoop]
--&AddSave|+[&SaveTitle]&nbsp;[*S:npc_[&SaveLoop]_save_base],&nbsp;
--]|
--%|
--?"[&AddSave]" -ne ""|[
--&SavingThrows|[b]Saving&nbsp;Throws&nbsp;[/b]
--]|
--=SecondBlockCalc|[&AddSave(length)] - 7
--&SecondBlock|+[&SavingThrows][&AddSave(0,[$SecondBlockCalc.Raw])][/td][/tr][/t]
--+|[&SecondBlock]
--&ThirdBlock|[t width=100%][tr][td style="width: 240px ; display: block ; font-size: 12px ; "]
--~|array;define;SkillArray;acrobatics;animal_handling;arcana;athletics;history;insight;intimidation;investigation;medicine;nature;perception;performance;persuasion;religion;sleight_of_hand;stealth;survival
--%SkillLoop|foreach;SkillArray
--?"[*S:npc_[&SkillLoop]_base]" -gt 0|[
--~SkillTitle|string;totitlecase;[&SkillLoop]
--&AddSkill|+[&SkillTitle]&nbsp;[*S:npc_[&SkillLoop]_base],&nbsp;
--]|
--%|
--?"[&AddSkill]" -ne ""|[
--&SkillHeading|[b]Skills&nbsp;[/b]
--]|
--=ThirdBlockCalc|[&AddSkill(length)] - 7
--&ThirdBlock|+[&SkillHeading][&AddSkill(0,[$ThirdBlockCalc.Raw])][/td][/tr][/t]
--+|[&ThirdBlock]
--#parameterDelimiter|$$$
--&FourthBlock|[t width=100%]
--?"[*S:npc_vulnerabilities]" -ne ""|&FourthBlock$$$+[tr][td][F::12][b]Damage&nbsp;Vulnerabilities[/b]&nbsp;[*S:npc_vulnerabilities][/F][br][/td][/tr]
--?"[*S:npc_resistances]" -ne ""|&FourthBlock$$$+[tr][td][F::12][b]Damage&nbsp;Resistances[/b]&nbsp;[*S:npc_resistances][/F][br][/td][/tr]
--?"[*S:npc_immunities]" -ne ""|&FourthBlock$$$+[tr][td][F::12][b]Damage&nbsp;Immunities[/b]&nbsp;[*S:npc_immunities][/F][br][/td][/tr]
--?"[*S:npc_condition_immunities]" -ne ""|&FourthBlock$$$+[tr][td][F::12][b]Conditions&nbsp;Immunities[/b]&nbsp;[*S:npc_condition_immunities][/F][br][/td][/tr]
--?"[*S:npc_senses]" -ne ""|&FourthBlock$$$+[tr][td][F::12][b]Senses[/b]&nbsp;[*S:npc_senses][/F][br][/td][/tr]
--?"[*S:npc_languages]" -ne ""|&FourthBlock$$$+[tr][td][F::12][b]Languages[/b]&nbsp;[*S:npc_languages][/F][br][/td][/tr]
--?"[*S:npc_challenge]" -ne ""|&FourthBlock$$$+[tr][td][F::12][b]Challenge[/b]&nbsp;[*S:npc_challenge]&nbsp;[*S:npc_xp]xp[/F][br][/td][/tr]
--?"[*S:npc_pb]" -ne 0|&FourthBlock$$$+[tr][td][F::12][b]Proficiency Bonus[/b]&nbsp;[*S:npc_pb][/F][br][/td][/tr]
--#parameterDelimiter|;
--&FourthBlock|+[/t]
--+|[&FourthBlock]
--+|[&Divider]
--<|
--:ActionLoop|
--&Action|[%1%]
--?"[&Action]" -eq "action-l"|&ActionName;Legendary Action|&ActionName;[&Action]
--?"[&Action]" -eq "action-m"|&ActionName;Mythic Action
--&ActionOutput|[t width=100%]
--?"[&Action]" -ne "trait"|&ActionOutput;+[tr][td][F::20][&ActionName(totitlecase)]s[/F][hr #922610][/td][/tr]
--?"[&Action]" -inc "action-l"|[
--&ActionOutput|+[tr][td][F::12][#000][*S:npc_legendary_actions_desc][/#][/F][/td][/tr]
--]|
--?"[&Action]" -inc "action-m"|[
--&ActionOutput|+[tr][td][F::12][#000]@{selected|npc_mythic_actions_desc}[/#][/F][/td][/tr]
--]|
--~|array;fromrepeatingsection;actionarray;[&CharID];repeating_npc[&Action];name
--%ActionLoop|foreach;actionarray
--Rfind|[&CharID];[&ActionLoop];repeating_npc[&Action];name
--?"[&Action]" -eq "reaction" -or "[&Action]" -eq "trait"|&ButtonURL;[*R>npc_roll_output]|&ButtonURL;[*R>npc_action]
--#parameterDelimiter|$$$
--?"[&Action]" -eq "trait"|&ButtonEmote$$$&#x1F4DC;|&ButtonEmote$$$&#x2694;&#xfe0f;
--#parameterDelimiter|;
--&ToolTip|[*R:name]|[*R:description]
--?"[*R:name]X" -ne "X"|[
--&ActionOutput|+[tr][td title="[&ToolTip]" style="width: 200px ; display: inline-block ; white-space: nowrap ; overflow: hidden ; text-overflow: ellipsis ; color: #000 ; font-weight: bold ; "][i][*R:name][/i][/td][td style="width: 40px ; display: inline-block ; text-align: right ; "][F::14]|[sheetbutton][&ButtonEmote]::@{selected|character_name}::[&ButtonURL][/sheetbutton]|[/F][/td][/tr]
--]|
--%|
--&ActionOutput|+[/t]
--+|[&ActionOutput]
--+|[&Space]
--<|
--:SkillBlock|
--+|[hr #922610]
--&SkillOutput|[t width=100% style="text-align: center ; "]
--&SkillOutput|+[tr][td][button]Acrobatics::~selected|npc_Acrobatics[/button]&nbsp;|&nbsp;[button]Animal Handling::~selected|npc_Animal_Handling[/button]&nbsp;|&nbsp;[button]Arcana::~selected|npc_Arcana[/button][/td][/tr]
--&SkillOutput|+[tr][td][button]Athletics::~selected|npc_Athletics[/button]&nbsp;|&nbsp;[button]History::~selected|npc_History[/button]&nbsp;|&nbsp;[button]Insight::~selected|npc_Insight[/button]&nbsp;|&nbsp;[button]Intimidation::~selected|npc_intimidation[/button][/td][/tr]
--&SkillOutput|+[tr][td][button]Investigation::~selected|npc_Investigation[/button]&nbsp;|&nbsp;[button]Medicine::~selected|npc_Medicine[/button]&nbsp;|&nbsp;[button]Nature::~selected|npc_Nature[/button]&nbsp;|&nbsp;[button]Perception::~selected|npc_Perception[/button][/td][/tr]
--&SkillOutput|+[tr][td][button]Performace::~selected|npc_Performance[/button]&nbsp;|&nbsp;[button]Persuasion::~selected|npc_Persuasion[/button]&nbsp;|&nbsp;[button]Religion::~selected|npc_Religion[/button][/td][/tr]
--&SkillOutput|+[tr][td][button]Sleight of Hand::~selected|npc_Sleight_of_Hand[/button]&nbsp;|&nbsp;[button]Stealth::~selected|npc_Stealth[/button]&nbsp;|&nbsp;[button]Survivial::~selected|npc_Survival[/button][/td][/tr]
--+|[&SkillOutput]
--<|
--X|
}} 2025-03-24 Updated to include conditional to check if resource exists but is blank, do not output. 2025-03-30 Updated to remove the red line image and replace it with inline css. statblock style needs to be updated as well, don't forget to reset your templates. 2025-04-03 Updated to 1.1.0, formatting overhaul, just for consistency across platforms and browsers and fixes formatting problems with the bottom bar widening the longer the statblock is. Not a necessary update if what you're using is working for you. If you do update, also replace template code and reset your templates. 2025-04-06 Updated to 1.1.1. Found and fixed a bug with Skills and Saves. If there were multiple of any of them it completely broke the statblock. Did a bunch of complicated(for me) stuff to fix it. Also changed the size of the title a fraction, so update and reset templates as well. 2025-04-14 Updated to 2.0.0. Did a rewrite to create a dynamic loop that displays all different actions. Reduced the overall code by about a quarter. 2025-04-14 Updated to 2.0.1. Found a formatting bug, if the NPC has a double digit attribute bonus it didn't fit and broke the formatting. Other small bug fixes. 2025-05-05 Updated to 2.0.2 All action buttons were being output as the first action. Added the button string to the loop. 2025-05-06 Updated to 2.1.0 Consolidated Traits subroutine into Actions subroutine, reducing code size. Not a necessary update if you don't want to, function is the same just reduced size. 2025-07-17 Updated to 2.2.0 Minor HTML bug fix, missing opening table tag in fourth block. Reduced API calls by 90%.