DMZ Spellbooks Regen Fix
A companion compatibility and bug-fix addon for Dragon Mine Z, Iron's Spells 'n Spellbooks, and DMZ Spells: Ki is Mana on Minecraft Forge 1.20.1.
Why This Mod Exists
When playing with DMZ Spells: Ki is Mana, Max Mana bonuses from Iron's Spells equipment expand your energy pool beyond your native Ki capacity. Without compensation, Dragon Mine Z Ki charging slows down, Mana Regeneration gear does not boost Ki recovery, precision clamping in MagicManager can pull energy downward, positive mana gains (such as Mana Potions) are discarded, and respawning can wipe your Ki back to 0.
In addition, several integration mechanics in DMZ Spells: Ki is Mana fail or behave inconsistently in production Forge environments—including Counterspell failing to target Ki projectiles, Fortify leaving permanent/stacking absorption hearts, continuous spells checking unscaled mana costs, excludedSpellIds not being enforced, Mojmap-only attribute reflection failing under SRG names, and linear Spell Resist / Cooldown / Cast Time Reduction reaching 100% immunity or 1-tick casts.
DMZ Spellbooks Regen Fix resolves these regeneration, synchronization, and gameplay bugs cleanly at runtime without modifying the original mod files.
Features
Ki & Mana Regeneration / Sync
- Active Ki Charging Compensation: Scales Dragon Mine Z active Ki charging by your
(currentMaxEnergy / nativeMaxKi)ratio (capped at20.0×by default, configurable up to1000.0×) so Max Mana gear never slows down Ki charging. Passive standing-still regeneration stays at normal Dragon Mine Z values by default (optionally toggleable). - Mana Regeneration Synergy: Applies Iron's Spells' Mana Regeneration attribute (from mage armor, curios, enchantments, and effects) to boost active Ki charging, with debuffs floored at
minManaRegenFactor(default0.25×). - Floating-Point Mana Precision Fix: Prevents
MagicManagerinteger truncation/clamping from pulling your DMZ Current Energy downward on periodic regen ticks. - Positive Mana Grants: Allows external positive Iron's Spells mana sources (such as Mana Potions, Instant Mana, Gluttony, and Soul Siphon) to add directly into your DMZ Current Energy instead of being discarded.
- Respawn Ki Protection: Prevents Iron's Spells' respawn handler (
manaSpawnPercent = 0) from wiping refilled DMZ Ki back to0. - Optional Percentage Charging Bonus: Includes an optional config setting to add extra
% Max Energy per secondwhile actively charging Ki (disabled by default at0.0).
DMZ Spellbooks Gameplay Bug Fixes
- Counterspell vs. Ki Projectiles & Charging Players: Allows Iron's Spells Counterspell raycasts (
Utils.validAntiMagicTarget) to hit DMZAbstractKiProjectileentities so Counterspell properly cancels incoming Ki blasts, and interrupts players who are actively charging a Ki attack. - Fortify Absorption Leak Fix: Tracks the Ki-scaled bonus absorption added by DMZ Spellbooks on Fortify and removes it cleanly when Fortify expires, is removed, or is recast—fixing permanent and infinitely stacking golden hearts.
- Continuous Spell Mana Check Fix: Uses the Ki-scaled mana cost inside
MagicManagercontinuous-cast tick checks so channeled spells (Flamethrower, Electrocute, Ray of Frost, etc.) drain consistently and do not stop prematurely. - Improved Spell & Addon Detection: Extends DMZ Spellbooks' spell capability detection with 1-hop payload entity/effect inspection (improving compatibility with Iron's Spells addons such as T.O Magic 'n Extras) and fixes false-positive exclusions like Soulfire Ray.
excludedSpellIdsEnforcement: Properly enforcesintegration.excludedSpellIdsfromdmz_spellbooks-common.tomlacross spell damage, healing, summons, tooltips, and mana cost scaling.- SRG-Safe
ki_damageDefault Patch: Fixes DMZ Spellbooks' Mojmap-only reflection (defaultValue) onAttributeby supporting SRG (f_22076_) in production Forge. - Official Soft Cap Scaling: Applies Iron's Spells' official
Utils.softCapFormulato Spell Resist against DMZ Ki blasts and to Cast Time Reduction / Cooldown Reduction on DMZ techniques, preventing 100% Ki immunity or 1-tick technique spam. - Preserve Prior Damage Modifiers: Reads
SpellDamageEvent.getAmount()instead ofgetOriginalAmount()so earlier buffs, crits, and modifiers from other mods are preserved. - Extended Active Cast Matching Window: Expands DMZ Spellbooks' active cast matching window from
5ticks (0.25s) to40ticks (2.0s) by default so delayed heals, barriers, Fortify, and summons reliably match their caster.
Configuration
A config file is automatically generated on launch at:
config/dmz_spellbooks_regen_fix-common.toml
Every feature can be tuned or toggled independently:
[KiRegenCompensation]compensateMaxManaWhileCharging(default:true)compensateMaxManaPassively(default:false)maxInflationRatioCap(default:20.0)
[ManaRegenAttribute]applyManaRegenWhileCharging(default:true)applyManaRegenPassively(default:false)manaRegenAttributeWeight(default:1.0)minManaRegenFactor(default:0.25)extraPercentMaxEnergyPerSecondWhenCharging(default:0.0)
[IronsManaSyncFixes]fixMagicManagerIntTruncationClamp(default:true)allowPositiveManaGrantsToKi(default:true)forwardMagicManagerRegenToKi(default:false)preventRespawnKiWipe(default:true)
[DmzSpellbooksBugFixes]fixCounterspellVsKiProjectiles(default:true)counterspellInterruptsChargingKiPlayer(default:true)fixFortifyPermanentAbsorption(default:true)fixContinuousSpellManaCheck(default:true)fixSpellCapabilityDetection(default:true)enforceExcludedSpellIds(default:true)fixKiDamageDefaultAttributePatch(default:true)applySoftCapToKiSpellResist(default:true)applySoftCapToTechniqueTiming(default:true)preservePriorSpellDamageModifiers(default:true)activeCastWindowTicks(default:40)
Requirements
- Minecraft:
1.20.1 - Forge:
47+ - Dragon Mine Z:
2.1.2+ - Iron's Spells 'n Spellbooks:
1.20.1-3.16.4+ - DMZ Spells: Ki is Mana:
1.0.0+
Modpacks & Servers
This mod uses standard Forge events and non-invasive Mixins, has zero extra dependencies, and is 100% dedicated-server safe. Install on both client and server (required on the server/singleplayer host for Ki, Mana, and spell synchronization fixes). Free to include in modpacks.