Skip to content

[1.21.1] NullPointerException in AbstractBlockEntityPocket.saveAdditional when destroying pocket block #136

Description

@sigmaone123456-cell

Minecraft Version

1.21.1

NeoForge Version

21.1.244

Dimensional Pockets II Version

10.10.2.0 (dimensionalpocketsii-neoforge-1.21.1-10.10.2.0.jar)

Description

The game crashes with a NullPointerException when the player tries to break / destroy a Dimensional Pockets related block (pocket wall, controller, etc.).

The crash occurs because AbstractBlockEntityPocket.getPocket() returns null, and the code then tries to call .exists() on it without a null check.

Steps to Reproduce

  1. Place a Dimensional Pocket block / wall / controller.
  2. Attempt to break it with left-click (start destroying the block).
  3. Crash occurs immediately.

Crash Report

java.lang.NullPointerException: Cannot invoke "com.tcn.dimensionalpocketsii.pocket.core.Pocket.exists()" because the return value of "com.tcn.dimensionalpocketsii.pocket.core.block.entity.AbstractBlockEntityPocket.getPocket()" is null
at TRANSFORMER/dimensionalpocketsii@10.10.2.0/com.tcn.dimensionalpocketsii.pocket.core.block.entity.AbstractBlockEntityPocket.saveAdditional(AbstractBlockEntityPocket.java:138)
at TRANSFORMER/minecraft@1.21.1/net.minecraft.world.level.block.entity.BlockEntity.saveWithoutMetadata(BlockEntity.java:114)
at TRANSFORMER/minecraft@1.21.1/net.minecraft.world.level.block.entity.BlockEntity.saveWithFullMetadata(BlockEntity.java:101)
at TRANSFORMER/neoforge@21.1.244/net.neoforged.neoforge.common.util.BlockSnapshot.getBlockEntityTag(BlockSnapshot.java:253)
at TRANSFORMER/neoforge@21.1.244/net.neoforged.neoforge.common.util.BlockSnapshot.create(BlockSnapshot.java:70)
at TRANSFORMER/minecraft@1.21.1/net.minecraft.client.multiplayer.ClientLevel.setBlock(ClientLevel.java:165)
... (full stack trace available in attached crash report)

Expected Behaviour

The block should be destroyed normally without crashing.

Actual Behaviour

Game crashes with NPE during block snapshot creation while saving the pocket block entity.

Additional Context

  • Happens on the client when starting to destroy the block.
  • Full crash report UUID: 469b53c6-f75c-4057-acb5-c7c18c591dce
  • Large modpack environment (Create, Mekanism, Iron’s Spells, etc.), but the stack clearly points only to Dimensional Pockets II.

crash-2026-08-01_14.58.10-client.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions