diff --git a/src/main/java/com/minelittlepony/unicopia/entity/ai/DynamicTargetGoal.java b/src/main/java/com/minelittlepony/unicopia/entity/ai/DynamicTargetGoal.java index f4c4dc0e..0103b766 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/ai/DynamicTargetGoal.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/ai/DynamicTargetGoal.java @@ -48,6 +48,10 @@ public class DynamicTargetGoal extends Goal { if (interval-- <= 0) { interval = 20; + if (mob.getTarget() != null && mob.getTarget().isDead()) { + mob.setTarget(null); + } + target = VecHelper.findInRange(mob, mob.world, mob.getPos(), 26, test) .stream() .sorted(Comparator.comparing(e -> mob.distanceTo(e)))