Loading bee.lua +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ mobs:register_mob("mobs_animal:bee", { hp_min = 1, hp_max = 2, armor = 200, collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.2, 0.2}, collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.5, 0.2}, visual = "mesh", mesh = "mobs_bee.x", textures = { Loading bunny.lua +4 −7 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ mobs:register_mob("mobs_animal:bunny", { punch_start = 16, punch_end = 24, }, follow = {"farming:carrot", "farming_plus:carrot_item"}, follow = {"farming:carrot", "farming_plus:carrot_item", "default:grass_1"}, view_range = 8, replace_rate = 10, replace_what = {"farming:carrot_7", "farming:carrot_8", "farming_plus:carrot"}, Loading @@ -50,9 +50,9 @@ mobs:register_mob("mobs_animal:bunny", { on_rightclick = function(self, clicker) -- feed or tame if mobs:feed_tame(self, clicker, 4, true, true) then return end if mobs:feed_tame(self, clicker, 4, true, true) then return end if mobs:protect(self, clicker) then return end if mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) then return end -- Monty Python tribute local item = clicker:get_wielded_item() Loading @@ -73,9 +73,6 @@ mobs:register_mob("mobs_animal:bunny", { return end mobs:protect(self, clicker) mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) end, attack_type = "dogfight", Loading chicken.lua +56 −48 Original line number Diff line number Diff line Loading @@ -31,9 +31,9 @@ mobs:register_mob("mobs_animal:chicken", { walk_velocity = 1, run_velocity = 3, runaway = true, jump = true, drops = { {name = "mobs:chicken_raw", chance = 1, min = 2, max = 2}, {name = "mobs:chicken_feather", chance = 3, min = 1, max = 2}, }, water_damage = 1, lava_damage = 5, Loading @@ -53,18 +53,21 @@ mobs:register_mob("mobs_animal:chicken", { on_rightclick = function(self, clicker) if mobs:feed_tame(self, clicker, 8, true, true) then return end mobs:protect(self, clicker) mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) if mobs:feed_tame(self, clicker, 8, true, true) then return end if mobs:protect(self, clicker) then return end if mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) then return end end, do_custom = function(self) do_custom = function(self, dtime) self.egg_timer = (self.egg_timer or 0) + dtime if self.egg_timer < 10 then return end self.egg_timer = 0 if self.child or math.random(1, 5000) > 1 then or math.random(1, 100) > 1 then return end Loading Loading @@ -113,14 +116,14 @@ mobs:register_arrow("mobs_animal:egg_entity", { velocity = 6, hit_player = function(self, player) player:punch(self.object, 1.0, { player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, { full_punch_interval = 1.0, damage_groups = {fleshy = 1}, }, nil) end, hit_mob = function(self, player) player:punch(self.object, 1.0, { player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, { full_punch_interval = 1.0, damage_groups = {fleshy = 1}, }, nil) Loading @@ -128,9 +131,9 @@ mobs:register_arrow("mobs_animal:egg_entity", { hit_node = function(self, pos, node) local num = math.random(1, 10) if num == 1 then if math.random(1, 10) > 1 then return end pos.y = pos.y + 1 Loading Loading @@ -165,7 +168,6 @@ mobs:register_arrow("mobs_animal:egg_entity", { ent2.tamed = true ent2.owner = self.playername end end }) Loading Loading @@ -277,3 +279,9 @@ minetest.register_craft({ recipe = "mobs:chicken_raw", output = "mobs:chicken_cooked", }) -- feather minetest.register_craftitem(":mobs:chicken_feather", { description = S("Feather"), inventory_image = "mobs_chicken_feather.png", }) cow.lua +4 −7 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ mobs:register_mob("mobs_animal:cow", { punch_end = 100, }, follow = "farming:wheat", view_range = 7, view_range = 8, replace_rate = 10, -- replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"}, replace_what = { Loading @@ -59,9 +59,9 @@ mobs:register_mob("mobs_animal:cow", { on_rightclick = function(self, clicker) -- feed or tame if mobs:feed_tame(self, clicker, 8, true, true) then return end if mobs:feed_tame(self, clicker, 8, true, true) then return end if mobs:protect(self, clicker) then return end if mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) then return end local tool = clicker:get_wielded_item() local name = clicker:get_player_name() Loading Loading @@ -96,9 +96,6 @@ mobs:register_mob("mobs_animal:cow", { return end mobs:protect(self, clicker) mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) end, }) Loading init.lua +3 −7 Original line number Diff line number Diff line local path = minetest.get_modpath("mobs_animal") -- Intllib local S if minetest.get_modpath("intllib") then S = intllib.Getter() else S = function(s) return s end end -- Load support for intllib. local MP = minetest.get_modpath(minetest.get_current_modname()) local S, NS = dofile(MP.."/intllib.lua") mobs.intllib = S -- Animals Loading Loading
bee.lua +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ mobs:register_mob("mobs_animal:bee", { hp_min = 1, hp_max = 2, armor = 200, collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.2, 0.2}, collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.5, 0.2}, visual = "mesh", mesh = "mobs_bee.x", textures = { Loading
bunny.lua +4 −7 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ mobs:register_mob("mobs_animal:bunny", { punch_start = 16, punch_end = 24, }, follow = {"farming:carrot", "farming_plus:carrot_item"}, follow = {"farming:carrot", "farming_plus:carrot_item", "default:grass_1"}, view_range = 8, replace_rate = 10, replace_what = {"farming:carrot_7", "farming:carrot_8", "farming_plus:carrot"}, Loading @@ -50,9 +50,9 @@ mobs:register_mob("mobs_animal:bunny", { on_rightclick = function(self, clicker) -- feed or tame if mobs:feed_tame(self, clicker, 4, true, true) then return end if mobs:feed_tame(self, clicker, 4, true, true) then return end if mobs:protect(self, clicker) then return end if mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) then return end -- Monty Python tribute local item = clicker:get_wielded_item() Loading @@ -73,9 +73,6 @@ mobs:register_mob("mobs_animal:bunny", { return end mobs:protect(self, clicker) mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) end, attack_type = "dogfight", Loading
chicken.lua +56 −48 Original line number Diff line number Diff line Loading @@ -31,9 +31,9 @@ mobs:register_mob("mobs_animal:chicken", { walk_velocity = 1, run_velocity = 3, runaway = true, jump = true, drops = { {name = "mobs:chicken_raw", chance = 1, min = 2, max = 2}, {name = "mobs:chicken_feather", chance = 3, min = 1, max = 2}, }, water_damage = 1, lava_damage = 5, Loading @@ -53,18 +53,21 @@ mobs:register_mob("mobs_animal:chicken", { on_rightclick = function(self, clicker) if mobs:feed_tame(self, clicker, 8, true, true) then return end mobs:protect(self, clicker) mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) if mobs:feed_tame(self, clicker, 8, true, true) then return end if mobs:protect(self, clicker) then return end if mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) then return end end, do_custom = function(self) do_custom = function(self, dtime) self.egg_timer = (self.egg_timer or 0) + dtime if self.egg_timer < 10 then return end self.egg_timer = 0 if self.child or math.random(1, 5000) > 1 then or math.random(1, 100) > 1 then return end Loading Loading @@ -113,14 +116,14 @@ mobs:register_arrow("mobs_animal:egg_entity", { velocity = 6, hit_player = function(self, player) player:punch(self.object, 1.0, { player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, { full_punch_interval = 1.0, damage_groups = {fleshy = 1}, }, nil) end, hit_mob = function(self, player) player:punch(self.object, 1.0, { player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, { full_punch_interval = 1.0, damage_groups = {fleshy = 1}, }, nil) Loading @@ -128,9 +131,9 @@ mobs:register_arrow("mobs_animal:egg_entity", { hit_node = function(self, pos, node) local num = math.random(1, 10) if num == 1 then if math.random(1, 10) > 1 then return end pos.y = pos.y + 1 Loading Loading @@ -165,7 +168,6 @@ mobs:register_arrow("mobs_animal:egg_entity", { ent2.tamed = true ent2.owner = self.playername end end }) Loading Loading @@ -277,3 +279,9 @@ minetest.register_craft({ recipe = "mobs:chicken_raw", output = "mobs:chicken_cooked", }) -- feather minetest.register_craftitem(":mobs:chicken_feather", { description = S("Feather"), inventory_image = "mobs_chicken_feather.png", })
cow.lua +4 −7 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ mobs:register_mob("mobs_animal:cow", { punch_end = 100, }, follow = "farming:wheat", view_range = 7, view_range = 8, replace_rate = 10, -- replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"}, replace_what = { Loading @@ -59,9 +59,9 @@ mobs:register_mob("mobs_animal:cow", { on_rightclick = function(self, clicker) -- feed or tame if mobs:feed_tame(self, clicker, 8, true, true) then return end if mobs:feed_tame(self, clicker, 8, true, true) then return end if mobs:protect(self, clicker) then return end if mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) then return end local tool = clicker:get_wielded_item() local name = clicker:get_player_name() Loading Loading @@ -96,9 +96,6 @@ mobs:register_mob("mobs_animal:cow", { return end mobs:protect(self, clicker) mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) end, }) Loading
init.lua +3 −7 Original line number Diff line number Diff line local path = minetest.get_modpath("mobs_animal") -- Intllib local S if minetest.get_modpath("intllib") then S = intllib.Getter() else S = function(s) return s end end -- Load support for intllib. local MP = minetest.get_modpath(minetest.get_current_modname()) local S, NS = dofile(MP.."/intllib.lua") mobs.intllib = S -- Animals Loading