Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions lavender-book.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Lavender Book",
"$defs": {
"book": {
"type": "object",
"properties": {
"texture": {
"title": "Texture",
"description": "This is used to decide which texture to use for the GUI of your book. There are some built into Lavender following the lavender:textures/gui/<color>_book.png template",
"$ref": "lavender-common.json#/$defs/identifier"
},
"extend": {
"title": "Extend",
"description": "Should you be adding content to another mod with a Lavender guidebook, you can set this property to extend the original mod's book with your own entries and categories. To read more on how this works, look at the respective article",
"$ref": "lavender-common.json#/$defs/identifier"
},
"dynamic_book_model": {
"title": "Dynamic Book Model",
"description": "Lavender has a built-in book, the dynamic book, which uses NBT data to emulate any book currently loaded into the game. This is primarily of interest if you are a modpack developer and thus cannot register your own book item through Lavender's API. You can set this property to another item model's ID (e.g. mymodpack:my_book_model -> assets/mymodpack/models/item/my_book_model.json) to make the dynamic book use said model when it is emulating your book",
"$ref": "lavender-common.json#/$defs/identifier"
},
"dynamic_book_name": {
"title": "Dynamic Book Name",
"description": "The name the dynamic book should display when it is set to emulate your book. This property expects a Minecraft text object (which can also be just a plain string)",
"$ref": "lavender-common.json#/$defs/text"
},
"open_sound": {
"title": "Open Sound",
"description": "The sound played when the book is opened",
"$ref": "lavender-common.json#/$defs/identifier"
},
"flipping_sound": {
"title": "Flipping Sound",
"description": "The sound played when the page is flipped",
"$ref": "lavender-common.json#/$defs/identifier"
},
"intro_entry": {
"title": "Intro Entry",
"description": "The introduction entry shown when the book is first opened",
"$ref": "lavender-common.json#/$defs/identifier"
},
"display_completion": {
"title": "Display Completion",
"description": "If some or all entries of your book are locked behind advancements, you can set this to true to make the book display a completion bar on the main index page and separately for each category",
"type": "boolean",
"default": false
},
"display_unread_entry_notifications": {
"title": "Display Unread Entry Notifications",
"description": "If unread entry notifications should be shown",
"type": "boolean",
"default": true
},
"macros": {
"title": "Macros",
"description": "The macros to be applied when processing the page contents",
"$ref": "#/$defs/macros"
}
}
},
"macros": {
"type": "object",
"additionalProperties": true
}
},
"$ref": "#/$defs/book"
}
41 changes: 41 additions & 0 deletions lavender-category.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Lavender Category",
"$defs": {
"category": {
"type": "object",
"properties": {
"parent": {
"title": "Parent",
"description": "The parent of this category",
"$ref": "lavender-common.json#/$defs/identifier_or_partial"
},
"title": {
"title": "Title",
"description": "The title of this category, to be displayed at the top of its landing page",
"$ref": "lavender-common.json#/$defs/text"
},
"icon": {
"title": "Icon",
"description": "An item to use as this category's icon in the index (optionally including NBT)",
"$ref": "lavender-common.json#/$defs/itemstack"
},
"secret": {
"title": "Secret",
"description": "If all entries in this category are currently locked or invisible to the player, don't show it all instead of simply displaying it as locked",
"type": "boolean",
"default": false
},
"ordinal": {
"title": "Ordinal",
"description": "A sorting index for this category, displayed in ascending order. Categories with no ordinal are displayed last",
"type": "number"
}
},
"required": [
"title"
]
}
},
"$ref": "#/$defs/category"
}
51 changes: 51 additions & 0 deletions lavender-common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Lavender Common Definitions",
"$defs": {
"partial_identifier": {
"title": "Partial Identifier",
"description": "A partial identifier",
"type": "string",
"pattern": "^[a-z0-9/\\._-]+$"
},
"identifier": {
"title": "Identifier",
"description": "An identifier",
"type": "string",
"pattern": "^[a-z0-9_\\.-]+:[a-z0-9/\\._-]+$"
},
"identifier_or_partial": {
"title": "Identifier or Partial Identifier",
"description": "Either an identifier or a partial identifier",
"anyOf": [
{ "$ref": "#/$defs/partial_identifier" },
{ "$ref": "#/$defs/identifier" }
]
},
"text": {
"title": "Text",
"description": "A Minecraft text object",
"type": "string"
},
"tag": {
"title": "Tag",
"description": "A Minecraft tag",
"type": "string",
"pattern": "^#([a-z0-9_\\.-]+:)?[a-z0-9/\\._-]+$"
},
"itemstack": {
"title": "Item Stack",
"description": "A Minecraft item stack with optional nbt",
"type": "string",
"pattern": "^[a-z0-9_\\.-]+:[a-z0-9/\\._-]+(\\{.*\\})?$"
},
"itemstacks": {
"title": "Item Stacks",
"description": "Either a Minecraft item stack or a Minecraft tag",
"anyOf": [
{ "$ref": "#/$defs/itemstack" },
{ "$ref": "#/$defs/tag" }
]
}
}
}
58 changes: 58 additions & 0 deletions lavender-entry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Lavender Entry",
"$defs": {
"entry": {
"properties": {
"category": {
"title": "Category",
"description": "The category this entry belongs to",
"$ref": "lavender-common.json#/$defs/identifier_or_partial"
},
"title": {
"title": "Title",
"description": "The title of this entry, to be displayed in the entry index and at top of the first page",
"$ref": "lavender-common.json#/$defs/text"
},
"icon": {
"title": "Icon",
"description": "An item to use as this entry's icon in the index (optionally including NBT)",
"$ref": "lavender-common.json#/$defs/itemstack"
},
"secret": {
"title": "Secret",
"description": "If this entry is locked due to a missing advancement, don't show it to the player at all instead of simply displaying it as locked",
"type": "boolean",
"default": false
},
"ordinal": {
"title": "Ordinal",
"description": "A sorting index for this entry, displayed in ascending order. Entries with no ordinal are displayed last",
"type": "number"
},
"associated_items": {
"title": "Associated Items",
"description": "A list of item (with optional NBT) which should link to this entry in their tooltip and, if the respective item is a block item, when looking at said block while holding the book",
"type": "array",
"items": {
"$ref": "lavender-common.json#/$defs/itemstacks"
},
"default": [ ]
},
"required_advancements": {
"title": "Required Advancements",
"description": "A list of advancement IDs which the player must have completed before they can view this entry. If display_completion is true in the book definition, a progress bar will indicate to the player how many entries they have unlocked/left to go",
"type": "array",
"items": {
"$ref": "lavender-common.json#/$defs/identifier"
},
"default": [ ]
}
},
"required": [
"title"
]
}
},
"$ref": "#/$defs/entry"
}