Started by
yuuu
on
Topic category: Help with Minecraft modding (Java Edition)
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.
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);