mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Unset the target when dead (fixes skeletons shooting at the ground)
This commit is contained in:
parent
ccb636a674
commit
62c11ec66b
1 changed files with 4 additions and 0 deletions
|
@ -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)))
|
||||
|
|
Loading…
Reference in a new issue