Skip to content

Commit

Permalink
make sure path is not null in case MeleeAttackGoal set it to null
Browse files Browse the repository at this point in the history
fix #1443
  • Loading branch information
Cheaterpaul committed Jan 11, 2025
1 parent 76b75da commit 6972b27
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6972b27

Please sign in to comment.