diff --git a/mods/ENTITIES/mcl_mobs/combat.lua b/mods/ENTITIES/mcl_mobs/combat.lua index 7775c1b8e..66f477dbb 100644 --- a/mods/ENTITIES/mcl_mobs/combat.lua +++ b/mods/ENTITIES/mcl_mobs/combat.lua @@ -553,6 +553,9 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir) local weapon = hitter:get_wielded_item() local punch_interval = 1.4 + -- invulnerability time + local invul_time = 0.4 + -- exhaust attacker if is_player then mcl_hunger.exhaust(hitter:get_player_name(), mcl_hunger.EXHAUST_ATTACK) @@ -635,7 +638,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir) if damage >= 0 then -- only play hit sound and show blood effects if damage is 1 or over; lower to 0.1 to ensure armor works appropriately. - if damage >= 0.1 then + if damage >= 0.1 and tflp > invul_time then -- weapon sounds if weapon:get_definition().sounds ~= nil then @@ -672,7 +675,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir) if not v then return end local r = 1.4 - math.min(punch_interval, 1.4) local kb = r * (math.abs(v.x)+math.abs(v.z)) - local up = 2 + local up = 2.75 if die==true then kb=kb*2 @@ -689,7 +692,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir) if tool_capabilities.damage_groups["knockback"] then kb = tool_capabilities.damage_groups["knockback"] else - kb = kb * 1.5 + kb = kb * 2.5 end @@ -699,7 +702,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir) end if hitter and is_player then local wielditem = hitter:get_wielded_item() - kb = kb + 3 * mcl_enchanting.get_enchantment(wielditem, "knockback") + kb = kb + 10 * mcl_enchanting.get_enchantment(wielditem, "knockback") elseif luaentity and luaentity._knockback then kb = kb + luaentity._knockback end