Cataclysm: Spellbooks

Cataclysm: Spellbooks

199k Downloads

Crash on entity death due to null DamageSource in onLivingDeathEvent (v1.1.6 - Minecraft 1.21.1)

Closed this issue ยท 2 comments

commented

๐Ÿ› Bug Report

My dedicated server is crashing when an entity dies due to a NullPointerException in the onLivingDeathEvent method from cataclysm_spellbooks.

๐Ÿ” Crash Details

Crash message:
java.lang.NullPointerException: Cannot invoke "net.minecraft.world.damagesource.DamageSource.is(net.minecraft.tags.TagKey)" because "damageSource" is null at net.acetheeldritchking.cataclysm_spellbooks.events.ServerEvents.onLivingDeathEvent(ServerEvents.java:355)

Mod version: cataclysm_spellbooks-1.1.6-1.21
Minecraft version: 1.21.1
Forge/NeoForge version: NeoForge 21.1.145
Other relevant mods: irons_spellbooks, cobblemon, twilightforest, mynethersdelight

๐Ÿงช Reproduction

The crash seems to happen:

  • When casting the spell TectonicTrembleSpell from Cataclysm Spellbooks
  • And a mob dies to an unusual damage source (possibly custom ones from other mods)

๐Ÿ“‹ Additional Info

It looks like the mod is not checking whether damageSource is null before calling .is(...), which causes the crash.

Suggested fix:
Add a null check to onLivingDeathEvent before interacting with the damageSource.

๐Ÿ“Ž Crash Log

You can view the crash log here:
https://pastebin.com/FEGpPtHD

Let me know if youโ€™d like a test world or modpack to reproduce it. Thanks for your awesome work on the mod!

commented

I also just had a player cause a crash on my server with the same error message, still trying to figure out what spell might have been cast. But I can not replicate it with Tectonic Tremble in singleplayer, neither with the scroll nor the Flambege. Here's my log in case that helps.

crash-2025-08-01_20.46.43-server.txt

commented

We can't really tell if it's a specific spell, or any spell, or something else related to Cataclysm Spellbooks, but it keeps crashing my server every now and then. It's always the same error message java.lang.NullPointerException: Cannot invoke "net.minecraft.world.damagesource.DamageSource.is(net.minecraft.tags.TagKey)" because "damageSource" is null