From c37a82d4a2589d372f88b5101918858c2d210e57 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Fri, 23 Apr 2021 22:03:29 -0400 Subject: [PATCH] Add comments --- mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua index 8a4add6568..cb755b03ea 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua @@ -168,10 +168,13 @@ local land_state_execution = function(self,dtime) elseif self.state == "follow" then + --always look at players mobs.set_yaw_while_following(self) + --check distance local distance_from_follow_person = vector_distance(self.object:get_pos(), self.following_person:get_pos()) + --don't push the player if too close if self.follow_distance < distance_from_follow_person then mobs.set_mob_animation(self, "run") mobs.set_velocity(self,self.run_velocity)