From ea6912c980952bed2a0b5e62009e0a2639d75d75 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Fri, 23 Apr 2021 17:44:49 -0400 Subject: [PATCH] Don't do knockback effect for mobs when hurt by a rider --- .../mcl_mobs/api/mob_functions/interaction.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua index 4a13a3499f..b564aaf489 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua @@ -194,6 +194,17 @@ mobs.mob_punch = function(self, hitter, tflp, tool_capabilities, dir) -- do damage self.health = self.health - damage + + --0.4 seconds until you can hurt the mob again + self.pause_timer = 0.4 + + --don't do knockback from a rider + for _,obj in pairs(self.object:get_children()) do + if obj == hitter then + return + end + end + -- knock back effect local velocity = self.object:get_velocity() @@ -235,8 +246,6 @@ mobs.mob_punch = function(self, hitter, tflp, tool_capabilities, dir) --add the velocity self.object:add_velocity(dir) - --0.4 seconds until you can hurt the mob again - self.pause_timer = 0.4 end end