AEA TNT Crash Fix
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.
The crash this fixes
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.
Why it happens
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:
- A player lights TNT, or an explosion starts a TNT chain.
- TNT explodes later.
- The explosion breaks blocks.
- Some blocks try to drop experience.
- Additional Entity Attributes tries to apply player-based XP modifiers.
- But the block was not broken by a normal player action.
breakingPlayer can be null.
- AEA calls
.get() on that null reference.
- The server or singleplayer world crashes.
What this mod does
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.
What this mod does NOT do
This mod does not:
- disable TNT;
- disable explosions;
- prevent chain reactions;
- change explosion power;
- change block destruction rules;
- change TNT ownership;
- find the nearest player;
- use a fake player;
- apply XP modifiers to a random player;
- remove XP drops entirely;
- patch Lithium or other optimization mods.
The fix is deliberately narrow: it only handles the missing breakingPlayer case in the Additional Entity Attributes XP modifier.
Multiplayer and client requirements
Dedicated server
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.
Singleplayer
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.
Summary
| 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 |
Compatibility
Built and tested for:
- Minecraft
26.1.2
- Fabric Loader
0.19.3
- Java
25
- Additional Entity Attributes
2.2.3+26.1
- Apoli Legacy
2.12.4+26.1.2
- Origins Legacy
1.12.5+26.1.2
Known compatible in the original test environment with:
- Fabric API
0.152.1+26.1.2
- Lithium
0.24.5+mc26.1.2
The mod does not mix into Lithium classes.
Installation
- Download the jar.
- Put it in the appropriate
mods folder:
- dedicated server: server
mods/ folder;
- singleplayer: client instance
mods/ folder.
- Make sure
Additional Entity Attributes is also present, directly or through Origins Legacy / Apoli Legacy.
- Start the game or server.
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.
Logging
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.
Recommended test checklist
Use a test world or a backup copy of your world.
Recommended checks:
- Explode one TNT in the Nether.
- Explode a chain of 5 TNT.
- Explode a chain of 10 TNT.
- Explode TNT near quartz ore, gold ore, ancient debris, or other XP-related blocks.
- Use a bed explosion in the Nether.
- Use a respawn anchor explosion where applicable.
- Mine XP-dropping ore normally with a player.
- Mine XP-dropping ore with Origins/Apoli powers that affect XP, if your pack has them.
- Confirm that XP still drops.
- Confirm that the game/server no longer crashes.
FAQ
Is this needed on the client when joining a server?
No. If the server has the mod, normal clients do not need it.
Is this needed for singleplayer?
Yes. Singleplayer runs an integrated server inside the client, so the client must load the mod.
Does this remove XP from explosions?
No. When the crash condition is detected, the mod keeps the original vanilla XP amount.
Does this fake a player?
No. This mod intentionally does not use fake players or nearest-player logic.
Does this change Origins powers?
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.
Does this fix all Additional Entity Attributes bugs?
No. It only targets the breakingPlayer == null crash in AEA's block XP modification path.
Technical details
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.
License
MIT