shears added

This commit is contained in:
tenplus1 2015-03-19 11:21:48 +00:00
parent d54eca9622
commit c0e52ec485
3 changed files with 27 additions and 2 deletions

View File

@ -29,7 +29,7 @@ This mod contains the following additions:
Changelog:
beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop
1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus
1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus, also shears added to get wool from sheep
1.04- Added mating for sheep, cows and hogs... feed animals to make horny and hope for a baby which is half size, will grow up quick though :)
1.03- Added mob drop/replace feature so that chickens can drop eggs, cow/sheep can eat grass/wheat etc.
1.02- Sheared sheep are remembered and spawn shaven, Warthogs will attack when threatened, Api additions

View File

@ -73,10 +73,13 @@ mobs:register_mob("mobs:sheep", {
end
return
end
if clicker:get_inventory() and not self.gotten and self.child == false then
-- need shears to get wool from sheep
if clicker:get_inventory() and item:get_name() == "mobs:shears" and not self.gotten and self.child == false then
self.gotten = true -- shaved
if minetest.registered_items["wool:white"] then
clicker:get_inventory():add_item("main", ItemStack("wool:white "..math.random(1,3)))
item:add_wear(65535/100)
clicker:set_wielded_item(item)
end
self.object:set_properties({
textures = {"mobs_sheep_shaved.png"},
@ -89,3 +92,25 @@ mobs:register_mob("mobs:sheep", {
mobs:register_spawn("mobs:sheep", {"default:dirt_with_grass", "ethereal:green_dirt_top"}, 20, 8, 9000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:sheep", "Sheep", "wool_white.png", 1)
-- shears tool (right click sheep to shear)
minetest.register_tool("mobs:shears", {
description = "Steel Shears (right-click sheep to shear)",
inventory_image = "mobs_shears.png",
tool_capabilities = {
full_punch_interval = 1,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=0},
}
})
minetest.register_craft({
output = 'mobs:shears',
recipe = {
{'', 'default:steel_ingot', ''},
{'', 'default:stick', 'default:steel_ingot'},
}
})

BIN
textures/mobs_shears.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B