
DamageSource Is Not Null
An attempt to fix "NullPointerException: LivingDeathEvent.getSource() is null"
About this Mod
❌ No More NPE — LivingDeathEvent.getSource() is null
Tired 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.
Limitation
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
Version 2.0.0+ significantly improves the internal safety guard and debugging tools.
Key improvements include:
- 🛠 Improved command tools for testing and diagnosing
DamageSourceissues - 🧱 Multiple loopholes closed in the original guard implementation
These 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.
🛡 What This Mod Does
This mod injects safety checks into:
LivingEntity#hurtLivingEntity#die
If a mod incorrectly triggers damage or death with a null DamageSource (which should never happen), this mod will:
- Prevent many common NullPointerException crashes
- Replace the invalid source with a fallback generic DamageSource
- Print detailed logs to help modpack authors locate the culprit
🚨 Why This Exists
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.
⚠ Important Notes
- ❗ This mod does not fix the broken mod — it only prevents crashes.
- ❗ This mod is a defensive mitigation mod, not a guaranteed universal fix.
- ⚠ If you see warnings in logs, you should still report them to the mod author.
- ✅ Safe to use on both client and dedicated servers.
- 🧩 Designed to be lightweight and compatible with large modpacks.
📦 Modpack Friendly
If you're a modpack author or server owner, this mod can help:
- Prevent unexpected downtime
- Avoid corrupted worlds
- Collect useful crash info without stopping gameplay
Think of it as a circuit breaker for bad damage events.
🧪 Environment
NeoForge
- 1.21.1
Forge
- 1.20.1
- 1.19.2
- 1.18.2
Fabric
- 1.20.1
📜 License
MIT License — free to use in any modpack.
Available Versions
How to Install DamageSource Is Not Null on Your Server
Order Server
Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).
Set forge Loader
In the panel under "Egg", select the forge loader and matching Minecraft version (1.21.1).
Install Mod
Open the mod browser in the dashboard and search for "DamageSource Is Not Null". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.
Compatibility
Mod Loaders
Minecraft Versions
1.21.1, 1.20.1
Server-side
✓ RequiredRecommended RAM
4 GB(min. 3 GB)Frequently Asked Questions
DamageSource Is Not Null server crashes on startup – what to do?
Most common cause: wrong forge version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.1). You can switch loaders with one click in the panel.
Is DamageSource Is Not Null compatible with forge and neoforge?
DamageSource Is Not Null officially supports forge, neoforge for Minecraft 1.21.1, 1.20.1. The Mado dashboard automatically detects incompatible loader combinations.
Server lagging with DamageSource Is Not Null – how to optimize performance?
Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if DamageSource Is Not Null consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.
Similar Mods
Rent Modded Server
Install DamageSource Is Not Null with just one click on your server.