RPG Lore
RPG Lore: Save Format
MC 1.20.1Forge~3 min read
On this page (9)
RPG Lore persists server-side tracking data into two SavedData .dat files inside the overworld’s data/ folder, plus lightweight NBT tags on physical items. All access runs on the server main thread.
Codex save file (data/rpg_lore_codex.dat)
Stores per-player Codex collections, spare banks, read/favorite status, discovery times, preferences, and soul-bound death stashes.
Root NBT tags
| Tag | Type | Description |
|---|---|---|
version |
Int |
Save format version (currently 2; informational on load) |
players |
Compound |
Map of player UUID string -> player state compound |
Per-player tags (players.<uuid>)
| Key | Type | Meaning |
|---|---|---|
collected |
List<String> |
Book IDs permanently unlocked in the player’s Codex |
copies |
Compound |
Banked spare copies per book ID ( <book_id> -> Int, capped at 99) |
read |
List<String> |
Collected book IDs the player has opened at least once |
favorites |
List<String> |
Collected book IDs starred as favorites |
discovered |
Compound |
World gameTime (Long) when each book was first collected (0 / absent if unknown) |
prevent_duplicates |
Byte (Boolean) |
true = leave duplicate books on the ground; false = absorb as spare copies |
has_codex |
Byte (Boolean) |
true once the player has received their first-join Codex grant |
pending_codex |
Compound (optional) |
Present while a soul-bound Codex is stashed between death and respawn/login. Holds stack (ItemStack compound) plus optional curio_slot (String) and curio_index (Int) |
Invariants and v1 migration
read,favorites, anddiscoveredonly contain book IDs present incollected.- Removing a book (
/rpglore codex remove) or pruning stale/excluded books after reload retains/clears across all five per-book structures simultaneously. - Version 1 -> Version 2 migration: Automatic per player on load. If the
readlist tag is missing (saves from RPG Lore2.1.x),readis initialized as a copy ofcollectedso returning players are not flooded with unread indicators. Missingfavoritesanddiscoveredtags default to empty.
Per-player copy limit file (data/rpg_lore_tracking.dat)
Tracks how many times each player has received a specific book via:
- Mob drops with
max_copies_per_player >= 0 /rpglore give <targets> <book_id> true- Advancement rules with
"delivery": "inventory"(enforces cap1)
Root & per-player NBT tags
| Path | Type | Description |
|---|---|---|
players |
Compound |
Map of player UUID string -> book counts compound |
players.<uuid>.<book_id> |
Int |
Total tracked deliveries of <book_id> to that player |
On world start and after reloads (/rpglore reload or /reload), entries for book IDs no longer present in LoreBookRegistry.getAllBookIds() are pruned, and empty player records are removed.
Item NBT tags
Lore Codex (rpg_lore:lore_codex)
LoreCodexItem caches lightweight display fields in item NBT (kept synced by CodexService):
| Tag | Type | Description |
|---|---|---|
codex_collected_count |
Int |
Count of collected books that are still Codex-eligible |
codex_total_count |
Int |
Total number of Codex-eligible books currently loaded |
codex_prevent_duplicates |
Byte (Boolean) |
Cached duplicate-handling flag for item tooltip display |
Lore Book (rpg_lore:lore_book)
| Tag | Type | Description |
|---|---|---|
lore_id |
String |
Book registry ID (required for Codex auto-collection on pickup) |
title |
String |
Book title |
author |
String |
Author name |
generation |
Int |
0–3 (incremented on spare copy extraction, capped at 3) |
resolved |
Byte |
1 (vanilla written-book resolution marker) |
pages |
List<String> |
JSON text component strings (required to open the reader) |
lore_title_color |
String (optional) |
6-char hex color |
lore_author_color |
String (optional) |
6-char hex color |
lore_description |
String (optional) |
Tooltip description text |
lore_description_color |
String (optional) |
6-char hex color |
lore_hide_generation |
Byte (optional) |
true hides the generation tooltip line |
lore_show_glint |
Byte |
Controls item enchantment glint ( true by default when NBT exists) |
lore_category |
String (optional) |
Book category |
lore_codex_exclude |
Byte (optional) |
true skips Codex auto-collection on pickup |