2017-01-16 17:40:08 +01:00
|
|
|
|
--MCmobs v0.2
|
|
|
|
|
--maikerumine
|
|
|
|
|
--made for MC like Survival game
|
|
|
|
|
--License for code WTFPL and otherwise stated in readmes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mobs:register_mob("mobs_mc:chicken", {
|
|
|
|
|
type = "animal",
|
2017-01-20 21:24:56 +01:00
|
|
|
|
hp_min = 4,
|
2017-01-16 20:52:09 +01:00
|
|
|
|
hp_max = 4,
|
2017-02-23 19:12:18 +01:00
|
|
|
|
-- The x/z size is slightly bigger than in Minecraft (MC: 0.4×0.4; MCL2: 0.5×0.5)
|
|
|
|
|
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.69, 0.25},
|
2017-01-16 17:40:08 +01:00
|
|
|
|
|
|
|
|
|
visual = "mesh",
|
2017-02-23 19:12:18 +01:00
|
|
|
|
visual_size = {x=0.7, y=0.7},
|
2017-01-16 17:40:08 +01:00
|
|
|
|
mesh = "mobs_mc_chicken.x",
|
|
|
|
|
textures = {
|
|
|
|
|
{"mobs_mc_chicken.png"}
|
|
|
|
|
},
|
|
|
|
|
makes_footstep_sound = true,
|
|
|
|
|
walk_velocity = 1,
|
2017-01-16 20:52:09 +01:00
|
|
|
|
armor = 100,
|
2017-01-16 17:40:08 +01:00
|
|
|
|
drops = {
|
2017-02-23 02:21:27 +01:00
|
|
|
|
{name = "mcl_mobitems:chicken",
|
2017-01-16 17:40:08 +01:00
|
|
|
|
chance = 1,
|
|
|
|
|
min = 1,
|
|
|
|
|
max = 1,},
|
|
|
|
|
{name = "mcl_mobitems:feather",
|
|
|
|
|
chance = 1,
|
|
|
|
|
min = 0,
|
|
|
|
|
max = 2,},
|
|
|
|
|
},
|
|
|
|
|
drawtype = "front",
|
2017-02-23 19:52:07 +01:00
|
|
|
|
lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
|
2017-01-16 17:40:08 +01:00
|
|
|
|
light_damage = 0,
|
2017-02-23 18:14:39 +01:00
|
|
|
|
fall_damage = false,
|
|
|
|
|
fear_height = 4,
|
|
|
|
|
jump_height = 4.5,
|
2017-01-16 17:40:08 +01:00
|
|
|
|
sounds = {
|
2017-02-20 02:36:12 +01:00
|
|
|
|
random = "mobs_chicken",
|
2017-01-16 17:40:08 +01:00
|
|
|
|
death = "Chickenhurt1",
|
|
|
|
|
hurt = "Chickenhurt1",
|
|
|
|
|
},
|
|
|
|
|
animation = {
|
|
|
|
|
speed_normal = 24,
|
|
|
|
|
stand_start = 0,
|
|
|
|
|
stand_end = 23,
|
|
|
|
|
walk_start = 24,
|
|
|
|
|
walk_end = 49,
|
|
|
|
|
hurt_start = 118,
|
|
|
|
|
hurt_end = 154,
|
|
|
|
|
death_start = 154,
|
|
|
|
|
death_end = 179,
|
|
|
|
|
eat_start = 49,
|
|
|
|
|
eat_end = 78,
|
|
|
|
|
look_start = 78,
|
|
|
|
|
look_end = 108,
|
|
|
|
|
fly_start = 181,
|
|
|
|
|
fly_end = 187,
|
|
|
|
|
},
|
|
|
|
|
--from mobs_animals
|
2017-02-15 01:00:12 +01:00
|
|
|
|
follow = {"mcl_farming:wheat_seeds", "mcl_farming:beetroot_seeds", "mcl_farming:pumpkin_seeds", "mcl_farming:melon_seeds"},
|
2017-01-16 17:40:08 +01:00
|
|
|
|
view_range = 5,
|
|
|
|
|
|
|
|
|
|
on_rightclick = function(self, clicker)
|
|
|
|
|
|
2017-02-23 18:20:24 +01:00
|
|
|
|
if mobs:feed_tame(self, clicker, 1, true, true) then
|
2017-01-16 17:40:08 +01:00
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
|
|
do_custom = function(self)
|
|
|
|
|
|
|
|
|
|
if self.child
|
|
|
|
|
or math.random(1, 5000) > 1 then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local pos = self.object:getpos()
|
|
|
|
|
|
2017-01-16 23:11:04 +01:00
|
|
|
|
minetest.add_item(pos, "mcl_throwing:egg")
|
2017-01-16 17:40:08 +01:00
|
|
|
|
|
2017-02-23 14:59:01 +01:00
|
|
|
|
minetest.sound_play("mobs_mc_chicken_lay_egg", {
|
2017-01-16 17:40:08 +01:00
|
|
|
|
pos = pos,
|
|
|
|
|
gain = 1.0,
|
|
|
|
|
max_hear_distance = 5,
|
|
|
|
|
})
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
2017-02-20 03:00:03 +01:00
|
|
|
|
mobs:register_spawn("mobs_mc:chicken", {"mcl_core:dirt_with_grass"}, 20, 9, 7000, 1, 31000)
|
2017-01-16 17:40:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- compatibility
|
|
|
|
|
mobs:alias_mob("mobs:chicken", "mobs_mc:chicken")
|
|
|
|
|
|
|
|
|
|
-- spawn eggs
|
2017-01-17 00:05:12 +01:00
|
|
|
|
mobs:register_egg("mobs_mc:chicken", "Spawn Chicken", "spawn_egg_chicken.png")
|
2017-01-16 17:40:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if minetest.setting_get("log_mods") then
|
|
|
|
|
minetest.log("action", "MC chicken loaded")
|
|
|
|
|
end
|