1
0
Fork 0

Fix being able to reduce knockback while guarding when facing away from Hoglin/Zoglin

This commit is contained in:
Eliy21 2024-01-28 15:05:18 +00:00
parent a591e655ef
commit 3c6b334df1
1 changed files with 2 additions and 1 deletions

View File

@ -70,7 +70,8 @@ local hoglin = {
floats = 0,
custom_attack = function(self)
if self.state == "attack" and self.reach > vector.distance(self.object:get_pos(), self.attack:get_pos()) then
if self.attack:is_player() and mcl_shields and mcl_shields.is_blocking and mcl_shields.is_blocking(self.attack) then
local shield_dot = vector.dot(self.attack:get_look_dir(), vector.subtract(self.object:get_pos(), self.attack:get_pos()))
if self.attack:is_player() and mcl_shields and mcl_shields.is_blocking and mcl_shields.is_blocking(self.attack) and shield_dot >= 0 then
self.attack:add_velocity({x=0,y=9.75,z=0})
else
self.attack:add_velocity({x=0,y=13,z=0})