FANDOM


This is a work in progress, 

How to create a Homebrew JSON for 5eTools

We're going to start pretty broadly and then narrow down.



A general overview of ....

The Steps

  • Find the project (a book/supplement you wish to see inside of 5eTools).
  • Post a comment here or here or in Discord under #Brew-Conversions on what project you've chosen (and if you'll want or need help/tutoring)
  • Get an editor like : Sublime Text or Notepad ++
  • Open a new file within the editor and save it as as <Author's name>; <Project name>.JSON
Examples:
"Player's Handbook" by WotC would be
`WotC; Player's Handbook.JSON`
"How to DM" by Sly Fox would be
`Sly Fox; How to DM.JSON`
  • Break down the project into logical parts. Does it contain: Races, Classes, Items, Traps, Feats, Monsters, Magical Items; etc. (See a Full Section list below the JSON file will be organized by these parts.
  • Separate those sections into simple text blocks where possible.
  • Create your Meta heading for the file
  • Using the Render Demo for formating reference, and Sample file format create each section from its logical parts.
  • Use JSONlit or another JSON validation application to verify basic structure issue. (Missing or extra commas, brackets, quotes and the like)
  • Fix the JSON until it is deemed valid.
  • Go to the Render Demo and check your project
  • Go to the Manage Homebrew page
    • Choose Upload File
    • Navigate to your project's File
    • Does the File show up under installed homebrew?
      • No : There is a JSON validation error. See Troubleshooting your JSON validation
      • Yes: Congrats move on
    • Open the section(s) your project has included.
    • If an alert message appears notifying you that the Corruption has been detected and the homebrew removed, you have a formating issue with the data and datatyping within the JSON for 5eTools' specific requirements in its schema.
    • If no error occurs navigate to your entries and double check their appearance, content and graphics (if any).
  • Go to the Discord Server and post in the #Brew-Conversion channel or, if using Git, issue a push request for completed file.


​​


Section Tags

entry templates are not linked yet, still testing.

Section Name Example File(s) Entry Template Tool(s) Description
Adventure 💾 📑 A playable adventure. Should includes maps, event descriptions, etc.
Books 💾 📑 Books are like Compendiums, but include more information, 'fluff' and the like.
Background 💾 📑 PhB}
Boon 💾 📑 Special rewards from Extraordinarily powerful creatures for a character's service.
Class 💾 📑 PhB}
Class Features 💾 📑 Features such as Invocations, Fightstyles, or the like.
Collection A Brew with multiple section types defined within it, which doesn't lean more towards any one type.
Condition 💾 📑 {@condition condition} effects
Creatures/Bestiary 💾 📑 Bestiary - Monsters, NPCs and the like
Deity 💾 📑
Disease 💾 📑 {@disease Diseases} and illnesses.
Feats 💾 📑 Custom Feats
Hazard 💾 📑
Item 💾 📑
Object 💾 📑
Optional Features 💾 📑
Psionics 💾 📑
Races 💾 📑
Reward 💾 📑
Ships 💾 📑
Spells 💾 📑
Table 💾 📑
Trap 💾 📑
Variant Rules 💾 📑


Formatting

