
Bug Report: Crash due to null Capability interaction with Mekanism
NicoLemon232 opened this issue · 0 comments
Bug Report: Crash due to null Capability interaction with Mekanism
Minecraft version: 1.20.1
Forge version: 47.4.0
Footwork version: 4.3.9
Mekanism version: 10.4.15.75
Crash log:
[Include crash-2025-05-20_12.03.50-server.txt as attachment or paste the full stacktrace.]
Description:
The server crashes due to a NullPointerException during a LivingHurtEvent triggered by the Footwork mod. It seems to happen when interacting with a Mekanism-related capability.
Here’s the relevant part of the log:
php
Копировать
Редактировать
java.lang.NullPointerException: Cannot invoke "net.minecraftforge.common.capabilities.Capability.isRegistered()" because "capability" is null
at mekanism.common.capabilities.ItemCapabilityWrapper.getCapability(ItemCapabilityWrapper.java:43)
at jackiecrazy.footwork.handler.EntityHandler.pain(EntityHandler.java:119)
From what I can tell, ItemCapabilityWrapper.getCapability() in Mekanism is returning null, and EntityHandler.pain() in Footwork doesn't perform a null-check before calling isRegistered(). This leads to a hard crash when a player or mob takes damage.
Steps to reproduce:
Run a Forge 1.20.1 server with both Footwork and Mekanism installed.
Trigger combat between a player and a mob (or interact with items that may have Mekanism capabilities).
Server crashes during entity ticking.
Expected behavior:
The capability check in EntityHandler.pain() should verify that the capability is not null before calling methods on it.
Temporary workaround:
Removing Footwork or Mekanism prevents the crash.
Suggestions:
Please add a null check for the capability inside EntityHandler.pain() to prevent this crash.
Let me know if you need more logs or a minimal reproduction modpack. Thanks in advance!