From 49b01dca4fcea165314c1548f6c3e673a5de0bd3 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sat, 24 Apr 2021 22:28:26 -0400 Subject: [PATCH] Make mobs drop xp on death --- mods/ENTITIES/mcl_mobs/api/api.lua | 5 ++--- mods/ENTITIES/mcl_mobs/api/mob_functions/death_logic.lua | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/api.lua b/mods/ENTITIES/mcl_mobs/api/api.lua index fb76f0d18..cdd5889fe 100644 --- a/mods/ENTITIES/mcl_mobs/api/api.lua +++ b/mods/ENTITIES/mcl_mobs/api/api.lua @@ -213,9 +213,8 @@ function mobs:register_mob(name, def) rotate = def.rotate or 0, -- 0=front, 90=side, 180=back, 270=side2 hp_min = scale_difficulty(def.hp_min, 5, 1), hp_max = scale_difficulty(def.hp_max, 10, 1), - xp_min = def.xp_min or 0, - xp_max = def.xp_max or 3, - xp_timestamp = 0, + xp_min = def.xp_min or 1, + xp_max = def.xp_max or 5, breath_max = def.breath_max or 15, breathes_in_water = def.breathes_in_water or false, physical = true, diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/death_logic.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/death_logic.lua index 36d6f41ca..fd95b60ef 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/death_logic.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/death_logic.lua @@ -116,6 +116,8 @@ mobs.death_logic = function(self, dtime) mobs.death_effect(self) + mcl_experience.throw_experience(self.object:get_pos(), math_random(self.xp_min, self.xp_max)) + self.object:remove() return