Update helptext of obsidian
[MineClone/MineClone2.git] / mods / ENTITIES / mobs_mc / parrot.lua
bloba6a2a276d501938d50e3494a983a1136624cb1b0
1 --MCmobs v0.4
2 --maikerumine
3 --made for MC like Survival game
4 --License for code WTFPL and otherwise stated in readmes
6 local S = minetest.get_translator("mobs_mc")
8 --###################
9 --################### PARROT
10 --###################
14 mobs:register_mob("mobs_mc:parrot", {
15 type = "npc",
16 spawn_class = "passive",
17 pathfinding = 1,
18 hp_min = 6,
19 hp_max = 6,
20 collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
21 visual = "mesh",
22 mesh = "mobs_mc_parrot.b3d",
23 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"}},
24 visual_size = {x=3, y=3},
25 makes_footstep_sound = true,
26 walk_velocity = 3,
27 run_velocity = 5,
28 -- TODO: sounds
29 drops = {
30 {name = mobs_mc.items.feather,
31 chance = 1,
32 min = 1,
33 max = 2,},
35 animation = {
36 stand_speed = 50,
37 walk_speed = 50,
38 stand_start = 0,
39 stand_end = 0,
40 walk_start = 0,
41 walk_end = 130,
42 --run_start = 0,
43 --run_end = 20,
44 --fly_start = 30,
45 --fly_end = 45,
47 walk_chance = 100,
48 fall_damage = 0,
49 fall_speed = -2.25,
50 attack_type = "dogfight",
51 jump = true,
52 jump_height = 4,
53 floats = 1,
54 physical = true,
55 fly = true,
56 fear_height = 4,
57 view_range = 16,
58 follow = mobs_mc.follow.parrot,
59 on_rightclick = function(self, clicker)
60 if self._doomed then return end
61 local item = clicker:get_wielded_item()
62 -- Kill parrot if fed with cookie
63 if item:get_name() == mobs_mc.items.cookie then
64 self.health = 0
65 -- Doomed to die
66 self._doomed = true
67 if not minetest.is_creative_enabled(clicker:get_player_name()) then
68 item:take_item()
69 clicker:set_wielded_item(item)
70 end
71 return
72 end
74 -- Feed to tame, but not breed
75 if mobs:feed_tame(self, clicker, 1, false, true) then return end
76 if mobs:protect(self, clicker) then return end
77 if mobs:capture_mob(self, clicker, 0, 50, 80, false, nil) then return end
78 end,
83 -- Spawn disabled because parrots are not very smart.
84 -- TODO: Re-enable when parrots are finished
85 --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)
87 -- spawn eggs
88 mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0, true)