Skip to content

Commit

Permalink
allow setEntityNavigationTarget for all mobs (1.18 only)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokkonaut committed Dec 27, 2021
1 parent 29c57d5 commit 8d70c8a
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -211,8 +211,10 @@ public void setEntityNavigationTarget(org.bukkit.entity.Entity entity, Location
if (entityVex.getTarget() == null) {
entityVex.getLookControl().setLookAt(target.getX(), target.getY(), target.getZ(), 180, 20);
}
} else if (entity instanceof CraftMob) {
((CraftMob) entity).getHandle().getNavigation().moveTo(target.getX(), target.getY(), target.getZ(), speed);
} else {
((CraftCreature) entity).getHandle().getNavigation().moveTo(target.getX(), target.getY(), target.getZ(), speed);
throw new IllegalArgumentException("Cannot set the navigation target for this mob");
}
}

Expand Down

0 comments on commit 8d70c8a

Please sign in to comment.