From 991bba0a1d611cf545020c9129fdcbc4806e73c6 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 22 Apr 2021 20:10:01 -0400 Subject: [PATCH] Add comments into ai.lua --- mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua index 9626477f0a..a8894898cf 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua @@ -612,11 +612,12 @@ mobs.mob_step = function(self, dtime) local attacking = nil + --scan for players within eyesight if self.hostile then --true for line_of_sight is debug attacking = mobs.detect_closest_player_within_radius(self,true,self.view_range,self.eye_height) - --go get the closest player ROAR >:O + --go get the closest player if attacking then --set initial punch timer @@ -650,12 +651,14 @@ mobs.mob_step = function(self, dtime) end end + --mob is stunned after being hit if self.pause_timer > 0 then self.pause_timer = self.pause_timer - dtime --don't break eye contact if self.hostile and self.attacking then mobs.set_yaw_while_attacking(self) end + --do normal ai else --jump only (like slimes) if self.jump_only then