mirror of
https://codeberg.org/tenplus1/mobs_animal.git
synced 2025-07-21 17:40:29 +02:00
Compare commits
37 Commits
Author | SHA1 | Date | |
---|---|---|---|
766f6ff754 | |||
39f4ffa2d9 | |||
4ada017824 | |||
1962f9f720 | |||
b9605e9fac | |||
5d5b984853 | |||
97b8bffd67 | |||
e7dc5350a6 | |||
e00766a6d7 | |||
d500e7f893 | |||
cac5e8328f | |||
bcb158d241 | |||
99cf81611a | |||
a7b08928c5 | |||
630c73cdd7 | |||
eba1ac7f10 | |||
86987aadde | |||
5293673547 | |||
0873ef4119 | |||
498b3fbf10 | |||
01bdea97c7 | |||
620bdfe33d | |||
061cbb10b7 | |||
ba305db9ca | |||
e3ca168e7e | |||
66be327567 | |||
8ef65e2292 | |||
03acd94c3b | |||
a5ed775333 | |||
b98fc2186f | |||
a14d29bd55 | |||
0aa7224ebc | |||
9776d5dfd4 | |||
4a8cd67f6d | |||
ad864bd1c8 | |||
99794a8cdc | |||
24bf26253c |
34
bee.lua
34
bee.lua
@ -1,5 +1,5 @@
|
||||
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
|
||||
-- Bee by KrupnoPavel (.b3d model by sirrobzeroone)
|
||||
|
||||
@ -68,10 +68,10 @@ mobs:alias_mob("mobs:bee", "mobs_animal:bee")
|
||||
|
||||
-- honey
|
||||
|
||||
core.register_craftitem(":mobs:honey", {
|
||||
minetest.register_craftitem(":mobs:honey", {
|
||||
description = S("Honey"),
|
||||
inventory_image = "mobs_honey_inv.png",
|
||||
on_use = core.item_eat(4),
|
||||
on_use = minetest.item_eat(4),
|
||||
groups = {food_honey = 1, food_sugar = 1}
|
||||
})
|
||||
|
||||
@ -79,7 +79,7 @@ mobs.add_eatable("mobs:honey", 4)
|
||||
|
||||
-- beehive (1 in 4 chance of spawning bee when placed)
|
||||
|
||||
core.register_node(":mobs:beehive", {
|
||||
minetest.register_node(":mobs:beehive", {
|
||||
description = S("Beehive"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"mobs_beehive.png"},
|
||||
@ -93,7 +93,7 @@ core.register_node(":mobs:beehive", {
|
||||
|
||||
on_construct = function(pos)
|
||||
|
||||
local meta = core.get_meta(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local gui_bg = default and default.gui_bg .. default.gui_bg_img .. default.gui_slots or ""
|
||||
|
||||
meta:set_string("formspec", "size[8,6]"
|
||||
@ -110,10 +110,10 @@ core.register_node(":mobs:beehive", {
|
||||
|
||||
if placer and placer:is_player() then
|
||||
|
||||
core.set_node(pos, {name = "mobs:beehive", param2 = 1})
|
||||
minetest.set_node(pos, {name = "mobs:beehive", param2 = 1})
|
||||
|
||||
if math.random(4) == 1 then
|
||||
core.add_entity(pos, "mobs_animal:bee")
|
||||
minetest.add_entity(pos, "mobs_animal:bee")
|
||||
end
|
||||
end
|
||||
end,
|
||||
@ -121,7 +121,7 @@ core.register_node(":mobs:beehive", {
|
||||
on_punch = function(pos, node, puncher)
|
||||
|
||||
-- yep, bee's don't like having their home punched by players
|
||||
core.after(0.2, function()
|
||||
minetest.after(0.2, function()
|
||||
|
||||
local hp = puncher and puncher:get_hp()
|
||||
|
||||
@ -138,7 +138,7 @@ core.register_node(":mobs:beehive", {
|
||||
|
||||
can_dig = function(pos,player) -- can only dig when no honey inside
|
||||
|
||||
local meta = core.get_meta(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
return meta:get_inventory():is_empty("beehive")
|
||||
end
|
||||
@ -146,14 +146,14 @@ core.register_node(":mobs:beehive", {
|
||||
|
||||
-- beehive recipe
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:beehive",
|
||||
recipe = {{"mobs:bee","mobs:bee","mobs:bee"}}
|
||||
})
|
||||
|
||||
-- honey block and craft recipes
|
||||
|
||||
core.register_node(":mobs:honey_block", {
|
||||
minetest.register_node(":mobs:honey_block", {
|
||||
description = S("Honey Block"),
|
||||
tiles = {"mobs_honey_block.png"},
|
||||
groups = {snappy = 3, flammable = 2},
|
||||
@ -161,7 +161,7 @@ core.register_node(":mobs:honey_block", {
|
||||
sounds = mobs.node_sound_dirt_defaults()
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:honey_block",
|
||||
recipe = {
|
||||
{"mobs:honey", "mobs:honey", "mobs:honey"},
|
||||
@ -170,7 +170,7 @@ core.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:honey 9",
|
||||
recipe = {
|
||||
{"mobs:honey_block"}
|
||||
@ -179,7 +179,7 @@ core.register_craft({
|
||||
|
||||
-- beehive workings
|
||||
|
||||
core.register_abm({
|
||||
minetest.register_abm({
|
||||
nodenames = {"mobs:beehive"},
|
||||
interval = 12,
|
||||
chance = 6,
|
||||
@ -188,18 +188,18 @@ core.register_abm({
|
||||
action = function(pos, node)
|
||||
|
||||
-- bee's only make honey during the day
|
||||
local tod = (core.get_timeofday() or 0) * 24000
|
||||
local tod = (minetest.get_timeofday() or 0) * 24000
|
||||
|
||||
if tod < 5500 or tod > 18500 then return end
|
||||
|
||||
local meta = core.get_meta(pos) ; if not meta then return end
|
||||
local meta = minetest.get_meta(pos) ; if not meta then return end
|
||||
local inv = meta:get_inventory()
|
||||
local honey = inv:get_stack("beehive", 1):get_count()
|
||||
|
||||
if honey > 11 then return end -- return if hive full
|
||||
|
||||
-- no flowers no honey, nuff said!
|
||||
if #core.find_nodes_in_area_under_air(
|
||||
if #minetest.find_nodes_in_area_under_air(
|
||||
{x = pos.x - 4, y = pos.y - 3, z = pos.z - 4},
|
||||
{x = pos.x + 4, y = pos.y + 3, z = pos.z + 4}, "group:flower") > 3 then
|
||||
|
||||
|
30
bunny.lua
30
bunny.lua
@ -1,5 +1,5 @@
|
||||
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
|
||||
-- Bunny by ExeterDad
|
||||
|
||||
@ -69,7 +69,7 @@ mobs:register_mob("mobs_animal:bunny", {
|
||||
end
|
||||
|
||||
-- set special bunny attributes
|
||||
local staticdata = core.serialize({
|
||||
local staticdata = minetest.serialize({
|
||||
type = "monster",
|
||||
attack_type = "dogfight",
|
||||
health = 20,
|
||||
@ -84,7 +84,7 @@ mobs:register_mob("mobs_animal:bunny", {
|
||||
})
|
||||
|
||||
-- add evil bunny
|
||||
local obj = core.add_entity(
|
||||
local obj = minetest.add_entity(
|
||||
self.object:get_pos(), "mobs_animal:bunny", staticdata)
|
||||
|
||||
obj:set_properties({textures = {"mobs_bunny_evil.png"}, hp_max = 20})
|
||||
@ -99,19 +99,19 @@ mobs:register_mob("mobs_animal:bunny", {
|
||||
local pos = self.object:get_pos() ; pos.y = pos.y - 1
|
||||
|
||||
-- white snowy bunny
|
||||
if core.find_node_near(pos, 1,
|
||||
if minetest.find_node_near(pos, 1,
|
||||
{"default:snow", "default:snowblock", "default:dirt_with_snow"}) then
|
||||
self.base_texture = {"mobs_bunny_white.png"}
|
||||
self.object:set_properties({textures = self.base_texture})
|
||||
|
||||
-- brown desert bunny
|
||||
elseif core.find_node_near(pos, 1,
|
||||
elseif minetest.find_node_near(pos, 1,
|
||||
{"default:desert_sand", "default:desert_stone"}) then
|
||||
self.base_texture = {"mobs_bunny_brown.png"}
|
||||
self.object:set_properties({textures = self.base_texture})
|
||||
|
||||
-- grey stone bunny
|
||||
elseif core.find_node_near(pos, 1,
|
||||
elseif minetest.find_node_near(pos, 1,
|
||||
{"default:stone", "default:gravel"}) then
|
||||
self.base_texture = {"mobs_bunny_grey.png"}
|
||||
self.object:set_properties({textures = self.base_texture})
|
||||
@ -127,7 +127,7 @@ if not mobs.custom_spawn_animal then
|
||||
|
||||
local spawn_on = "default:dirt_with_grass"
|
||||
|
||||
if core.get_modpath("ethereal") then
|
||||
if minetest.get_modpath("ethereal") then
|
||||
spawn_on = "ethereal:prairie_dirt"
|
||||
end
|
||||
|
||||
@ -154,10 +154,10 @@ mobs:alias_mob("mobs:bunny", "mobs_animal:bunny")
|
||||
|
||||
-- raw rabbit
|
||||
|
||||
core.register_craftitem(":mobs:rabbit_raw", {
|
||||
minetest.register_craftitem(":mobs:rabbit_raw", {
|
||||
description = S("Raw Rabbit"),
|
||||
inventory_image = "mobs_rabbit_raw.png",
|
||||
on_use = core.item_eat(3),
|
||||
on_use = minetest.item_eat(3),
|
||||
groups = {food_meat_raw = 1, food_rabbit_raw = 1}
|
||||
})
|
||||
|
||||
@ -165,16 +165,16 @@ mobs.add_eatable("mobs:rabbit_raw", 3)
|
||||
|
||||
-- cooked rabbit
|
||||
|
||||
core.register_craftitem(":mobs:rabbit_cooked", {
|
||||
minetest.register_craftitem(":mobs:rabbit_cooked", {
|
||||
description = S("Cooked Rabbit"),
|
||||
inventory_image = "mobs_rabbit_cooked.png",
|
||||
on_use = core.item_eat(5),
|
||||
on_use = minetest.item_eat(5),
|
||||
groups = {food_meat = 1, food_rabbit = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:rabbit_cooked", 5)
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs:rabbit_cooked",
|
||||
recipe = "mobs:rabbit_raw",
|
||||
@ -183,15 +183,15 @@ core.register_craft({
|
||||
|
||||
-- rabbit hide and recipes
|
||||
|
||||
core.register_craftitem(":mobs:rabbit_hide", {
|
||||
minetest.register_craftitem(":mobs:rabbit_hide", {
|
||||
description = S("Rabbit Hide"),
|
||||
inventory_image = "mobs_rabbit_hide.png",
|
||||
groups = {flammable = 2, pelt = 1}
|
||||
})
|
||||
|
||||
core.register_craft({type = "fuel", recipe = "mobs:rabbit_hide", burntime = 2})
|
||||
minetest.register_craft({type = "fuel", recipe = "mobs:rabbit_hide", burntime = 2})
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:leather",
|
||||
recipe = {
|
||||
{"mobs:rabbit_hide", "mobs:rabbit_hide"},
|
||||
|
46
chicken.lua
46
chicken.lua
@ -1,5 +1,5 @@
|
||||
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
|
||||
-- Chicken by JK Murray and Sirrobzeroone
|
||||
|
||||
@ -84,13 +84,13 @@ mobs:register_mob("mobs_animal:chicken", {
|
||||
|
||||
if math.random(100) == 1 then
|
||||
|
||||
core.add_item(pos, "mobs:egg")
|
||||
minetest.add_item(pos, "mobs:egg")
|
||||
|
||||
core.sound_play("default_place_node_hard",
|
||||
minetest.sound_play("default_place_node_hard",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 5}, true)
|
||||
|
||||
elseif math.random(100) < 3 then
|
||||
core.add_item(pos, "mobs:chicken_feather")
|
||||
minetest.add_item(pos, "mobs:chicken_feather")
|
||||
end
|
||||
end
|
||||
})
|
||||
@ -101,7 +101,7 @@ if not mobs.custom_spawn_animal then
|
||||
|
||||
local spawn_on = {"default:dirt_with_grass"}
|
||||
|
||||
if core.get_modpath("ethereal") then
|
||||
if minetest.get_modpath("ethereal") then
|
||||
spawn_on = {"ethereal:bamboo_dirt", "ethereal:prairie_dirt"}
|
||||
end
|
||||
|
||||
@ -136,7 +136,7 @@ mobs:register_arrow("mobs_animal:egg_entity", {
|
||||
|
||||
hit_player = function(self, player)
|
||||
|
||||
player:punch(core.get_player_by_name(self.playername) or 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)
|
||||
@ -156,10 +156,10 @@ mobs:register_arrow("mobs_animal:egg_entity", {
|
||||
|
||||
pos.y = pos.y + 1
|
||||
|
||||
local nod = core.get_node_or_nil(pos)
|
||||
local nod = minetest.get_node_or_nil(pos)
|
||||
|
||||
if not nod or not core.registered_nodes[nod.name]
|
||||
or core.registered_nodes[nod.name].walkable == true then
|
||||
if not nod or not minetest.registered_nodes[nod.name]
|
||||
or minetest.registered_nodes[nod.name].walkable == true then
|
||||
return
|
||||
end
|
||||
|
||||
@ -182,10 +182,10 @@ local mobs_shoot_egg = function (item, player, pointed_thing)
|
||||
|
||||
local playerpos = player:get_pos()
|
||||
|
||||
core.sound_play("default_place_node_hard",
|
||||
minetest.sound_play("default_place_node_hard",
|
||||
{pos = playerpos, gain = 1.0, max_hear_distance = 5}, true)
|
||||
|
||||
local obj = core.add_entity({
|
||||
local obj = minetest.add_entity({
|
||||
x = playerpos.x,
|
||||
y = playerpos.y +1.5,
|
||||
z = playerpos.z
|
||||
@ -216,7 +216,7 @@ end
|
||||
|
||||
-- egg
|
||||
|
||||
core.register_node(":mobs:egg", {
|
||||
minetest.register_node(":mobs:egg", {
|
||||
description = S("Chicken Egg"),
|
||||
tiles = {"mobs_chicken_egg.png"},
|
||||
inventory_image = "mobs_chicken_egg.png",
|
||||
@ -235,7 +235,7 @@ core.register_node(":mobs:egg", {
|
||||
sounds = mobs.node_sound_defaults(),
|
||||
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
core.set_node(pos, {name = "mobs:egg", param2 = 1})
|
||||
minetest.set_node(pos, {name = "mobs:egg", param2 = 1})
|
||||
end,
|
||||
|
||||
on_use = mobs_shoot_egg
|
||||
@ -243,16 +243,16 @@ core.register_node(":mobs:egg", {
|
||||
|
||||
-- fried egg and recipe
|
||||
|
||||
core.register_craftitem(":mobs:chicken_egg_fried", {
|
||||
minetest.register_craftitem(":mobs:chicken_egg_fried", {
|
||||
description = S("Fried Egg"),
|
||||
inventory_image = "mobs_chicken_egg_fried.png",
|
||||
on_use = core.item_eat(2),
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = {food_egg_fried = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:chicken_egg_fried", 2)
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
recipe = "mobs:egg",
|
||||
output = "mobs:chicken_egg_fried"
|
||||
@ -260,10 +260,10 @@ core.register_craft({
|
||||
|
||||
-- raw chicken
|
||||
|
||||
core.register_craftitem(":mobs:chicken_raw", {
|
||||
minetest.register_craftitem(":mobs:chicken_raw", {
|
||||
description = S("Raw Chicken"),
|
||||
inventory_image = "mobs_chicken_raw.png",
|
||||
on_use = core.item_eat(2),
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = {food_meat_raw = 1, food_chicken_raw = 1}
|
||||
})
|
||||
|
||||
@ -271,16 +271,16 @@ mobs.add_eatable("mobs:chicken_raw", 2)
|
||||
|
||||
-- cooked chicken and recipe
|
||||
|
||||
core.register_craftitem(":mobs:chicken_cooked", {
|
||||
minetest.register_craftitem(":mobs:chicken_cooked", {
|
||||
description = S("Cooked Chicken"),
|
||||
inventory_image = "mobs_chicken_cooked.png",
|
||||
on_use = core.item_eat(6),
|
||||
on_use = minetest.item_eat(6),
|
||||
groups = {food_meat = 1, food_chicken = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:chicken_cooked", 6)
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
recipe = "mobs:chicken_raw",
|
||||
output = "mobs:chicken_cooked"
|
||||
@ -288,10 +288,10 @@ core.register_craft({
|
||||
|
||||
-- feather and fuel
|
||||
|
||||
core.register_craftitem(":mobs:chicken_feather", {
|
||||
minetest.register_craftitem(":mobs:chicken_feather", {
|
||||
description = S("Feather"),
|
||||
inventory_image = "mobs_chicken_feather.png",
|
||||
groups = {flammable = 2, feather = 1}
|
||||
})
|
||||
|
||||
core.register_craft({type = "fuel", recipe = "mobs:chicken_feather", burntime = 1})
|
||||
minetest.register_craft({type = "fuel", recipe = "mobs:chicken_feather", burntime = 1})
|
||||
|
90
cow.lua
90
cow.lua
@ -1,10 +1,10 @@
|
||||
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
|
||||
-- should cows eat grass blocks and mess up the environment?
|
||||
|
||||
local eat_gb = core.settings:get_bool("mobs_animal.eat_grass_block")
|
||||
local replace_what = { {"group:grass", "air", 0} }
|
||||
local eat_gb = minetest.settings:get_bool("mobs_animal.eat_grass_block")
|
||||
local replace_what = { {"group:grass", "mobs:dung", 0} }
|
||||
|
||||
if eat_gb then
|
||||
table.insert(replace_what, {"default:dirt_with_grass", "default:dirt", -1})
|
||||
@ -18,7 +18,7 @@ mobs:register_mob("mobs_animal:cow", {
|
||||
attack_type = "dogfight",
|
||||
attack_npcs = false,
|
||||
reach = 2,
|
||||
damage = 4, attack_chance = 98,
|
||||
damage = 4,
|
||||
hp_min = 10,
|
||||
hp_max = 20,
|
||||
armor = 100,
|
||||
@ -41,7 +41,8 @@ mobs:register_mob("mobs_animal:cow", {
|
||||
pushable = true,
|
||||
drops = {
|
||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2},
|
||||
{name = "maptools:silver_coin", chance = 10, min = 0, max = 1,},
|
||||
},
|
||||
water_damage = 0.01,
|
||||
lava_damage = 5,
|
||||
@ -104,7 +105,7 @@ mobs:register_mob("mobs_animal:cow", {
|
||||
|
||||
if self.gotten == true then
|
||||
|
||||
core.chat_send_player(name, S("Cow already milked!"))
|
||||
minetest.chat_send_player(name, S("Cow already milked!"))
|
||||
|
||||
return
|
||||
end
|
||||
@ -129,7 +130,7 @@ mobs:register_mob("mobs_animal:cow", {
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
core.add_item(pos, {name = ret_item})
|
||||
minetest.add_item(pos, {name = ret_item})
|
||||
end
|
||||
|
||||
self.gotten = true -- milked
|
||||
@ -176,27 +177,27 @@ mobs:alias_mob("mobs:cow", "mobs_animal:cow")
|
||||
|
||||
-- bucket of milk
|
||||
|
||||
core.register_craftitem(":mobs:bucket_milk", {
|
||||
minetest.register_craftitem(":mobs:bucket_milk", {
|
||||
description = S("Bucket of Milk"),
|
||||
inventory_image = "mobs_bucket_milk.png",
|
||||
stack_max = 1,
|
||||
on_use = core.item_eat(8, "bucket:bucket_empty"),
|
||||
on_use = minetest.item_eat(8, "bucket:bucket_empty"),
|
||||
groups = {food_milk = 1, drink = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:bucket_milk", 8)
|
||||
|
||||
-- glass of milk and recipes
|
||||
core.register_craftitem(":mobs:glass_milk", {
|
||||
minetest.register_craftitem(":mobs:glass_milk", {
|
||||
description = S("Glass of Milk"),
|
||||
inventory_image = "mobs_glass_milk.png",
|
||||
on_use = core.item_eat(2, "vessels:drinking_glass"),
|
||||
on_use = minetest.item_eat(2, "vessels:drinking_glass"),
|
||||
groups = {food_milk_glass = 1, vessel = 1, drink = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:glass_milk", 2)
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:glass_milk 4",
|
||||
recipe = {
|
||||
{"vessels:drinking_glass", "vessels:drinking_glass"},
|
||||
@ -206,7 +207,7 @@ core.register_craft({
|
||||
replacements = {{"mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:bucket_milk",
|
||||
recipe = {
|
||||
{"group:food_milk_glass", "group:food_milk_glass"},
|
||||
@ -220,10 +221,10 @@ core.register_craft({
|
||||
|
||||
-- butter and recipe
|
||||
|
||||
core.register_craftitem(":mobs:butter", {
|
||||
minetest.register_craftitem(":mobs:butter", {
|
||||
description = S("Butter"),
|
||||
inventory_image = "mobs_butter.png",
|
||||
on_use = core.item_eat(1),
|
||||
on_use = minetest.item_eat(1),
|
||||
groups = {food_butter = 1}
|
||||
})
|
||||
|
||||
@ -231,11 +232,11 @@ mobs.add_eatable("mobs:butter", 1)
|
||||
|
||||
local salt_item = "default:sapling" -- some saplings are high in sodium
|
||||
|
||||
if core.get_modpath("farming") and farming and farming.mod then
|
||||
if minetest.get_modpath("farming") and farming and farming.mod then
|
||||
salt_item = "farming:salt"
|
||||
end
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:butter",
|
||||
recipe = {{"mobs:bucket_milk", salt_item}},
|
||||
replacements = {{"mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
@ -243,16 +244,16 @@ core.register_craft({
|
||||
|
||||
-- cheese wedge and recipe
|
||||
|
||||
core.register_craftitem(":mobs:cheese", {
|
||||
minetest.register_craftitem(":mobs:cheese", {
|
||||
description = S("Cheese"),
|
||||
inventory_image = "mobs_cheese.png",
|
||||
on_use = core.item_eat(4),
|
||||
on_use = minetest.item_eat(4),
|
||||
groups = {food_cheese = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:cheese", 4)
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs:cheese",
|
||||
recipe = "mobs:bucket_milk",
|
||||
@ -262,7 +263,7 @@ core.register_craft({
|
||||
|
||||
-- cheese block and recipe
|
||||
|
||||
core.register_node(":mobs:cheeseblock", {
|
||||
minetest.register_node(":mobs:cheeseblock", {
|
||||
description = S("Cheese Block"),
|
||||
tiles = {"mobs_cheeseblock.png"},
|
||||
is_ground_content = false,
|
||||
@ -270,7 +271,7 @@ core.register_node(":mobs:cheeseblock", {
|
||||
sounds = mobs.node_sound_dirt_defaults()
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:cheeseblock",
|
||||
recipe = {
|
||||
{"group:food_cheese", "group:food_cheese", "group:food_cheese"},
|
||||
@ -279,30 +280,59 @@ core.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:cheese 9",
|
||||
recipe = {{"mobs:cheeseblock"}}
|
||||
})
|
||||
|
||||
-- NALC: Dung (from factory's fertilizer)
|
||||
minetest.register_node(
|
||||
":mobs:dung",
|
||||
{
|
||||
tiles = {"default_dirt.png"},
|
||||
inventory_image = "mobs_dung.png",
|
||||
description = "Cow dung",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
is_ground_content = true,
|
||||
groups = {snappy = 3, attached_node = 1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.1875, 0.1875, -0.4375, 0.1875},
|
||||
{-0.125, -0.4375, -0.125, 0.125, -0.375, 0.125},
|
||||
{0, -0.375, -0.0625, 0.0625, -0.3125, 0.0625},
|
||||
{0, -0.3125, -0.0625, 0.0625, -0.25, 0},
|
||||
{-0.0625, -0.375, -0.0625, 0, -0.3125, 0},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "mobs:dung",
|
||||
burntime = "8",
|
||||
})
|
||||
|
||||
-- check for either of the wood bucket mods and add compatibility
|
||||
|
||||
local wb = core.get_modpath("wooden_bucket")
|
||||
local bw = core.get_modpath("bucket_wooden")
|
||||
local wb = minetest.get_modpath("wooden_bucket")
|
||||
local bw = minetest.get_modpath("bucket_wooden")
|
||||
|
||||
if wb or bw then
|
||||
|
||||
local return_item = wb and "wooden_bucket:bucket_wood_empty"
|
||||
or "bucket_wooden:bucket_empty"
|
||||
|
||||
core.register_craftitem(":mobs:wooden_bucket_milk", {
|
||||
minetest.register_craftitem(":mobs:wooden_bucket_milk", {
|
||||
description = S("Wooden Bucket of Milk"),
|
||||
inventory_image = "mobs_wooden_bucket_milk.png",
|
||||
stack_max = 1,
|
||||
on_use = core.item_eat(8, return_item),
|
||||
on_use = minetest.item_eat(8, return_item),
|
||||
groups = {food_milk = 1, flammable = 3, drink = 1}
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:glass_milk 4",
|
||||
recipe = {
|
||||
{"vessels:drinking_glass", "vessels:drinking_glass"},
|
||||
@ -312,7 +342,7 @@ if wb or bw then
|
||||
replacements = {{"mobs:wooden_bucket_milk", return_item}}
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:wooden_bucket_milk",
|
||||
recipe = {
|
||||
{"group:food_milk_glass", "group:food_milk_glass"},
|
||||
@ -324,7 +354,7 @@ if wb or bw then
|
||||
}
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "mobs:butter",
|
||||
recipe = {{"mobs:wooden_bucket_milk", salt_item}},
|
||||
replacements = {{"mobs:wooden_bucket_milk", return_item}}
|
||||
|
107
goat.lua
Executable file
107
goat.lua
Executable file
@ -0,0 +1,107 @@
|
||||
|
||||
-- Goat by DonBatman
|
||||
|
||||
mobs:register_mob("mobs_animal:goat", {
|
||||
-- animal, monster, npc, barbarian
|
||||
type = "animal",
|
||||
-- aggressive, does 5 damage to player when threatened
|
||||
passive = false,
|
||||
group_attack = true,
|
||||
attack_type = "dogfight",
|
||||
reach = 2,
|
||||
damage = 3,
|
||||
-- health & armor
|
||||
hp_min = 10,
|
||||
hp_max = 20,
|
||||
armor = 200,
|
||||
-- textures and model
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.75, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_goat.b3d",
|
||||
drawtype = "front",
|
||||
textures = {
|
||||
{"mobs_goat_white.png"},
|
||||
{"mobs_goat_brown.png"},
|
||||
{"mobs_goat_grey.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
visual_size = {x=2,y=2},
|
||||
-- sounds
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_sheep",
|
||||
},
|
||||
-- speed and jump
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 3,
|
||||
jump = true,
|
||||
-- drops raw meat when dead
|
||||
drops = {
|
||||
{name = "mobs:meat_raw",
|
||||
chance = 1, min = 2, max = 4},
|
||||
{name = "maptools:silver_coin",
|
||||
chance = 10, min = 1, max = 1,},
|
||||
},
|
||||
-- damaged by
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 25, speed_run = 30,
|
||||
stand_start = 0, stand_end = 60, -- head down/up
|
||||
walk_start = 80, walk_end = 110, -- walk
|
||||
run_start = 160, run_end = 198, -- walk
|
||||
punch_start = 120, punch_end = 150, -- attack
|
||||
},
|
||||
-- follows wheat
|
||||
follow = {"farming:wheat"},
|
||||
view_range = 10,
|
||||
-- replace grass/wheat with air (eat)
|
||||
replace_rate = 50,
|
||||
replace_what = {"group:flora"},
|
||||
replace_with = "air",
|
||||
on_rightclick = function(self, clicker)
|
||||
-- feed or tame
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
local tool = clicker:get_wielded_item()
|
||||
|
||||
-- milk goat with empty bucket
|
||||
if tool:get_name() == "bucket:bucket_empty" then
|
||||
if self.child == true then
|
||||
return
|
||||
end
|
||||
|
||||
if self.gotten == true then
|
||||
minetest.chat_send_player(clicker:get_player_name(),
|
||||
"Goat already milked!")
|
||||
return
|
||||
end
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
|
||||
inv:remove_item("main", "bucket:bucket_empty")
|
||||
|
||||
if inv:room_for_item("main", {name = "mobs:bucket_milk"}) then
|
||||
clicker:get_inventory():add_item("main", "mobs:bucket_milk")
|
||||
else
|
||||
local pos = self.object:getpos()
|
||||
pos.y = pos.y + 0.5
|
||||
minetest.add_item(pos, {name = "mobs:bucket_milk"})
|
||||
end
|
||||
|
||||
self.gotten = true -- milked
|
||||
return
|
||||
end
|
||||
|
||||
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
|
||||
end,
|
||||
})
|
||||
-- spawn on dirt_with_grass between -1 and 20 light, 1 in 20000 chance, 1 goat in area up to 31000 in height
|
||||
mobs:spawn_specific("mobs_animal:goat", {"default:dirt_with_grass"}, {"air"}, -1, 20, 30, 20000, 1, -31000, 31000, true)
|
||||
-- register spawn egg
|
||||
mobs:register_egg("mobs_animal:goat", "Goat", "mobs_goat_inv.png", 1)
|
||||
mobs:alias_mob("mobs:goat", "mobs_animal:goat")
|
9
init.lua
9
init.lua
@ -1,8 +1,8 @@
|
||||
|
||||
-- translation and mod path
|
||||
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local path = core.get_modpath(core.get_current_modname()) .. "/"
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||
|
||||
-- Check for custom mob spawn file
|
||||
|
||||
@ -18,7 +18,7 @@ end
|
||||
|
||||
local function ddoo(mob)
|
||||
|
||||
if core.settings:get_bool("mobs_animal." .. mob) == false then
|
||||
if minetest.settings:get_bool("mobs_animal." .. mob) == false then
|
||||
print("[Mobs_Animal] " .. mob .. " disabled!")
|
||||
return
|
||||
end
|
||||
@ -38,6 +38,7 @@ ddoo("bunny") -- ExeterDad
|
||||
ddoo("kitten") -- Jordach/BFD
|
||||
ddoo("penguin") -- D00Med
|
||||
ddoo("panda") -- AspireMint
|
||||
dofile(path .. "goat.lua") -- NALC(sys4 fork MFF)
|
||||
|
||||
-- Load custom spawning if found
|
||||
|
||||
@ -47,7 +48,7 @@ end
|
||||
|
||||
-- Lucky Blocks
|
||||
|
||||
if core.get_modpath("lucky_block") then
|
||||
if minetest.get_modpath("lucky_block") then
|
||||
dofile(path .. "lucky_block.lua")
|
||||
end
|
||||
|
||||
|
44
kitten.lua
44
kitten.lua
@ -1,8 +1,8 @@
|
||||
|
||||
-- translation and hairball setting
|
||||
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local hairball = core.settings:get_bool("mobs_animal.hairball") ~= false
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local hairball = minetest.settings:get_bool("mobs_animal.hairball") ~= false
|
||||
|
||||
-- custom kitty types
|
||||
|
||||
@ -59,8 +59,9 @@ mobs:register_mob("mobs_animal:kitten", {
|
||||
stoodup_start = 0, stoodup_end = 0,
|
||||
},
|
||||
follow = {
|
||||
"mobs_animal:rat", "group:food_fish_raw", "mobs:glass_milk",
|
||||
"mobs_fish:tropical", "mobs_fish:clownfish", "xocean:fish_edible"
|
||||
"mobs_animal:rat", "group:food_fish_raw",
|
||||
"mobs_fish:tropical", "mobs_fish:clownfish", "xocean:fish_edible",
|
||||
"group:fishraw" -- NALC: Group from fishing mod
|
||||
},
|
||||
view_range = 8,
|
||||
|
||||
@ -74,7 +75,7 @@ mobs:register_mob("mobs_animal:kitten", {
|
||||
|
||||
tmp = kitten_types[n]
|
||||
|
||||
if core.find_node_near(pos, 1, tmp.nodes) then
|
||||
if minetest.find_node_near(pos, 1, tmp.nodes) then
|
||||
|
||||
self.base_texture = tmp.skins
|
||||
self.object:set_properties({textures = tmp.skins})
|
||||
@ -88,24 +89,7 @@ mobs:register_mob("mobs_animal:kitten", {
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- what are we holding?
|
||||
local tool = clicker:get_wielded_item()
|
||||
local item = tool and tool:get_name()
|
||||
|
||||
if mobs:feed_tame(self, clicker, 4, true, true) then
|
||||
|
||||
-- return empty glass if kitten drinks a glass of milk
|
||||
if item == "mobs:glass_milk" and core.get_modpath("vessels")
|
||||
and not mobs.is_creative(clicker:get_player_name()) then
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
core.add_item(pos, "vessels:drinking_glass")
|
||||
end
|
||||
|
||||
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, 50, 50, 90, false, nil) then return end
|
||||
|
||||
@ -136,9 +120,9 @@ mobs:register_mob("mobs_animal:kitten", {
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
core.add_item(pos, "mobs:hairball")
|
||||
minetest.add_item(pos, "mobs:hairball")
|
||||
|
||||
core.sound_play("default_dig_snappy", {
|
||||
minetest.sound_play("default_dig_snappy", {
|
||||
pos = pos, gain = 1.0, max_hear_distance = 5}, true)
|
||||
end
|
||||
})
|
||||
@ -149,7 +133,7 @@ if not mobs.custom_spawn_animal then
|
||||
|
||||
local spawn_on = "default:dirt_with_grass"
|
||||
|
||||
if core.get_modpath("ethereal") then
|
||||
if minetest.get_modpath("ethereal") then
|
||||
spawn_on = "ethereal:grove_dirt"
|
||||
end
|
||||
|
||||
@ -187,7 +171,7 @@ local hairball_items = {
|
||||
"ethereal:fish_tetra"
|
||||
}
|
||||
|
||||
core.register_craftitem(":mobs:hairball", {
|
||||
minetest.register_craftitem(":mobs:hairball", {
|
||||
description = S("Hairball"),
|
||||
inventory_image = "mobs_hairball.png",
|
||||
|
||||
@ -198,11 +182,11 @@ core.register_craftitem(":mobs:hairball", {
|
||||
local newpos = {x = pos.x + dir.x, y = pos.y + dir.y + 1.5, z = pos.z + dir.z}
|
||||
local item = hairball_items[math.random(1, #hairball_items)]
|
||||
|
||||
if item ~= "" and core.registered_items[item] then
|
||||
core.add_item(newpos, {name = item})
|
||||
if item ~= "" and minetest.registered_items[item] then
|
||||
minetest.add_item(newpos, {name = item})
|
||||
end
|
||||
|
||||
core.sound_play("default_place_node_hard", {
|
||||
minetest.sound_play("default_place_node_hard", {
|
||||
pos = newpos, gain = 1.0, max_hear_distance = 5}, true)
|
||||
|
||||
itemstack:take_item()
|
||||
|
@ -25,7 +25,7 @@ lucky_block:add_blocks({
|
||||
|
||||
-- if nyancat found add special block
|
||||
|
||||
if core.registered_nodes["default:nyancat"] then
|
||||
if minetest.registered_nodes["default:nyancat"] then
|
||||
|
||||
lucky_block:add_blocks({
|
||||
{"tro", "default:nyancat", "mobs_kitten", true}
|
||||
|
BIN
models/mobs_goat.b3d
Normal file
BIN
models/mobs_goat.b3d
Normal file
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
|
||||
-- Panda by AspireMint (CC BY-SA 3.0)
|
||||
|
||||
@ -60,7 +60,7 @@ mobs:register_mob("mobs_animal:panda", {
|
||||
|
||||
-- where to spawn (ethereal bamboo biome only)
|
||||
|
||||
if core.get_modpath("ethereal") and not mobs.custom_spawn_animal then
|
||||
if minetest.get_modpath("ethereal") and not mobs.custom_spawn_animal then
|
||||
|
||||
mobs:spawn({
|
||||
name = "mobs_animal:panda",
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
|
||||
-- Penguin by D00Med
|
||||
|
||||
@ -41,7 +41,8 @@ stepheight = 0.6,
|
||||
floats = 0,
|
||||
follow = {
|
||||
"group:food_fish_raw", "mobs_fish:clownfish", "mobs_fish:tropical",
|
||||
"mobs_fish:clownfish_set", "mobs_fish:tropical_set", "xocean:fish_edible"
|
||||
"mobs_fish:clownfish_set", "mobs_fish:tropical_set", "xocean:fish_edible",
|
||||
"group:fishraw" -- Edit from NALC: Group from fishing mod
|
||||
},
|
||||
view_range = 5,
|
||||
|
||||
|
8
rat.lua
8
rat.lua
@ -1,5 +1,5 @@
|
||||
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
|
||||
-- Rat by KPavel and PilzAdam (B3D model by sirrobzeroone)
|
||||
|
||||
@ -93,16 +93,16 @@ mobs:alias_mob("mobs:rat", "mobs_animal:rat")
|
||||
|
||||
-- cooked rat, yummy!
|
||||
|
||||
core.register_craftitem(":mobs:rat_cooked", {
|
||||
minetest.register_craftitem(":mobs:rat_cooked", {
|
||||
description = S("Cooked Rat"),
|
||||
inventory_image = "mobs_cooked_rat.png",
|
||||
on_use = core.item_eat(3),
|
||||
on_use = minetest.item_eat(3),
|
||||
groups = {food_rat = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:rat_cooked", 3)
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs:rat_cooked",
|
||||
recipe = "mobs_animal:rat",
|
||||
|
28
sheep.lua
28
sheep.lua
@ -1,12 +1,12 @@
|
||||
|
||||
-- translation and localize function
|
||||
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local random = math.random
|
||||
|
||||
-- should sheep eat grass blocks and mess up the environment?
|
||||
|
||||
local eat_gb = core.settings:get_bool("mobs_animal.eat_grass_block")
|
||||
local eat_gb = minetest.settings:get_bool("mobs_animal.eat_grass_block")
|
||||
local replace_what = { {"group:grass", "air", -1} }
|
||||
|
||||
if eat_gb then
|
||||
@ -169,7 +169,7 @@ for _, col in ipairs(all_colours) do
|
||||
----------------------------------------------------
|
||||
pos.y = pos.y + 0.5 -- spawn child a little higher
|
||||
|
||||
local mob = core.add_entity(pos, parent1.name)
|
||||
local mob = minetest.add_entity(pos, parent1.name)
|
||||
local ent2 = mob:get_luaentity()
|
||||
|
||||
-- remove horns from parents' texture string, lambs dont have horns
|
||||
@ -275,7 +275,7 @@ for _, col in ipairs(all_colours) do
|
||||
if itemname == "mobs:shears" then
|
||||
|
||||
if self.gotten ~= false or self.child ~= false
|
||||
or name ~= self.owner or not core.get_modpath("wool") then
|
||||
or name ~= self.owner or not minetest.get_modpath("wool") then
|
||||
return
|
||||
end
|
||||
|
||||
@ -283,7 +283,7 @@ for _, col in ipairs(all_colours) do
|
||||
self.drops = drops_gotten
|
||||
self.food = 0 -- reset food
|
||||
|
||||
local obj = core.add_item(
|
||||
local obj = minetest.add_item(
|
||||
self.object:get_pos(),
|
||||
ItemStack("wool:" .. col[1] .. " " .. random(3))
|
||||
)
|
||||
@ -320,7 +320,7 @@ for _, col in ipairs(all_colours) do
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
-- add new coloured sheep
|
||||
local mob = core.add_entity(pos, "mobs_animal:sheep_" .. colr)
|
||||
local mob = minetest.add_entity(pos, "mobs_animal:sheep_" .. colr)
|
||||
local ent = mob:get_luaentity()
|
||||
|
||||
if ent then
|
||||
@ -385,7 +385,7 @@ if not mobs.custom_spawn_animal then
|
||||
|
||||
local max_ht = 400
|
||||
local spawn_on = {"default:dirt_with_grass", "ethereal:green_dirt"}
|
||||
local mod_ethereal = core.get_modpath("ethereal")
|
||||
local mod_ethereal = minetest.get_modpath("ethereal")
|
||||
local spawn_chance = mod_ethereal and 12000 or 8000
|
||||
|
||||
mobs:spawn({
|
||||
@ -471,7 +471,7 @@ if not mobs.custom_spawn_animal then
|
||||
random_sheep(pos, true)
|
||||
|
||||
-- Rest of herd
|
||||
local nods = core.find_nodes_in_area_under_air(
|
||||
local nods = minetest.find_nodes_in_area_under_air(
|
||||
{x = pos.x - 4, y = pos.y - 3, z = pos.z - 4},
|
||||
{x = pos.x + 4, y = pos.y + 3, z = pos.z + 4}, spawn_on)
|
||||
|
||||
@ -486,7 +486,7 @@ if not mobs.custom_spawn_animal then
|
||||
|
||||
pos2.y = pos2.y + 2
|
||||
|
||||
if core.get_node(pos2).name == "air" then
|
||||
if minetest.get_node(pos2).name == "air" then
|
||||
|
||||
-- Add a sheep or lamb
|
||||
random_sheep(pos2, false)
|
||||
@ -503,10 +503,10 @@ mobs:alias_mob("mobs:sheep", "mobs_animal:sheep_white")
|
||||
|
||||
-- raw mutton
|
||||
|
||||
core.register_craftitem(":mobs:mutton_raw", {
|
||||
minetest.register_craftitem(":mobs:mutton_raw", {
|
||||
description = S("Raw Mutton"),
|
||||
inventory_image = "mobs_mutton_raw.png",
|
||||
on_use = core.item_eat(2),
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = {food_meat_raw = 1, food_mutton_raw = 1}
|
||||
})
|
||||
|
||||
@ -514,16 +514,16 @@ mobs.add_eatable("mobs:mutton_raw", 2)
|
||||
|
||||
-- cooked mutton and recipe
|
||||
|
||||
core.register_craftitem(":mobs:mutton_cooked", {
|
||||
minetest.register_craftitem(":mobs:mutton_cooked", {
|
||||
description = S("Cooked Mutton"),
|
||||
inventory_image = "mobs_mutton_cooked.png",
|
||||
on_use = core.item_eat(6),
|
||||
on_use = minetest.item_eat(6),
|
||||
groups = {food_meat = 1, food_mutton = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:mutton_cooked", 6)
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs:mutton_cooked",
|
||||
recipe = "mobs:mutton_raw",
|
||||
|
BIN
textures/mobs_dung.png
Executable file
BIN
textures/mobs_dung.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 635 B |
BIN
textures/mobs_goat_brown.png
Executable file
BIN
textures/mobs_goat_brown.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
BIN
textures/mobs_goat_grey.png
Executable file
BIN
textures/mobs_goat_grey.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
BIN
textures/mobs_goat_inv.png
Normal file
BIN
textures/mobs_goat_inv.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
textures/mobs_goat_white.png
Executable file
BIN
textures/mobs_goat_white.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
19
warthog.lua
19
warthog.lua
@ -1,5 +1,5 @@
|
||||
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
|
||||
-- Warthog originally by KrupnoPavel, B3D model by sirrobzeroone
|
||||
|
||||
@ -12,7 +12,7 @@ mobs:register_mob("mobs_animal:pumba", {
|
||||
owner_loyal = true,
|
||||
attack_npcs = false,
|
||||
reach = 2,
|
||||
damage = 2, attack_chance = 95,
|
||||
damage = 2,
|
||||
hp_min = 10,
|
||||
hp_max = 15,
|
||||
armor = 100,
|
||||
@ -33,7 +33,8 @@ mobs:register_mob("mobs_animal:pumba", {
|
||||
follow = {"default:apple", "farming:potato"},
|
||||
view_range = 10,
|
||||
drops = {
|
||||
{name = "mobs:pork_raw", chance = 1, min = 1, max = 3}
|
||||
{name = "mobs:pork_raw", chance = 1, min = 1, max = 3},
|
||||
{name = "maptools:silver_coin", chance = 10, min = 0, max = 1}
|
||||
},
|
||||
water_damage = 0.01,
|
||||
lava_damage = 5,
|
||||
@ -64,7 +65,7 @@ if not mobs.custom_spawn_animal then
|
||||
local spawn_on = {"default:dirt_with_grass", "default:dry_dirt_with_dry_grass"}
|
||||
local spawn_by = {"group:grass"}
|
||||
|
||||
if core.get_modpath("ethereal") then
|
||||
if minetest.get_modpath("ethereal") then
|
||||
spawn_on = {"ethereal:mushroom_dirt"}
|
||||
spawn_by = {"flowers:mushroom_brown", "flowers:mushroom_red"}
|
||||
end
|
||||
@ -92,10 +93,10 @@ mobs:alias_mob("mobs:pumba", "mobs_animal:pumba")
|
||||
|
||||
-- raw porkchop
|
||||
|
||||
core.register_craftitem(":mobs:pork_raw", {
|
||||
minetest.register_craftitem(":mobs:pork_raw", {
|
||||
description = S("Raw Porkchop"),
|
||||
inventory_image = "mobs_pork_raw.png",
|
||||
on_use = core.item_eat(4),
|
||||
on_use = minetest.item_eat(4),
|
||||
groups = {food_meat_raw = 1, food_pork_raw = 1}
|
||||
})
|
||||
|
||||
@ -103,16 +104,16 @@ mobs.add_eatable("mobs:pork_raw", 4)
|
||||
|
||||
-- cooked porkchop and recipe
|
||||
|
||||
core.register_craftitem(":mobs:pork_cooked", {
|
||||
minetest.register_craftitem(":mobs:pork_cooked", {
|
||||
description = S("Cooked Porkchop"),
|
||||
inventory_image = "mobs_pork_cooked.png",
|
||||
on_use = core.item_eat(8),
|
||||
on_use = minetest.item_eat(8),
|
||||
groups = {food_meat = 1, food_pork = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:pork_cooked", 8)
|
||||
|
||||
core.register_craft({
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs:pork_cooked",
|
||||
recipe = "mobs:pork_raw",
|
||||
|
Reference in New Issue
Block a user