Timothy's Dev Stuff

A collection of code snippets and other developer things.

Building a Dungeons and Dragons 5.5e Creature Stat Block

I was bored and challenged myself to build a Dungeons and Dragons 5.5e creature stat block inspired by the 2024 Player’s Handbook using HTML and CSS. I wanted to create a one-column and two-column layout and make it responsive. For the most part, I think I have achieved my goal and consider this a success. I’m sure there are minor tweaks that could be done to it for better layout. Maybe better font choices as well. In the future, I think it would be a cool project to create a fillable form that can generate a stat block based on user input. Another useful feature would be to create ways for the rendered element to either be embedded in a document or exported as an image.

Two-Column Layout

Ancient Green Dragon


Gargantuan Dragon, Lawful Evil

AC 21
Initiative +8 (23)

HP 402 (23d10 + 161)

Speed 40ft., Fly 80ft., Swim 40ft.

Mod
Save
Mod
Save
Mod
Save
STR
27
+8
+8
DEX
12
+1
+8
CON
25
+7
+7
INT
20
+5
+5
WIS
17
+3
+10
CHA
22
+6
+6

Skills Perception +17, Persuasion +13, Stealth +8

Immunities Poison; Poisoned

Senses Blindsight 60 ft., Darkvision 120 ft., Passive Perception 27

Languages Common, Draconic

CR 22 (XP 41,000 or 50,000 in lair; PB +7)

Traits


Amphibious. The dragon can breathe air and water. Battle Ready. The dragon has Advantage on Initiative rolls.

Legendary Resistance (4/Day or 5/Day in Lair). If the dragon fails a saving throw, it can choose to succeed instead.

Actions


Multiattack. The dragon makes three Rend attacks. It can replace one of these attacks with a use of Spellcasting (at will spells only).

Rend. Melee Attack Roll: +15, reach 15 ft. Hit: 17 (2d8 + 8) Piercing damage plus 10 (3d6) Poison damage.

Spellcasting. The dragon casts one of the following spells, requiring no Material components, using Charisma as the spellcasting ability (spell save DC 21):

At Will: Charm Monster (level 5 version), Detect Magic, Dissonant Whispers (level 4 version)

2/Day Each: Cloudkil (level & version), Geas

1/Day Each: Modify Memery, Polymorph

Poison Breath (Recharge 5-6). Constitution Saving Throw: DC 22, each creature in a 90-foot Cone. Failure: 77 (22d6) Poison damage. Success: Half damage.

Reactions


The dragon can take up to three Reactions per round but only one per turn. If the dragon is in its lair, it can take an additional Reaction per round.

Charming Presence. Trigger: Another creature the dragon can see ends its turn. Response: The dragon casts Chorm Monster (level 5 version).

Corrosive Miasma. Trigger: The dragon uses its Legendary Resistance trait or is hit with a ranged attack. Response-Constitution Saving Throw: DC 21, each creature in a 30-foct-radius Sphere centered on a point the dragon can see within 90 feet. Failure: 14 (4d6) Poison damage and the target takes a -2 penalty to their AC until the end of its next turn.

Rend Retaliation. Trigger: The dragon takes damage. Response: The dragon makes one Rend attack.

One-Column Layout

Ancient Green Dragon


Gargantuan Dragon, Lawful Evil

AC 21
Initiative +8 (23)

HP 402 (23d10 + 161)

Speed 40ft., Fly 80ft., Swim 40ft.

Mod
Save
Mod
Save
Mod
Save
STR
27
+8
+8
DEX
12
+1
+8
CON
25
+7
+7
INT
20
+5
+5
WIS
17
+3
+10
CHA
22
+6
+6

Skills Perception +17, Persuasion +13, Stealth +8

Immunities Poison; Poisoned

Senses Blindsight 60 ft., Darkvision 120 ft., Passive Perception 27

Languages Common, Draconic

CR 22 (XP 41,000 or 50,000 in lair; PB +7)

Traits


Amphibious. The dragon can breathe air and water. Battle Ready. The dragon has Advantage on Initiative rolls.

Legendary Resistance (4/Day or 5/Day in Lair). If the dragon fails a saving throw, it can choose to succeed instead.

Actions


Multiattack. The dragon makes three Rend attacks. It can replace one of these attacks with a use of Spellcasting (at will spells only).

Rend. Melee Attack Roll: +15, reach 15 ft. Hit: 17 (2d8 + 8) Piercing damage plus 10 (3d6) Poison damage.

Spellcasting. The dragon casts one of the following spells, requiring no Material components, using Charisma as the spellcasting ability (spell save DC 21):

At Will: Charm Monster (level 5 version), Detect Magic, Dissonant Whispers (level 4 version)

2/Day Each: Cloudkil (level & version), Geas

1/Day Each: Modify Memery, Polymorph

Poison Breath (Recharge 5-6). Constitution Saving Throw: DC 22, each creature in a 90-foot Cone. Failure: 77 (22d6) Poison damage. Success: Half damage.

Reactions


The dragon can take up to three Reactions per round but only one per turn. If the dragon is in its lair, it can take an additional Reaction per round.

Charming Presence. Trigger: Another creature the dragon can see ends its turn. Response: The dragon casts Chorm Monster (level 5 version).

Corrosive Miasma. Trigger: The dragon uses its Legendary Resistance trait or is hit with a ranged attack. Response-Constitution Saving Throw: DC 21, each creature in a 30-foct-radius Sphere centered on a point the dragon can see within 90 feet. Failure: 14 (4d6) Poison damage and the target takes a -2 penalty to their AC until the end of its next turn.

Rend Retaliation. Trigger: The dragon takes damage. Response: The dragon makes one Rend attack.