DamageSource Is Not Null Basic
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.
Explanation on the DamageSource Null Pointer Exception
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 and create issues that are hard to debug, as the stacktrace seldom includes the actual method that pass a null into damage handling pipeline. This mod provides a defensive layer to prevent such issue from causing crash, and it also catch the point where null is passed into the pipeline, so that the actual debugging could be easier.
Environment
- Forge - 1.20.1
- NeoForge - 1.21.1
Support
If you'd like to support my modding work, including maintenance, updates, and compatibility work, Patreon is available here:
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.21.1, 1.20.1
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on CurseForge — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
DamageSource Is Not Null Basic is a free Minecraft Java mod. Compatible with Minecraft 1.21.1, 1.20.1. Downloaded 63,545 times (via CurseForge). Download it and open it directly in the game.