diff --git a/src/main/java/de/teamlapen/vampirism/entity/ai/goals/AttackMeleeNoSunGoal.java b/src/main/java/de/teamlapen/vampirism/entity/ai/goals/AttackMeleeNoSunGoal.java index 0a91dfae2..b11dc498d 100644 --- a/src/main/java/de/teamlapen/vampirism/entity/ai/goals/AttackMeleeNoSunGoal.java +++ b/src/main/java/de/teamlapen/vampirism/entity/ai/goals/AttackMeleeNoSunGoal.java @@ -40,6 +40,12 @@ public boolean canUse() { if (avoidSun) { Path path = ((MeleeAttackGoalAccessor) this).getPath(); + + //for some reason the path is null in some cases + if (path == null) { + return false; + } + if (mob.getCommandSenderWorld().canSeeSkyFromBelowWater(new BlockPos(Mth.floor(this.mob.getX()), (int) (this.mob.getBoundingBox().minY + 0.5D), Mth.floor(this.mob.getZ())))) { return false; }