How Books was built
Raw game files read
config/lore/*.jsonworldgen/schematics/**/*.json (ItemCodes + BlockEntities, to find where each book is placed)
Processing
Each config/lore/<code>.json file is just a title lang-key reference and an
ordered array of "piece" lang-key references -- the real prose lives in the lang file itself, not
inline in these files, resolved the same way every other display string is (including
mod-domain-prefixed keys like betterruins:lore-brickworkerslament-title). The game's
own ___NEWPAGE___ marker inside a piece's text splits it into multiple book pages.
Where a book can be found is read from the schematics of every structure that references them
(models/loreLocations.ts), using three signals:
- bookshelf — a
clutteredbookshelfwithloreblock entity'sloreCodenames a lore section; any book in that section can come off the shelf. - placed — a container or ground-storage block entity already holding a specific lore book stores its
discoveryCode, which is that book's owncode. - random loot — a
stackrandomizer-<code or section>entry in the schematic'sItemCodes(BetterRuins adds one per text) can roll into a container.
The block-entity values are matched by pattern over the raw decoded bytes (a pattern match was kept from before the attribute-tree parser modelled item stacks). This shows where the game can place a book, not a drop chance.