JSON overview

  • Try to use tabs' 'instead of spaces in the file, most editors do this automatically, but mixing them will cause problems down the line. Be consistent
  • Indent after opening a punction section, reduce indention by one tab when ending a section
  • Brackets or Square Brackets [ ] or Braces or Curly Brackets { }, must open and close the various sections.
  • Quotation marks "" denote a string (alphanumeric informat follows)
  • An orphaned set of punctuation will cause the JSON validation to fail.
  • The order punctation is opened and closed must be preserved  { [ "  will fail if not matched in the reverse order " ] } 
    • Will Work: { [ " " ] }
    • Will Fail:  { [ " } ] " (not closing one or more of them)
    • Will Fail: { [ " } ] " (Closing them out of order)
    • Will Fail: ** Fails:  { [ " } ] "
      (Double Opening or double closing)
  • Quotation marks inside a set of quotation marks will END that string and that will often mean the remain string's text will fail validation.
    • "Ragnar yelled "HELP!!" at top of his lungs."  will be viewed as String "Ragnar yelled " and " at top of his lungs." are separate stings, and between them HELP!! is an unidentified tag/command - and so the validation will fail.
    • instead, try:
      • "Ragnar yelled HELP!! at top of his lungs." using two '' apostrophes, or
      • "Ragnar yelled “HELP!!” at top of his lungs." using open and close quotes ( “ ” ) (&ldquo and &rdquo in HTML also known as Ascii codes 0147 and 0148.
  • The comma (outside of quotation marks "" ) signifies the end of a line and that another element in that section or a new subsection will follow. The lack of a comma signfies the END of a section or subsection.
    • When another of the same element type (see Formatting) follows another line, that line must end with a comma (,)
    • When no other line of the same element or a new subelement follows. That line must NOT end with a comma (,)

EXAMPLE:

{
      "source": "5eHP",
      "page": 0,
      "name": "Cthurkey",
      "size": "S",
      "type": "aberration",
      "alignment": [
          "C",
          "E"
      ]
}

Open braces { will open the segment, next line indents one step a tag (sources) is defined by a string -- we know this because of the quotation marks -- (5eHP). As the next line is part of that same section of the braces a comma ends the lines all the way to "alignment": [ subsection - which indents another step, and since "E" follows "C" - line "C" ends in a comma. "E" has nothing following it in that section so no comma is put at the end of the line and the next line will close that subsection with a closing Bracket which will reduce the indentation by one step. That closure is alsothe last element with that segment the open brace { defined so it also will have no comma and the program now knows that the next line will be unindented with a closing brace }


General Text

 

Adventure

 

Background

 

Book

 

Boon

 

Class

 

Condition

 

Deity

 

Disease

 

Feat

 

Fluff

 

Hazzard

 

Item

 

Monster

 

Object

 

OptionsFeature

 

Psionic

 

Reward

 

Ship

 

Spells

 

Subclass

 

Table

 

Trap

 

VariantRules

 

Tools

Editors (Sublime Text or Notepad ++)

  Rendering Demo (https://5e.tools/demo.html)

A location for formating lookup



Badooga's Reddit to Markdown (https://github.com/badooga/Programs/blob/master/Dungeons%20and%20Dragons/reddit_to_markdown.py)

For Taking content from Reddit and coverting it into Markdown (helpful for the Stat block converter)

 

Schema

Link

{
	"$schema": "http://json-schema.org/draft-06/schema#",

	"title": "Entry",
	"id": "/Entry",
	"description": "A recursively renderable object.",
	"type": ["string", "integer", "object"],
	"version": "1.2.2",

	"definitions" : {
		"entry": {
			"properties": {
				"name": {
					"type": "string"
				},
				"type": {
					"type": "string"
				},
				"source": {
					"type": "string"
				},
				"data": {
					"type": "object"
				}
			},
			"required": [
				"type"
			]
		},

		"entrySection": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "section"},
						"name": {
							"type": "string"
						},
						"alias": {
							"type": "array",
							"items": {
								"type": "string"
							}
						},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						},
						"data": {
							"type": "object"
						}
					},
					"required": ["entries"],
					"additionalProperties": false
				}
			]
		},
		"entryEntries": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "entries"},
						"name": {
							"type": "string"
						},
						"alias": {
							"type": "array",
							"items": {
								"type": "string"
							}
						},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						},
						"data": {
							"type": "object"
						}
					},
					"required": ["entries"],
					"additionalProperties": false
				}
			]
		},
		"entryHomebrew": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "homebrew"},
						"name": {
							"type": "string"
						},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						},
						"movedTo": {
							"$ref": "/Entry"
						},
						"oldEntries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						},
						"data": {
							"type": "object"
						}
					},
					"additionalProperties": false
				}
			]
		},
		"entryQuote": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "quote"},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						},
						"by": {
							"type": "string"
						},
						"from": {
							"type": "string"
						}
					},
					"required": ["entries"],
					"additionalProperties": false
				}
			]
		},
		"entryInlineEntries": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "inline"},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						}
					},
					"required": ["entries"],
					"additionalProperties": false
				}
			]
		},
		"entryEntriesInlineEntries": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "inlineBlock"},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						}
					},
					"required": ["entries"],
					"additionalProperties": false
				}
			]
		},
		"entryOptions": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "options"},
						"name": {
							"type": "string"
						},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						}
					},
					"required": ["entries"],
					"additionalProperties": false
				}
			]
		},
		"entryTable": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "table"},
						"caption": {"type" : "string"},
						"style": {"type" : "string"},
						"colLabels": {
							"type": "array",
							"items": {"type" : "string"}
						},
						"colStyles": {
							"type": "array",
							"items": {"type" : "string"}
						},
						"rowLabels": {
							"type": "array",
							"items": {"type": "string"}
						},
						"rowStyles": {
							"type": "array",
							"items": {"type" : "string"}
						},
						"rows": {
							"type": "array",
							"items": {
								"oneOf" : [
									{
										"type": "array",
										"items": {
											"$ref": "/Entry"
										}
									},
									{
										"$ref": "#/definitions/entryTableRow"
									}
								]
							}
						},
						"footnotes": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						}
					},
					"required": ["rows"],
					"additionalProperties": false
				}
			]
		},
		"entryTableRow": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {
							"const": "row"
						},
						"style": {
							"type": "string"
						},
						"row": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						}
					},
					"required": [
						"row"
					],
					"additionalProperties": false
				}
			]
		},
		"entryTableCell": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {
							"const": "cell"
						},
						"width": {
							"type": "integer"
						},
						"roll": {
							"type": "object",
							"properties": {
								"oneOf": [
									{
										"min": {
											"type": "integer"
										},
										"max": {
											"type": "integer"
										}
									},
									{
										"exact": {
											"type": "integer"
										}
									}
								],
								"entry": {
									"$ref": "/Entry"
								},
								"pad": {
									"type": "boolean"
								}
							}
						},
						"entry": {
							"$ref": "/Entry"
						}
					},
					"additionalProperties": false
				}
			]
		},
		"entryList": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "list"},
						"style": {
							"type": "string"
						},
						"name": {
							"type": "string"
						},
						"items": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						}
					},
					"required": ["items"],
					"additionalProperties": false
				}
			]
		},
		"entryBonus": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "bonus"},
						"value": {
							"type": "integer"
						}
					},
					"required": ["value"],
					"additionalProperties": false
				}
			]
		},
		"entryBonusSpeed": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "bonusSpeed"},
						"value": {
							"type": "integer"
						}
					},
					"required": ["value"],
					"additionalProperties": false
				}
			]
		},
		"entryDice": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "dice"},
						"toRoll": {
							"type": "array",
							"items": {
								"type": "object",
								"properties": {
									"number": {
										"type": "integer"
									},
									"faces": {
										"type": "integer"
									},
									"modifier": {
										"description": "(Warning: unused)",
										"type": "integer"
									},
									"hideModifier": {
										"description": "(Warning: unused)",
										"type": "boolean"
									}
								},
								"required": ["number", "faces"]
							}
						},
                        "rollable": {
                            "type": "boolean"
                        }
					},
					"additionalProperties": false
				}
			]
		},
		"entryAbilityDc": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "abilityDc"},
						"name": {
							"type": "string"
						},
						"attributes": {
							"type": "array",
							"items": {
								"type": "string",
								"enum": ["str", "dex", "con", "int", "wis", "cha"]
							}
						}
					},
					"required": ["name", "attributes"],
					"additionalProperties": false
				}
			]
		},
		"entryAbilityAttackMod": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "abilityAttackMod"},
						"name": {
							"type": "string"
						},
						"attributes": {
							"type": "array",
							"items": {
								"type": "string",
								"enum": ["str", "dex", "con", "int", "wis", "cha"]
							}
						}
					},
					"required": ["name", "attributes"],
					"additionalProperties": false
				}
			]
		},
		"abilityGeneric": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "abilityGeneric"},
						"name": {
							"type": "string"
						},
						"text": {
							"type": "string"
						},
						"attributes": {
							"type": "array",
							"items": {
								"type": "string",
								"enum": ["str", "dex", "con", "int", "wis", "cha"]
							}
						}
					},
					"required": ["text"],
					"additionalProperties": false
				}
			]
		},
		"entryLink": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "link"},
						"text": {
							"type": "string"
						},
						"href": {
							"oneOf": [
								{
									"properties": {
										"type": {"const": "internal"},
										"path": {
											"type": "string"
										},
										"hash": {
											"type": "string"
										},
										"hashPreEncoded": {
											"type": "boolean"
										},
										"subhashes": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"key": {
														"type": "string"
													},
													"oneOf": [
														{
															"properties": {
																"value": {
																	"type": "string"
																}
															},
															"required": ["value"],
															"additionalProperties": false
														},
														{
															"properties": {
																"values": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	}
																}
															},
															"required": ["values"],
															"additionalProperties": false
														}
													]
												},
												"required": ["key"],
												"additionalProperties": false
											}
										},
										"hover": {
											"type": "object",
											"properties": {
												"page": {
													"type": "string"
												},
												"source": {
													"type": "string"
												}
											},
											"additionalProperties": false,
											"required": ["page", "source"]
										}
									},
									"required": ["path"],
									"additionalProperties": false
								},
								{
									"properties": {
										"type": {"const": "external"},
										"url": {
											"type": "string"
										}
									},
									"required": ["url"],
									"additionalProperties": false
								}
							]
						}
					},
					"required": ["text", "href"],
					"additionalProperties": false
				}
			]
		},
		"entryOptFeature": {
			"description": "For e.g. Eldritch Invocations which require prerequisite text",
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"name": {
							"type": "string"
						},
						"type": {"const": "optfeature"},
						"prerequisite": {
							"type": "string"
						}
					},
					"required": ["name"]
				}
			]
		},
		"entryPatron": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"name": {
							"type": "string"
						},
						"type": {"const": "patron"}
					},
					"required": ["name"]
				}
			]
		},
		"entryInset": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "inset"},
						"name": {
							"type": "string"
						},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						},
						"data": {
							"type": "object"
						}
					},
					"required": ["entries"],
					"additionalProperties": false
				}
			]
		},
		"entryInsetReadaloud": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "insetReadaloud"},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						}
					},
					"required": ["entries"]
				}
			]
		},
		"entryVariant": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "variant"},
						"name": {
							"type": "string"
						},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						},
						"variantSource": {
							"type": "object",
							"properties": {
								"source": {
									"type": "string"
								},
								"page": {
									"type": "integer"
								}
							},
							"required": ["source", "page"],
							"additionalProperties": false
						}
					},
					"required": ["name", "entries"]
				}
			]
		},
		"entryVariantSub": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "variantSub"},
						"name": {
							"type": "string"
						},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						}
					},
					"required": ["name", "entries"],
					"additionalProperties": false
				}
			]
		},
		"entryItem": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"oneOf": [
						{
							"properties": {
								"type": {"const": "item"},
								"name": {
									"type": "string"
								},
								"entry": {
									"$ref": "/Entry"
								}
							},
							"required": ["name", "entry"],
							"additionalProperties": false
						},
						{
							"properties": {
								"type": {"const": "item"},
								"name": {
									"type": "string"
								},
								"entries": {
									"type": "array",
									"items": {
										"$ref": "/Entry"
									}
								}
							},
							"required": ["name", "entries"],
							"additionalProperties": false
						}
					]
				}
			]
		},
		"entryItemSub": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "itemSub"},
						"name": {
							"type": "string"
						},
						"entry": {
							"$ref": "/Entry"
						}
					},
					"required": ["name", "entry"],
					"additionalProperties": false
				}
			]
		},
		"entryItemSpell": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "itemSpell"},
						"name": {
							"type": "string"
						},
						"entry": {
							"$ref": "/Entry"
						}
					},
					"required": ["name", "entry"],
					"additionalProperties": false
				}
			]
		},
		"entryImage": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "image"},
						"href": {
							"oneOf": [
								{
									"properties": {
										"type": {"const": "internal"},
										"path": {
											"type": "string"
										}
									},
									"required": ["path"],
									"additionalProperties": false
								},
								{
									"properties": {
										"type": {"const": "external"},
										"url": {
											"type": "string"
										}
									},
									"required": ["url"],
									"additionalProperties": false
								}
							]
						},
						"title": {
							"type": "string"
						},
						"imageType": {
							"type": "string",
							"enum": [
								"map"
							]
						}
					},
					"required": ["href"],
					"additionalProperties": false
				}
			]
		},
		"entryGallery": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "gallery"},
						"images": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/entryImage"
							}
						}
					},
					"required": ["images"],
					"additionalProperties": false
				}
			]
		},
		"entryActions": {
			"allOf" : [
				{
					"properties": {
						"type": {"const": "actions"},
						"name": {
							"type": "string"
						},
						"entries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						}
					},
					"required": ["type", "name", "entries"],
					"additionalProperties": false
				}
			]
		},
		"entryAttack": {
			"allOf" : [
				{"$ref" : "#/definitions/entry"},
				{
					"properties": {
						"type": {"const": "attack"},
						"attackType": {
							"type": "string",
							"enum": ["MW", "RW"]
						},
						"attackEntries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						},
						"hitEntries": {
							"type": "array",
							"items": {
								"$ref": "/Entry"
							}
						}
					},
					"required": [
						"type",
						"attackType",
						"attackEntries",
						"hitEntries"
					],
					"additionalProperties": false
				}
			]
		},
		"entryDataCreature": {
			"properties": {
				"type": {"const": "dataCreature"},
				"dataCreature": {
					"$ref" : "/Bestiary#/definitions/creature"
				}
			},
			"required": [
				"type",
				"dataCreature"
			]
		}
	},

	"anyOf": [
		{"$ref": "#/definitions/entrySection"},
		{"$ref": "#/definitions/entryEntries"},
		{"$ref": "#/definitions/entryHomebrew"},
		{"$ref": "#/definitions/entryQuote"},
		{"$ref": "#/definitions/entryInlineEntries"},
		{"$ref": "#/definitions/entryEntriesInlineEntries"},
		{"$ref": "#/definitions/entryOptions"},
		{"$ref": "#/definitions/entryTable"},
		{"$ref": "#/definitions/entryTableRow"},
		{"$ref": "#/definitions/entryTableCell"},
		{"$ref": "#/definitions/entryList"},
		{"$ref": "#/definitions/entryBonus"},
		{"$ref": "#/definitions/entryBonusSpeed"},
		{"$ref": "#/definitions/entryDice"},
		{"$ref": "#/definitions/entryAbilityDc"},
		{"$ref": "#/definitions/entryAbilityAttackMod"},
		{"$ref": "#/definitions/abilityGeneric"},
		{"$ref": "#/definitions/entryLink"},
		{"$ref": "#/definitions/entryOptFeature"},
		{"$ref": "#/definitions/entryPatron"},
		{"$ref": "#/definitions/entryInset"},
		{"$ref": "#/definitions/entryInsetReadaloud"},
		{"$ref": "#/definitions/entryVariant"},
		{"$ref": "#/definitions/entryVariantSub"},
		{"$ref": "#/definitions/entryItem"},
		{"$ref": "#/definitions/entryItemSub"},
		{"$ref": "#/definitions/entryItemSpell"},
		{"$ref": "#/definitions/entryImage"},
		{"$ref": "#/definitions/entryGallery"},
		{"$ref": "#/definitions/entryActions"},
		{"$ref": "#/definitions/entryAttack"},
		{"$ref": "#/definitions/entryAttack"},
		{"$ref": "#/definitions/entryDataCreature"},
		{"type": "string"},
		{"type": "integer"}
	]
}