add hoglin breeding and flee from warped_fungus and respawn_anchor

This commit is contained in:
nixnoxus 2024-02-25 10:49:01 +01:00
parent fe88cca5d8
commit 89c5365b36
1 changed files with 28 additions and 1 deletions

View File

@ -40,6 +40,16 @@ local hoglin = {
makes_footstep_sound = true,
walk_velocity = 1,
run_velocity = 2.8,
runaway_from = {
"mcl_crimson:warped_fungus",
"mcl_flowerpots:flower_pot_warped_fungus",
"mcl_beds:respawn_anchor",
"mcl_beds:respawn_anchor_charged_1",
"mcl_beds:respawn_anchor_charged_2",
"mcl_beds:respawn_anchor_charged_3",
"mcl_beds:respawn_anchor_charged_4",
},
follow = {"mcl_crimson:crimson_fungus"},
drops = {
{name = "mobs_mcitems:leather",
chance = 1,
@ -87,9 +97,26 @@ local hoglin = {
attack_animals = true,
}
mcl_mobs.register_mob("mobs_mc:hoglin", hoglin)
local zoglin = table.copy(hoglin)
hoglin.on_rightclick = function(self, clicker)
-- local item = clicker:get_wielded_item()
if self:feed_tame(clicker, 1, true, false) then return end
-- if mcl_mobs:protect(self, clicker) then return end
end
hoglin.on_breed = function(parent1, parent2)
local pos = parent1.object:get_pos()
local child = mcl_mobs.spawn_child(pos, parent1.name)
if child then
local ent_c = child:get_luaentity()
-- ent_c.tamed = true
ent_c.owner = parent1.owner
return false
end
end,
mcl_mobs.register_mob("mobs_mc:hoglin", hoglin)
zoglin.description = S("Zoglin")
zoglin.fire_resistant = 1
zoglin.textures = {"extra_mobs_zoglin.png"}