Trainer's Handbook pages
The in-game Trainer's Handbook is a client resource. Each JSON file under
assets/<namespace>/books/ in a resource pack (or a mod's own assets) defines one
category — it does not belong in a server datapack. Fabric and NeoForge clients
load the same files.
{
"id": "02_getting_started",
"name": "book.brecher_trainers.category.getting_started",
"icon": "minecraft:book",
"pages": [
{
"type": "text",
"title": "book.brecher_trainers.start.requirements.title",
"body": "book.brecher_trainers.start.requirements.body"
}
]
}
Category IDs must be unique and non-blank. Categories are sorted
lexicographically by ID; the numeric prefixes in the bundled files define their
normal chapter order. Pages keep their array order. A table_of_contents page may
provide a categories array, which is rendered in that exact order. Missing and
repeated IDs are omitted and logged.
Page types
text: optionaltitletranslation key and required non-blankbodykey.item_showcase: optionaltitleanddescriptionkeys plus a non-emptyitemsarray of item resource locations.crafting_hint: optionaltitleanddescriptionkeys, aresultitem, and a non-emptyingredientsarray. This is a compact hint, not a shaped-recipe replacement; keep it synchronized with the real recipe.image: optionaltitleandcaptionkeys plus animageresource location. Bundled handbook images are 114 by 100 PNG files undertextures/gui/book/; matching that logical size avoids resource-pack scaling surprises.table_of_contents: optionaltitleandcategories.
Unknown page types display the handbook's unsupported-page fallback.
Reading and reloading
Long text pages scroll with the mouse wheel or the Up/Down keys; at the top or bottom, the same wheel gesture resumes normal page navigation. Previous/next arrows, Page Up/Page Down, Home and End provide linear keyboard navigation. Page titles and content are also exposed to the narrator.
Reload publication is atomic: readers see either the old or the new handbook. Invalid categories are skipped with a warning. If a non-empty reload contains no valid category at all, the last working handbook is retained; an actually empty resource set clears it.
Checklist for new pages
- Add every displayed string to your pack's language file (e.g.
en_us.json). - Check image and item resource locations, category references, and the actual recipes or commands described by the text.
- Open the handbook on both loaders and check long text, tooltips, resizing, keyboard navigation, and narration.