forked from VoxeLibre/VoxeLibre
Knockback enchantment working on mobs
This commit is contained in:
parent
68f5d1c0fb
commit
1f05d8f876
|
@ -3077,6 +3077,18 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
||||||
kb = kb * 1.5
|
kb = kb * 1.5
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local luaentity
|
||||||
|
if hitter then
|
||||||
|
luaentity = hitter:get_luaentity()
|
||||||
|
end
|
||||||
|
if hitter and hitter:is_player() then
|
||||||
|
local wielditem = hitter:get_wielded_item()
|
||||||
|
kb = kb + 3 * mcl_enchanting.get_enchantment(wielditem, "knockback")
|
||||||
|
elseif luaentity and luaentity._knockback then
|
||||||
|
kb = kb + luaentity._knockback
|
||||||
|
end
|
||||||
|
|
||||||
self.object:set_velocity({
|
self.object:set_velocity({
|
||||||
x = dir.x * kb,
|
x = dir.x * kb,
|
||||||
y = dir.y * kb + up,
|
y = dir.y * kb + up,
|
||||||
|
|
Loading…
Reference in New Issue