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 beea05281..b1301380b 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 @@ -39,8 +39,12 @@ public boolean canUse() { if (avoidSun) { Path path = this.path; + //noinspection ConstantValue - if (path != null && mob.getCommandSenderWorld().canSeeSkyFromBelowWater(new BlockPos(Mth.floor(this.mob.getX()), (int) (this.mob.getBoundingBox().minY + 0.5D), Mth.floor(this.mob.getZ())))) { + 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; }