AEA TNT Crash Fix is a tiny Fabric compatibility patch for Minecraft 26.1.2.
It prevents a crash caused by Additional Entity Attributes when TNT, beds, respawn anchors, or other explosions break blocks that try to drop experience without a valid player breaker.
This mod does not change TNT behavior, does not disable explosions, and does not fake player ownership. It only prevents one specific null-player XP modifier crash and keeps the vanilla XP amount.
On some Fabric 26.1.2 instances with Origins/Apoli/Additional Entity Attributes, TNT explosions in the Nether can crash the game/server with a stack trace like this:
Description: Ticking entity
java.lang.NullPointerException: Cannot invoke "java.lang.ref.WeakReference.get()" because "this.additionalEntityAttributes$breakingPlayer" is null
at net.minecraft.world.level.block.Block.modify$zzb000$additionalentityattributes$additionalEntityAttributes$modifyExperience(Block.java:730)
at net.minecraft.world.level.block.Block.popExperience(Block.java:471)
at net.minecraft.world.level.block.Block.tryDropExperience(Block.java:644)
at net.minecraft.world.level.block.DropExperienceBlock.spawnAfterBreak(DropExperienceBlock.java:34)
at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.spawnAfterBreak(BlockBehaviour.java:1172)
at net.minecraft.world.level.block.BlockBehaviour.onExplosionHit(BlockBehaviour.java:204)
at net.minecraft.world.level.ServerExplosion.interactWithBlocks(ServerExplosion.java:226)
at net.minecraft.world.level.ServerExplosion.explode(ServerExplosion.java:251)
at net.minecraft.world.entity.item.PrimedTnt.explode(PrimedTnt.java:142)
at net.minecraft.world.entity.item.PrimedTnt.tick(PrimedTnt.java:130)
The ticking entity is usually minecraft:tnt, but the underlying problem can also happen with other explosion sources if they break XP-dropping blocks without a normal player mining action.
Additional Entity Attributes adds player-based XP drop modifiers. Internally, it stores the player who broke a block in a field similar to:
WeakReference<Player> breakingPlayer;
That works for normal mining, because a real player is breaking the block.
Explosions are different:
breakingPlayer can be null..get() on that null reference.AEA TNT Crash Fix adds a small Mixin guard around the Additional Entity Attributes block XP modification method.
If AEA has no valid breakingPlayer, this mod returns the original XP value instead of letting the game crash.
In plain English:
No breaking player -> no player-based XP modifier -> vanilla XP amount
The intended fallback is vanilla behavior. If there is no player breaker, there is no honest player to apply player-based XP bonuses or penalties to.
This mod does not:
The fix is deliberately narrow: it only handles the missing breakingPlayer case in the Additional Entity Attributes XP modifier.
If you run a multiplayer server, install this mod on the server.
Players do not need to install it.
The mod does not add blocks, items, entities, packets, commands, or registries that clients need to know about. It only patches server-side XP drop logic.
For singleplayer, install this mod in the client instance.
Singleplayer uses an integrated server inside the client process, so the patch must be loaded by the client to fix singleplayer worlds.
| Use case | Where to install |
|---|---|
| Dedicated multiplayer server | Server only |
| Player joining a patched dedicated server | Not required |
| Singleplayer world | Client |
| Open to LAN host | Host client |
Built and tested for:
26.1.20.19.3252.2.3+26.12.12.4+26.1.21.12.5+26.1.2Known compatible in the original test environment with:
0.152.1+26.1.20.24.5+mc26.1.2The mod does not mix into Lithium classes.
mods folder:
mods/ folder;mods/ folder.Additional Entity Attributes is also present, directly or through Origins Legacy / Apoli Legacy.On startup you should see the mod listed as:
aea_tnt_crash_fix 1.0.0
You should also see:
AEA TNT Crash Fix loaded.
When the fix prevents the crash, the log will contain a rate-limited warning like:
[AEA TNT Crash Fix] Prevented XP crash: Additional Entity Attributes breakingPlayer was null during Block.popExperience/explosion. Keeping vanilla XP.
The warning is rate-limited to avoid log spam during TNT chains. It logs at most once every 30 seconds.
Use a test world or a backup copy of your world.
Recommended checks:
No. If the server has the mod, normal clients do not need it.
Yes. Singleplayer runs an integrated server inside the client, so the client must load the mod.
No. When the crash condition is detected, the mod keeps the original vanilla XP amount.
No. This mod intentionally does not use fake players or nearest-player logic.
It should not change normal player mining behavior. If a real player breaks a block and AEA has a valid player reference, AEA can still apply its XP modifiers normally.
The patch only skips player-based XP modification when there is no valid player breaker.
No. It only targets the breakingPlayer == null crash in AEA's block XP modification path.
The relevant AEA logic is a Mixin into net.minecraft.world.level.block.Block, modifying the XP argument passed by Block.popExperience.
The problematic case is equivalent to:
additionalEntityAttributes$breakingPlayer.get()
when additionalEntityAttributes$breakingPlayer itself is null.
AEA TNT Crash Fix injects at the head of AEA's generated XP modification method and checks the stored WeakReference first.
If the reference is missing or cleared, it returns the original XP value immediately.
MIT