Change XP drop amount for each mob

This commit is contained in:
Wuzzy 2020-12-06 15:46:42 +01:00
parent e8cb8a789e
commit 839c22dcfb
37 changed files with 94 additions and 4 deletions

View file

@ -759,8 +759,8 @@ local check_for_death = function(self, cause, cmi_cause)
local pos = self.object:get_pos()
if mod_experience and self.hp_min and self.hp_max and (not self.child and self.type ~= "monster") then
mcl_experience.throw_experience(pos, math.ceil( math.random(self.hp_min,self.hp_max+5) / 5) )
if mod_experience and ((not self.child) or self.type ~= "animal") then
mcl_experience.throw_experience(pos, math.random(self.xp_min, self.xp_max))
end
end
@ -2977,7 +2977,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
}, true)
else
minetest.sound_play("default_punch", {
object = self.object, --hitter,
object = self.object,
max_hear_distance = 5
}, true)
end
@ -3646,6 +3646,8 @@ minetest.register_entity(name, {
lifetimer = def.lifetimer or 57.73,
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 0,
breath_max = def.breath_max or 15,
breathes_in_water = def.breathes_in_water or false,
physical = true,

View file

@ -247,6 +247,9 @@ functions needed for the mob to work properly which contains the following:
sound as adults but with higher pitch
'follow_velocity' The speed at which a mob moves toward the player when they're holding the appropriate follow item.
'instant_death' If true, mob dies instantly (no death animation or delay) (default: false)
'xp_min' the minimum XP it drops on death (default: 0)
'xp_max' the maximum XP it drops on death (default: 0)
Node Replacement

View file

@ -15,6 +15,8 @@ mobs:register_mob("mobs_mc:blaze", {
spawn_class = "hostile",
hp_min = 20,
hp_max = 20,
xp_min = 10,
xp_max = 10,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.79, 0.3},
rotate = -180,
visual = "mesh",

View file

@ -14,6 +14,8 @@ mobs:register_mob("mobs_mc:chicken", {
hp_min = 4,
hp_max = 4,
xp_min = 1,
xp_max = 3,
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.69, 0.2},
runaway = true,
floats = 1,

View file

@ -7,6 +7,8 @@ local cow_def = {
spawn_class = "passive",
hp_min = 10,
hp_max = 10,
xp_min = 1,
xp_max = 3,
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.39, 0.45},
visual = "mesh",
mesh = "mobs_mc_cow.b3d",

View file

@ -14,6 +14,8 @@ mobs:register_mob("mobs_mc:creeper", {
spawn_class = "hostile",
hp_min = 20,
hp_max = 20,
xp_min = 5,
xp_max = 5,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.69, 0.3},
pathfinding = 1,
visual = "mesh",

View file

@ -12,6 +12,8 @@ mobs:register_mob("mobs_mc:enderdragon", {
walk_chance = 100,
hp_max = 200,
hp_min = 200,
xp_min = 500,
xp_max = 500,
collisionbox = {-2, 3, -2, 2, 5, 2},
physical = false,
visual = "mesh",

View file

@ -188,6 +188,8 @@ mobs:register_mob("mobs_mc:enderman", {
pathfinding = 1,
hp_min = 40,
hp_max = 40,
xp_min = 5,
xp_max = 5,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 2.89, 0.3},
visual = "mesh",
mesh = "mobs_mc_enderman.b3d",

View file

@ -10,6 +10,8 @@ mobs:register_mob("mobs_mc:endermite", {
passive = false,
hp_min = 8,
hp_max = 8,
xp_min = 3,
xp_max = 3,
armor = 100,
group_attack = true,
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.29, 0.2},

View file

@ -17,6 +17,8 @@ mobs:register_mob("mobs_mc:ghast", {
group_attack = true,
hp_min = 10,
hp_max = 10,
xp_min = 5,
xp_max = 5,
collisionbox = {-2, 5, -2, 2, 9, 2},
visual = "mesh",
mesh = "mobs_mc_ghast.b3d",

View file

@ -9,6 +9,8 @@ mobs:register_mob("mobs_mc:guardian", {
spawn_class = "hostile",
hp_min = 30,
hp_max = 30,
xp_min = 10,
xp_max = 10,
breath_max = -1,
passive = false,
attack_type = "dogfight",

View file

@ -11,6 +11,8 @@ mobs:register_mob("mobs_mc:guardian_elder", {
spawn_class = "hostile",
hp_min = 80,
hp_max = 80,
xp_min = 10,
xp_max = 10,
breath_max = -1,
passive = false,
attack_type = "dogfight",

View file

@ -117,6 +117,8 @@ local horse = {
passive = true,
hp_min = 15,
hp_max = 30,
xp_min = 1,
xp_max = 3,
floats = 1,
makes_footstep_sound = true,
jump = true,

View file

@ -29,6 +29,8 @@ mobs:register_mob("mobs_mc:llama", {
spawn_class = "passive",
hp_min = 15,
hp_max = 30,
xp_min = 1,
xp_max = 3,
passive = false,
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.86, 0.45},
visual = "mesh",

View file

@ -32,6 +32,8 @@ local ocelot = {
can_despawn = true,
hp_min = 10,
hp_max = 10,
xp_min = 1,
xp_max = 3,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.69, 0.3},
visual = "mesh",
mesh = "mobs_mc_cat.b3d",

View file

@ -17,6 +17,8 @@ mobs:register_mob("mobs_mc:parrot", {
pathfinding = 1,
hp_min = 6,
hp_max = 6,
xp_min = 1,
xp_max = 3,
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
visual = "mesh",
mesh = "mobs_mc_parrot.b3d",

View file

@ -8,6 +8,8 @@ mobs:register_mob("mobs_mc:pig", {
runaway = true,
hp_min = 10,
hp_max = 10,
xp_min = 1,
xp_max = 3,
collisionbox = {-0.45, -0.01, -0.45, 0.45, 0.865, 0.45},
visual = "mesh",
mesh = "mobs_mc_pig.b3d",

View file

@ -14,6 +14,8 @@ mobs:register_mob("mobs_mc:polar_bear", {
passive = false,
hp_min = 30,
hp_max = 30,
xp_min = 1,
xp_max = 3,
breath_max = -1,
collisionbox = {-0.7, -0.01, -0.7, 0.7, 1.39, 0.7},
visual = "mesh",

View file

@ -10,6 +10,8 @@ local rabbit = {
hp_min = 3,
hp_max = 3,
xp_min = 1,
xp_max = 3,
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.49, 0.2},
visual = "mesh",

View file

@ -47,7 +47,8 @@ mobs:register_mob("mobs_mc:sheep", {
spawn_class = "passive",
hp_min = 8,
hp_max = 8,
xp_min = 1,
xp_max = 3,
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.29, 0.45},
visual = "mesh",

View file

@ -21,6 +21,8 @@ mobs:register_mob("mobs_mc:shulker", {
passive = false,
hp_min = 30,
hp_max = 30,
xp_min = 5,
xp_max = 5,
armor = 150,
collisionbox = {-0.5, -0.01, -0.5, 0.5, 0.99, 0.5},
visual = "mesh",

View file

@ -12,6 +12,8 @@ mobs:register_mob("mobs_mc:silverfish", {
reach = 1,
hp_min = 8,
hp_max = 8,
xp_min = 5,
xp_max = 5,
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.44, 0.4},
visual = "mesh",
mesh = "mobs_mc_silverfish.b3d",

View file

@ -17,6 +17,8 @@ local skeleton = {
spawn_class = "hostile",
hp_min = 20,
hp_max = 20,
xp_min = 6,
xp_max = 6,
breath_max = -1,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3},
pathfinding = 1,

View file

@ -14,6 +14,8 @@ mobs:register_mob("mobs_mc:witherskeleton", {
spawn_class = "hostile",
hp_min = 20,
hp_max = 20,
xp_min = 6,
xp_max = 6,
breath_max = -1,
pathfinding = 1,
group_attack = true,

View file

@ -63,6 +63,8 @@ local slime_big = {
group_attack = { "mobs_mc:slime_big", "mobs_mc:slime_small", "mobs_mc:slime_tiny" },
hp_min = 16,
hp_max = 16,
xp_min = 4,
xp_max = 4,
collisionbox = {-1.02, -0.01, -1.02, 1.02, 2.03, 1.02},
visual_size = {x=12.5, y=12.5},
textures = {{"mobs_mc_slime.png"}},
@ -114,6 +116,8 @@ local slime_small = table.copy(slime_big)
slime_small.sounds.base_pitch = 1.15
slime_small.hp_min = 4
slime_small.hp_max = 4
slime_small.xp_min = 2
slime_small.xp_max = 2
slime_small.collisionbox = {-0.51, -0.01, -0.51, 0.51, 1.00, 0.51}
slime_small.visual_size = {x=6.25, y=6.25}
slime_small.damage = 3
@ -129,6 +133,8 @@ local slime_tiny = table.copy(slime_big)
slime_tiny.sounds.base_pitch = 1.3
slime_tiny.hp_min = 1
slime_tiny.hp_max = 1
slime_tiny.xp_min = 1
slime_tiny.xp_max = 1
slime_tiny.collisionbox = {-0.2505, -0.01, -0.2505, 0.2505, 0.50, 0.2505}
slime_tiny.visual_size = {x=3.125, y=3.125}
slime_tiny.damage = 0
@ -161,6 +167,8 @@ local magma_cube_big = {
spawn_class = "hostile",
hp_min = 16,
hp_max = 16,
xp_min = 4,
xp_max = 4,
collisionbox = {-1.02, -0.01, -1.02, 1.02, 2.03, 1.02},
visual_size = {x=12.5, y=12.5},
textures = {{ "mobs_mc_magmacube.png" }},
@ -221,6 +229,8 @@ magma_cube_small.sounds.jump = "mobs_mc_magma_cube_small"
magma_cube_small.sounds.death = "mobs_mc_magma_cube_small"
magma_cube_small.hp_min = 4
magma_cube_small.hp_max = 4
magma_cube_small.xp_min = 2
magma_cube_small.xp_max = 2
magma_cube_small.collisionbox = {-0.51, -0.01, -0.51, 0.51, 1.00, 0.51}
magma_cube_small.visual_size = {x=6.25, y=6.25}
magma_cube_small.damage = 3
@ -241,6 +251,8 @@ magma_cube_tiny.sounds.death = "mobs_mc_magma_cube_small"
magma_cube_tiny.sounds.base_pitch = 1.25
magma_cube_tiny.hp_min = 1
magma_cube_tiny.hp_max = 1
magma_cube_tiny.xp_min = 1
magma_cube_tiny.xp_max = 1
magma_cube_tiny.collisionbox = {-0.2505, -0.01, -0.2505, 0.2505, 0.50, 0.2505}
magma_cube_tiny.visual_size = {x=3.125, y=3.125}
magma_cube_tiny.walk_velocity = 1.02

View file

@ -23,6 +23,8 @@ local spider = {
reach = 2,
hp_min = 16,
hp_max = 16,
xp_min = 5,
xp_max = 5,
collisionbox = {-0.7, -0.01, -0.7, 0.7, 0.89, 0.7},
visual = "mesh",
mesh = "mobs_mc_spider.b3d",

View file

@ -13,6 +13,8 @@ mobs:register_mob("mobs_mc:squid", {
passive = true,
hp_min = 10,
hp_max = 10,
xp_min = 1,
xp_max = 3,
armor = 100,
-- FIXME: If the squid is near the floor, it turns black
collisionbox = {-0.4, 0.0, -0.4, 0.4, 0.9, 0.4},

View file

@ -18,6 +18,8 @@ mobs:register_mob("mobs_mc:vex", {
physical = false,
hp_min = 14,
hp_max = 14,
xp_min = 6,
xp_max = 6,
collisionbox = {-0.2, 0.2, -0.2, 0.2, 1.0, 0.2}, --bat
visual = "mesh",
mesh = "mobs_mc_vex.b3d",

View file

@ -18,6 +18,8 @@ mobs:register_mob("mobs_mc:evoker", {
pathfinding = 1,
hp_min = 24,
hp_max = 24,
xp_min = 10,
xp_max = 10,
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.95, 0.4},
visual = "mesh",
mesh = "mobs_mc_villager.b3d",

View file

@ -22,6 +22,8 @@ mobs:register_mob("mobs_mc:illusioner", {
end,
hp_min = 32,
hp_max = 32,
xp_min = 6,
xp_max = 6,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
visual = "mesh",
mesh = "mobs_mc_illusioner.b3d",

View file

@ -17,6 +17,8 @@ mobs:register_mob("mobs_mc:vindicator", {
pathfinding = 1,
hp_min = 24,
hp_max = 24,
xp_min = 6,
xp_max = 6,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
visual = "mesh",
mesh = "mobs_mc_vindicator.b3d",

View file

@ -17,6 +17,8 @@ mobs:register_mob("mobs_mc:villager_zombie", {
spawn_class = "hostile",
hp_min = 20,
hp_max = 20,
xp_min = 5,
xp_max = 5,
breath_max = -1,
armor = 90,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},

View file

@ -17,6 +17,8 @@ mobs:register_mob("mobs_mc:witch", {
spawn_class = "hostile",
hp_min = 26,
hp_max = 26,
xp_min = 5,
xp_max = 5,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
visual = "mesh",
mesh = "mobs_mc_witch.b3d",

View file

@ -14,6 +14,8 @@ mobs:register_mob("mobs_mc:wither", {
spawn_class = "hostile",
hp_max = 300,
hp_min = 300,
xp_min = 50,
xp_max = 50,
armor = 80,
-- This deviates from MC Wiki's size, which makes no sense
collisionbox = {-0.9, 0.4, -0.9, 0.9, 2.45, 0.9},

View file

@ -24,6 +24,8 @@ local wolf = {
can_despawn = true,
hp_min = 8,
hp_max = 8,
xp_min = 1,
xp_max = 3,
passive = false,
group_attack = true,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.84, 0.3},

View file

@ -43,6 +43,8 @@ local zombie = {
spawn_class = "hostile",
hp_min = 20,
hp_max = 20,
xp_min = 5,
xp_max = 5,
breath_max = -1,
armor = 90,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
@ -89,6 +91,8 @@ mobs:register_mob("mobs_mc:zombie", zombie)
local baby_zombie = table.copy(zombie)
baby_zombie.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25}
baby_zombie.xp_min = 12
baby_zombie.xp_max = 12
baby_zombie.visual_size = {x=zombie.visual_size.x/2, y=zombie.visual_size.y/2}
baby_zombie.walk_velocity = 1.2
baby_zombie.run_velocity = 2.4
@ -110,6 +114,8 @@ mobs:register_mob("mobs_mc:husk", husk)
-- A smaller and more dangerous variant of the husk
local baby_husk = table.copy(husk)
baby_husk.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25}
baby_husk.xp_min = 12
baby_husk.xp_max = 12
baby_husk.visual_size = {x=zombie.visual_size.x/2, y=zombie.visual_size.y/2}
baby_husk.walk_velocity = 1.2
baby_husk.run_velocity = 2.4

View file

@ -17,6 +17,8 @@ local pigman = {
spawn_class = "passive",
hp_min = 20,
hp_max = 20,
xp_min = 6,
xp_max = 6,
breath_max = -1,
armor = 90,
attack_type = "dogfight",
@ -89,6 +91,8 @@ mobs:register_mob("mobs_mc:pigman", pigman)
local baby_pigman = table.copy(pigman)
baby_pigman.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25}
baby_pigman.xp_min = 13
baby_pigman.xp_max = 13
baby_pigman.visual_size = {x=pigman.visual_size.x/2, y=pigman.visual_size.y/2}
baby_pigman.textures = { {
"mobs_mc_zombie_pigman.png", --baby