diff --git a/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java b/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java index f532f40d0..3a3f88605 100644 --- a/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java +++ b/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java @@ -103,8 +103,11 @@ public class CitizensNavigator implements Navigator, Runnable { public void run() { if (!isNavigating()) return; - if (!npc.isSpawned()) + if (!npc.isSpawned()) { + if (isNavigating()) + stopNavigating(CancelReason.NPC_DESPAWNED); return; + } if (updateStationaryStatus()) return; updatePathfindingRange(); diff --git a/src/main/java/net/citizensnpcs/trait/waypoint/WanderWaypointProvider.java b/src/main/java/net/citizensnpcs/trait/waypoint/WanderWaypointProvider.java index 0205c5aaf..b5de035c8 100644 --- a/src/main/java/net/citizensnpcs/trait/waypoint/WanderWaypointProvider.java +++ b/src/main/java/net/citizensnpcs/trait/waypoint/WanderWaypointProvider.java @@ -44,7 +44,7 @@ public class WanderWaypointProvider implements WaypointProvider { @Override public void onSpawn(NPC npc) { if (currentGoal == null) { - currentGoal = WanderGoal.createWithNPC(npc); + currentGoal = WanderGoal.createWithNPCAndRange(npc, xrange, yrange); CitizensAPI.registerEvents(currentGoal); } npc.getDefaultGoalController().addGoal(currentGoal, 1);