From b017fd74050c1080f6903a73a2ef95c9e98b0ab8 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 23 Dec 2020 19:01:49 +0100 Subject: [PATCH] Looting actually works now --- mods/ENTITIES/mcl_mobs/api.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index c769fee052..8787451888 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -776,9 +776,16 @@ local check_for_death = function(self, cause, cmi_cause) local function death_handle(self) -- dropped cooked item if mob died in fire or lava if cause == "lava" or cause == "fire" then - item_drop(self, true) + item_drop(self, true, 0) else - item_drop(self, nil) + local looting = 0 + if cause == "hit" then + local puncher = cmi_cause.puncher + if puncher then + looting = mcl_enchanting.get_enchantment(puncher:get_wielded_item(), "looting") + end + end + item_drop(self, nil, looting) end local pos = self.object:get_pos()