Crash issue regarding the despawn of specific entity

Started by yuuu on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Crash issue regarding the despawn of specific entity

I was developing a boss that summons ring-shaped entity around itself, which are programmed to disappear after four seconds. However, the game crashes every time this entity despawns. Upon reviewing the crash log, I discovered that a method named findEntityInWorldRange is causing the error. However, I did not add this method myself, and I am unsure how to resolve the issue. I would greatly appreciate any assistance. Thank you for your time and consideration.

Joined Feb 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i forgot to add method that…
Tue, 02/03/2026 - 12:33

i forgot to add method that is causing the error.

here it is

private static Entity findEntityInWorldRange(LevelAccessor world, Class<? extends Entity> clazz, double x, double y, double z, double range) {

return (Entity) world.getEntitiesOfClass(clazz, AABB.ofSize(new Vec3(x, y, z), range, range, range), e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(x, y, z))).findFirst().orElse(null);