LivingDeathEvent.getSource() is nullTired of crashes caused by mods passing a null DamageSource into Minecraft's damage or death pipeline?
It adds runtime guards to several common damage/death paths so that many invalid DamageSource cases can be caught before they crash the game. It can also log useful information to help identify the offending mod.
DamageSource Is Not Null is a defensive mitigation mod, not a guaranteed universal fix.
However, due to the nature of modded Minecraft, it cannot guarantee protection in every case. Some mods may bypass the guarded paths, override core methods, or crash earlier than this mod can intercept.
This mod is best understood as a safety layer that reduces crash risk and improves diagnostics — not as a promise that all such crashes are solved.
Version 2.0.0+ significantly improves the internal safety guard and debugging tools.
Key improvements include:
DamageSource issuesThese changes make the protection more reliable in large modpacks and help modpack authors locate problematic mods more easily.
⚠ Upgrading to 2.0.0 is strongly recommended.
Currently, 2.0.0 is only on 1.20.1 Forge. The improvements introduced in 2.0.0 will be gradually backported to other supported versions (Forge, Fabric, and additional Minecraft versions) over time.
This mod injects safety checks into:
LivingEntity#hurtLivingEntity#dieIf a mod incorrectly triggers damage or death with a null DamageSource (which should never happen), this mod will:
While vanilla and NeoForge expect DamageSource to never be null,
some mods still trigger events incorrectly and crash the entire game.
Normally, this results in errors like:
LivingDeathEvent.getSource() is null
Which kills servers and interrupt gameplay for reasons outside the player's control.
This mod acts as a runtime safety net for such situations.
If you're a modpack author or server owner, this mod can help:
Think of it as a circuit breaker for bad damage events.
MIT License — free to use in any modpack.