Commit fa711c9b by Jonathan Thomas

Don't force path aware entities to look at the target while navigating a path…

Don't force path aware entities to look at the target while navigating a path (this breaks their ability to jump)
parent a29943ae
Pipeline #12725 passed with stages
in 1 minute 50 seconds
......@@ -93,9 +93,6 @@ public class LeadPlayerGoal extends PlayerBaseGoal {
private void moveToTarget() {
if (this.currentTarget != null) {
// Make the entity look at the player without moving towards them
LookControls.lookAtPosition(this.currentTarget, this.entity);
if (this.entity instanceof PathAwareEntity) {
if (!this.entity.getNavigation().isFollowingPath()) {
Path path = this.entity.getNavigation().findPathTo(this.currentTarget.x, this.currentTarget.y, this.currentTarget.z, 1);
......@@ -105,6 +102,9 @@ public class LeadPlayerGoal extends PlayerBaseGoal {
}
}
} else {
// Make the entity look at the player without moving towards them
LookControls.lookAtPosition(this.currentTarget, this.entity);
// Move towards the target for non-path aware entities
Vec3d entityPos = this.entity.getPos();
Vec3d moveDirection = this.currentTarget.subtract(entityPos).normalize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment