Project E: Enchanted Books and Potions Fix

Preserves enchanted-book enchantments and potion contents in ProjectE transmutation, with configurable EMC pricing for supported missing variants.

Project E: Enchanted Books and Potions Fix

Keeps supported enchanted books and potion variants distinct in ProjectE transmutation knowledge, so learning and withdrawing them preserves their enchantments or potion contents. Higher-level and rarer book enchantments receive higher configurable EMC costs when there is no exact pack-defined price.

This is a separate ProjectE add-on for Minecraft 1.21.1 / NeoForge, not a replacement for ProjectE.

Features

  • Saves enchantment IDs and levels on enchanted books, including multiple enchantments and registered mod enchantments.
  • Saves registered potion contents and color on drinkable, splash, and lingering potions. Registered mod potions carried in those vanilla item types are supported.
  • Keeps existing exact ProjectE/pack-defined variant prices. Many vanilla potions already work through native mappings; their prices remain intact.
  • Adds configurable fallback prices for supported missing variants and supplies missing bare book/potion base prices without changing existing recipe calculations.
  • Honors discovered explicit zero-value exclusions and synchronizes that state to clients. Renaming a book or coloring a potion does not bypass a discovered exclusion.
  • Writes diagnostics to config/projecte-variant-fix/report.json and logs calculation failures.

Minecraft 1.21.1 stores this item data as data components. This add-on adds persistence only for enchanted-book stored enchantments and potion contents. It does not enable general NBT copying or add preservation for weapon enchantments, armour, containers, stored energy, equipment upgrades, or other item types. Existing ProjectE processors keep their normal behaviour.

Requirements and installation

  • Minecraft 1.21.1
  • NeoForge 21.1.250 or a compatible later 21.1 build
  • ProjectE 1.1.0 for Minecraft 1.21.1
  • Java 21

Install the jar in the mods folder of a backed-up test profile. It is enabled by default. For multiplayer, install the same jar on the server and every client. A client-only installation cannot change an existing server's transmutation rules. Project Expansion and Draconic Evolution are optional, not dependencies.

Learn the original enchanted books and potions again after installation. Already lost data cannot be reconstructed from a generic learned entry. Test withdrawal and save/restart behaviour before using a valuable world.

Configuration and pricing

Edit WORLD/serverconfig/projecte-variant-fix-server.toml while the world/server is stopped, then restart. NeoForge synchronizes the server configuration to clients.

For a book without an exact price, each enchantment adds:

ceil(commonEnchantmentBaseEmc × 10 / enchantment weight) × 2^(level - 1)

The surcharges add to the existing book base. The default common level-I unit is 8,192 EMC. Higher levels double that enchantment's surcharge; enchantment weight comes from its registered definition. Exact pack-defined variant prices take precedence.

For a supported potion without an exact price, the fallback adds a configurable effect cost to its container base. The default is 1,024 EMC per effect per minute, rounded up, doubled per amplifier. Instant effects use one time unit. Named potions with an existing canonical price keep it when only their color changes.

Only missing, non-excluded bare bases are supplied: enchanted book 64, potion 16, splash potion 64, lingering potion 256. Existing bases take precedence. These are configurable balance choices, not recipe-derived guarantees.

Leave ProjectE's Book-and-Potion-Variant-Fix processor enabled with persistence enabled. The add-on does not turn on ProjectE's general equipment enchantment processor or overwrite the owner's configuration. ProjectE's pregenerated mapping cache can bypass the mapper; allow a normal recalculation if diagnostics say variant pricing is not ready.

Safeguards and limitations

Command/custom-effect lists are disabled by default and can be enabled separately. Named registered mod potions do not need that option. Unknown modified components and unsupported excessive levels/effects are refused. Calculations use checked integer arithmetic, an EMC ceiling, and bounded graph inspection. If inspection fails, no missing base assignments are submitted and the native EMC mapping is not replaced with an empty result.

Only the four vanilla carrier item types above are supported. Arbitrary mod-specific potion items and enchanted equipment are outside this mod's scope. Custom names/lore are not added to newly learned fallback variants.

Balance is not guaranteed. Enchanting, brewing, disenchanting, and mod machines may create economy loops. Review configured prices before shared-server use. Removing the add-on can make ProjectE strip these learned variants again; keep a world backup for exact rollback.

Validation status — initial alpha

Compiled with the Gradle wrapper and Java 21; four pricing/overflow unit tests passed. In an isolated copy of the full content pack, 12 real variant samples passed native ProjectE learning and withdrawal checks using a controlled fake player. A fresh dedicated-server process retained the test player's learned variants and expected EMC balance. All 20,331 pre-existing stored mappings remained unchanged, and all 378 registered potion/container variants in that test pack retained their contents and had EMC.

Examples included Sharpness I/V, Mending, multiple book enchantments, a Project Expansion enchantment, and a previously unmapped Hybrid Aquatic potion. Coexistence with the separate Draconic EMC integration was checked.

A human GUI session and an actual multiplayer client connection remain untested. The exclusion packet codec was tested, but that is not a real network handshake. The full-pack test required a private helper for an unrelated ProjectE Integration 8.3.1 / Ice and Fire 2.1.3 adapter error; that helper is not included here, and this mod does not fix that third-party error.

Project E: Enchanted Books and Potions Fix Team

profile avatar
Owner
  • 4
    Projects
  • 755
    Downloads

D1 in Locked btw.

More from JZD