DamageSource Is Not Null Plus
No reviews yet
An attempt to fix "NullPointerException: LivingDeathEvent.getSource() is null"
Addresses and fixes known bugs and issues.
Forge is a popular mod loader for versions 1.1+ of Minecraft.
Neoforge is a fork of the Minecraft Forge available for versions 1.20.1+ of Minecraft. Many Forge mods are compatible with Neoforge and vice versa.
Fabric is a mod loader for versions 1.14+ of Minecraft, particularly popular for client side and optimization mods.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
Compatibility
Supported Environments
Required on the server. Installing it on the client adds functionality.
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
🧩 DamageSource Is Not Null: Plus
Tired of crashes caused by mods passing a null DamageSource into Minecraft's damage or death pipeline?
DamageSource Is Not Null: Plus is the full compatibility-focused edition of DSNNULL. It requires the core protection layer from DSNNULL Basic and expands coverage to many third-party modded entities and custom damage paths.
If you are a normal player, server owner, or modpack author, this is the version you probably want.
What this mod does
This mod adds runtime guards to common damage and death paths so that many invalid DamageSource cases can be intercepted before they crash the game.
It can:
- prevent many common
NullPointerExceptioncrashes caused by invalid or nullDamageSource - replace invalid sources with a safe fallback source when possible
- add broader support for modded entities and third-party compatibility cases
- log useful diagnostic information to help identify the offending mod
Think of it as a runtime safety layer for broken damage events.
Project structure
The DSNNULL project is now split into two parts:
DSNNULL Basic
The core module. Provides the shared guard logic, fallback handling, and baseline vanilla-oriented protection.
DSNNULL Plus
The extended module. Builds on Basic and adds extra compatibility coverage for supported third-party mods and modded entities.
This split was made because maintaining both the core system and all modded-entity coverage inside a single package became increasingly difficult. Separating them makes the project easier to maintain, expand, and debug.
Dependency
DSNNULL Plus requires DSNNULL Basic.
Basic provides the core runtime logic. Plus provides the expanded compatibility coverage.
Why this exists
Vanilla Minecraft and mod loaders assume that DamageSource is never null.
However, some mods still trigger damage or death logic incorrectly and pass a null DamageSource, which can cause crashes such as:
LivingDeathEvent.getSource() is null
These crashes can:
- interrupt gameplay
- crash multiplayer servers
- create hard-to-debug modpack instability
- in some cases cause world or tick-related issues
This mod does not fix the broken mod itself. Instead, it acts as a defensive safeguard that reduces the impact of these errors at runtime.
Debug tools
This mod includes debugging tools to help locate missing coverage and vulnerable entities.
/dsnnull debug testall
This command performs a heuristic scan across registered living entities and attempts to identify entities that are still vulnerable to null DamageSource.
If some entities fail the scan, please report it on the issue tracker and attach latest.log so coverage can be expanded in future updates.
About 3.0.0 and transformer-based coverage
Since version 3.0.0, DSNNULL Plus uses a transformer-based approach to expand coverage automatically across a much wider range of classes and damage paths.
This significantly improves automatic patch coverage, especially for modded entities that would otherwise require many manual compatibility mixins.
However, because this also increases how broadly the mod interacts with the runtime, it may introduce compatibility risks in very large or complex modpacks.
If you're experiencing a start up crash and removing DSNNULL Plus makes the crash disappear, please submit the full latest.log to the issue tracker so the case can be investigated.
This is especially helpful for identifying unexpected transformer interactions and improving future compatibility.
Limitation
DamageSource Is Not Null: Plus is a defensive mitigation mod, not a guaranteed universal fix.
Because of how modded Minecraft works, it cannot guarantee protection in every possible case.
Some mods may still:
- bypass guarded paths
- override or replace core damage logic
- crash before this mod can intercept the issue
- require case-specific compatibility support that has not yet been added
This mod should be understood as a practical crash-reduction and diagnostics tool, not as a promise that all such crashes are solved.
Important notes
- This mod does not repair the original broken mod logic.
- It reduces crash risk by guarding common and supported modded damage paths.
- Since 3.0.0, broader transformer-based coverage also means broader compatibility surface.
- It is designed to be lightweight and modpack-friendly, but unusual mod interactions are still possible.
- It is safe to use on both client and dedicated server.
- If warnings appear in the log, the underlying mod issue should still be reported.
Environment
Forge
- 1.20.1
NeoForge
- 1.21.1
License
MIT License — free to use in any modpack.
Support
If you'd like to support my modding work, including maintenance, updates, and compatibility work, Patreon is available here:
❌ 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.
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers