Camera Mod

Camera Mod

18M Downloads

Camera Mod 1.21.5-1.1.2 - Items Frame crash Neoforge

Honiway opened this issue ยท 1 comments

commented

Bug description

Hi,

I'm experiencing a server crash using camera-neoforge-1.21.5-1.1.2 on Minecraft 1.21.5 (NeoForge 21.5.56-beta).

The server starts up fine, but it crashes immediately when I log in. After investigating, the issue appears to come from an ImageEntity (camera:image_frame) that throws a NullPointerException in the onBroken() method.

Here is an excerpt from the crash report:

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.Entity.level()" because "entity" is null at de.maxhenkel.camera.entities.ImageEntity.onBroken(ImageEntity.java:176) at de.maxhenkel.camera.entities.ImageEntity.removeFrame(ImageEntity.java:299) at de.maxhenkel.camera.entities.ImageEntity.removeFrame(ImageEntity.java:305) at de.maxhenkel.camera.entities.ImageEntity.checkValid(ImageEntity.java:171) at de.maxhenkel.camera.entities.ImageEntity.tick(ImageEntity.java:77)

yaml

The crashing entity was located at:
x=2656.5, y=105.0, z=1711.5

yaml

It seems that ImageEntity.onBroken() does not check whether the associated entity or its level (entity.level()) is null before accessing it, which causes the crash.


System Information:

  • Minecraft: 1.21.5
  • NeoForge: 21.5.56-beta
  • Camera Mod: camera-neoforge-1.21.5-1.1.2
  • Java: OpenJDK 21 (Azul)
  • OS: Linux (dedicated server)

Steps to reproduce:

  1. Place an image with the Camera mod (likely using a frame)
  2. Leave the area or disconnect
  3. Delete or corrupt the frame entity (either manually or accidentally)
  4. Reconnect to the server โ†’ server crashes immediately

Suggested Fix:

Add a null check before accessing entity.level() in the onBroken() method to prevent crashes when the entity is unexpectedly missing.

Thanks for the great mod โ€” hope this helps improve stability!

Minecraft version

1.21.5 - Neoforge

Mod version

1.21.5-1.1.2

Mod loader and version

Neoforge

Steps to reproduce

  1. Place an image with the Camera mod (likely using a frame)
  2. Leave the area or disconnect
  3. Delete or corrupt the frame entity (either manually or accidentally)
  4. Reconnect to the server โ†’ server crashes immediately

Expected behavior

No response

Log files

https://gist.github.com/Honiway/03868ef795c13e79a741330ad4ad7ce4

Screenshots

No response

commented

Thanks for reporting this issue :)