![[ARCHIVED] Localized Written Books](https://cdn.metamods.net/images/mods/loc-written-books/screenshots/bookcomparison.png)
![[ARCHIVED] Localized Written Books](https://cdn.metamods.net/images/mods/loc-written-books/logo.png)
[ARCHIVED] Localized Written Books
This mod was merely an intermediate step toward creating a more comprehensive solution — Localizator. Consequently, development of this project has been completely discontinued, and it will no longer receive updates or bug fixes.
Instead of using this mod, it is recommended to install Localizator, which offers similar functionality but with extended capabilities and improved implementation.
This addon works on both server and client sides, utilizing Mixin technology to add support for locTitle and locAuthor NBT tags for written books.
Perfect Solution for Multi-language Modpacks
Have you ever wanted to add lore books and stories to your modpack but encountered language barriers for different players? This mod solves exactly that problem!
How It Works
Typically, modpack creators use standard tags to create books:
{pages:[{"text":
"Do not run but hide as they will come.\nHowls in the night, Dark red eyes... They will hunt...\nThey will grunt... Stay hidden, close the doors\nFootsteps on the nearby floors... It is too late\nThey found their prey..."
}],
title: "At Twilight",
author: "The Dark Witch",
display:{Lore:["Dark Omen"], ench:[{id:10,lvl:1}]}
Minecraft 1.12.2 supports the translate tag, allowing the use of language keys for each page. With this mixin, you can change the book data structure:
{pages:[{"translate": "book.dregorarl.AtTwilight.page.1"}],
locTitle: "book.dregorarl.AtTwilight.title",
locAuthor: "book.dregorarl.AtTwilight.author",
display:{LocLore:["book.dregorarl.AtTwilight.lore"], ench:[{id:10,lvl:1}]}
For the LocLore tag, the additional "Localized Lore" mixin is required.
Quick Start
To immediately test the functionality, use the command:
/give @p written_book 1 0 {pages:[{"translate":"book.locwrittenbooksmixin.Example.page.1"}],locTitle:"book.locwrittenbooksmixin.Example.title",locAuthor:"book.locwrittenbooksmixin.Example.author"}
Possible Tag Combinations
- "title" and "author"
- "title" and "locAuthor"
- "locTitle" and "author"
- "locTitle" and "locAuthor"
If both tags are set simultaneously ("title" AND "locTitle" or "author" AND "locAuthor"), priority is given to the localized versions. This is particularly useful for servers supporting both vanilla clients and clients with the mixin installed.
Tested with RLCraft — a complex modpack with numerous mods and mixins.
Important: Don't forget to add custom language files with your keys to the resources folder or Resource Pack!