3 --made for MC like Survival game
4 --License for code WTFPL and otherwise stated in readmes
7 local MP
= minetest
.get_modpath(minetest
.get_current_modname())
8 local S
, NS
= dofile(MP
.."/intllib.lua")
10 --dofile(minetest.get_modpath("mobs").."/api.lua")
14 --################### PARROT
19 mobs
:register_mob("mobs_mc:parrot", {
24 collisionbox
= {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
26 mesh
= "mobs_mc_parrot.b3d",
27 textures
= {{"mobs_mc_parrot_blue.png"},{"mobs_mc_parrot_green.png"},{"mobs_mc_parrot_grey.png"},{"mobs_mc_parrot_red_blue.png"},{"mobs_mc_parrot_yellow_blue.png"}},
28 visual_size
= {x
=3, y
=3},
29 makes_footstep_sound
= true,
33 {name
= mobs_mc
.items
.feather
,
56 attack_type
= "dogfight",
65 follow
= mobs_mc
.follow
.parrot
,
66 on_rightclick
= function(self
, clicker
)
67 if self
._doomed
then return end
68 local item
= clicker
:get_wielded_item()
69 -- Kill parrot if fed with cookie
70 if item
:get_name() == mobs_mc
.items
.cookie
then
74 if not minetest
.settings
:get_bool("creative_mode") then
76 clicker
:set_wielded_item(item
)
81 -- Feed to tame, but not breed
82 if mobs
:feed_tame(self
, clicker
, 1, false, true) then return end
83 if mobs
:protect(self
, clicker
) then return end
84 if mobs
:capture_mob(self
, clicker
, 0, 50, 80, false, nil) then return end
90 -- Spawn disabled because parrots are not very smart.
91 -- TODO: Re-enable when parrots are finished
92 --mobs:spawn_specific("mobs_mc:parrot", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 30000, 1, mobs_mc.spawn_height.water+1, mobs_mc.spawn_height.overworld_max)
95 mobs
:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0)
97 if minetest
.settings
:get_bool("log_mods") then
98 minetest
.log("action", "MC Parrot loaded")