RPG Lore: Compatibility
On this page (8)
Curios API (optional)
Curios API ([5,), tested against 5.4.7+1.20.1) is an optional soft dependency on both client and server:
- Dedicated
Codexslot: RPG Lore registers a singlecodexCurios slot (size: 1) onminecraft:playerwith an empty-slot icon (rpg_lore:slot/empty_codex_slot) and attaches theICuriocapability torpg_lore:lore_codexviadata/curios/tags/items/codex.json. - Full feature parity: Auto-collection on pickup, the Open Lore Codex keybind, and first-join/existing-Codex checks all detect a Codex equipped in a Curios slot.
- Soul-bound Curios restoration: When
codex.soulbound = trueandkeepInventoryisfalse, a Codex worn in a Curios slot is stashed with its exactcurio_slotidentifier and slot index on death and returned to that slot on respawn (falling back to another empty slot of that type, or inventory if full). - Without Curios installed: All
CuriosCompatcalls are guarded behindModList.get().isLoaded("curios"); the mod works identically using inventory slots.
Vanilla blocks and tags
- Chiseled Bookshelves:
data/minecraft/tags/items/bookshelf_books.jsonincludes bothrpg_lore:lore_bookandrpg_lore:lore_codex. - Lecterns: Vanilla’s
LecternBlockhardcodeswritten_bookandwritable_book, soLoreBookLecternHandlerhandles right-clicking empty lecterns with aLore BookorLore Codexin the main hand.- A
Lore Bookon a lectern opens vanilla’s lectern book reader and drives comparator output naturally. - A
Lore Codexon a lectern opens the interacting player’s own synced Codex browser rather than vanilla’s empty-book UI.
- A
Multiplayer and networking
- Both sides required: RPG Lore uses Forge
SimpleChannel(rpg_lore:main) withPROTOCOL_VERSION = "3"enforced symmetrically. Clients and servers must both install RPG Lore2.2.1(matching protocol3). - Server-authoritative Codex state: Collection state, read flags, favorites, discovery timestamps, spare banks, and duplicate mode live in server
SavedData(data/rpg_lore_codex.dat). Clients cannot forge acquisitions or read hidden book names whencodex.revealUncollectedNames = false(redacted entries omittitle,author,tags, andserieson the wire). - Revision-based sync: The full Codex catalog is only resent when the registry revision changes (after
/rpglore reloador/reloadmodifies definitions) or when a hidden entry flips to collected. Normal read/favorite/spare updates send only the compact player-state packet.
Localization
RPG Lore ships 60 language files under assets/rpg_lore/lang/, covering all item names, Codex controls, ribbon labels, Curios slot names, tooltips, keybinds, and /rpglore command responses.
Existing worlds and mod removal
- Adding to an existing world: Safe at any time. Existing players receive a Lore Codex on their next login if
codex.grantOnFirstJoin = true, and saves from RPG Lore2.1.xautomatically migrate to save format v2 on load (marking pre-2.2.0 entries as read). - Removing from a world: Removing the JAR removes
rpg_lore:lore_bookandrpg_lore:lore_codexitems; world chunks and vanilla lecterns/bookshelves remain valid. World filesdata/rpg_lore_codex.datanddata/rpg_lore_tracking.datremain harmlessly in<world>/data/. Back up your world before removing any content mod.
Public API for mod developers
Other mods can grant lore books into a player’s Codex or react when books are collected for the first time. All calls must run on the server main thread.
Granting a book (LoreAcquisitionService)
import com.rpglore.acquisition.LoreAcquisitionService;
import com.rpglore.acquisition.LoreAcquisitionService.CollectResult;
import com.rpglore.acquisition.LoreAcquisitionService.LoreAcquisitionSource;
import net.minecraft.server.level.ServerPlayer;
CollectResult result = LoreAcquisitionService.collect(
player,
"rpg_lore:the_fallen_kingdom",
LoreAcquisitionSource.API
);
CollectResult returns one of:
NEWLY_COLLECTED— book entered the Codex for the first time andLoreCollectedEventwas firedALREADY_COLLECTED— player already had this entry (no change)NOT_FOUND— no loaded definition matchesloreIdEXCLUDED— book has"codex_exclude": trueCODEX_DISABLED—codex.enabledisfalseor server tracking is unavailable
Available LoreAcquisitionSource values: ENTITY_DROP, LOOT_TABLE, ADVANCEMENT, PICKUP, COMMAND, API.
Listening for collections (LoreCollectedEvent)
LoreCollectedEvent fires on the Forge event bus (MinecraftForge.EVENT_BUS), server-side only, immediately after a book is added for the first time (not cancelable; duplicates and no-ops do not fire it):
import com.rpglore.acquisition.LoreCollectedEvent;
import com.rpglore.acquisition.LoreAcquisitionService.LoreAcquisitionSource;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@Mod.EventBusSubscriber(modid = "your_mod_id")
public class LoreEvents {
@SubscribeEvent
public static void onLoreCollected(LoreCollectedEvent event) {
ServerPlayer player = event.getPlayer();
ResourceLocation loreId = event.getLoreId();
LoreAcquisitionSource source = event.getSource();
// Grant rewards, trigger quests, etc.
}
}