Added angry pig sound, cows attack when threatened

master
tenplus1 2015-03-06 09:59:56 +00:00
parent f56d969d00
commit 33a65e58f5
3 changed files with 6 additions and 5 deletions

View File

@ -4,10 +4,10 @@
mobs:register_mob("mobs:cow", {
-- animal, monster, npc, barbarian
type = "animal",
-- aggressive, does 5 damage to player when threatened
-- aggressive, does 4 damage to player when threatened
passive = false,
attack_type = "dogfight",
damage = 5,
damage = 4,
-- health & armor
hp_min = 5, hp_max = 20, armor = 200,
-- textures and model

BIN
sounds/mobs_pig_angry.ogg Normal file

Binary file not shown.

View File

@ -23,14 +23,15 @@ mobs:register_mob("mobs:pumba", {
makes_footstep_sound = true,
sounds = {
random = "mobs_pig",
attack = "mobs_pig_angry",
},
-- speed and jump
walk_velocity = 2,
run_velocity = 3,
jump = true,
-- follows wheat
follow = "farming:wheat",
view_range = 5,
follow = "default:apple",
view_range = 10,
-- drops raw pork when dead
drops = {
{name = "mobs:pork_raw",
@ -50,7 +51,7 @@ mobs:register_mob("mobs:pumba", {
-- can be tamed by feeding 8 wheat (will not attack when tamed)
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
if item:get_name() == "farming:wheat" then
if item:get_name() == "default:apple" then
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)