diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index 055e3807..28b5482d 100755 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -317,6 +317,7 @@ function mobs:register_mob(name, def) local nod = minetest.get_node_or_nil(pos) if not nod then return end ; -- print ("standing in "..nod.name) local nodef = minetest.registered_nodes[nod.name] + if not nodef then return end pos.y = pos.y + 1 -- water @@ -1185,8 +1186,10 @@ end local obj = nil for _, oir in pairs(minetest.get_objects_inside_radius(hitter:getpos(), 5)) do obj = oir:get_luaentity() - if obj then + if obj + and obj.name == self.name then if obj.group_attack == true + and not obj.tamed and obj.state ~= "attack" then obj.do_attack(obj, hitter, 1) end diff --git a/mods/mobs/cow.lua b/mods/mobs/cow.lua index 789e7bc6..c7b5455f 100755 --- a/mods/mobs/cow.lua +++ b/mods/mobs/cow.lua @@ -6,6 +6,7 @@ mobs:register_mob("mobs:cow", { type = "animal", -- aggressive, does 5 damage to player when threatened passive = false, + group_attack = true, attack_type = "dogfight", damage = 4, -- health & armor diff --git a/mods/mobs/goat.lua b/mods/mobs/goat.lua index 626aa68e..9265b080 100755 --- a/mods/mobs/goat.lua +++ b/mods/mobs/goat.lua @@ -6,6 +6,7 @@ mobs:register_mob("mobs:goat", { type = "animal", -- aggressive, does 5 damage to player when threatened passive = false, + group_attack = true, attack_type = "dogfight", damage = 4, -- health & armor diff --git a/mods/mobs/npc.lua b/mods/mobs/npc.lua index 4e9e6e5e..b7814e77 100755 --- a/mods/mobs/npc.lua +++ b/mods/mobs/npc.lua @@ -13,6 +13,7 @@ mobs:register_mob("mobs:npc", { type = "npc", -- aggressive, deals 6 damage to player/monster when hit passive = false, + group_attack = true, damage = 5, -- 3 damages if tamed attack_type = "dogfight", attacks_monsters = true, diff --git a/mods/mobs/warthog.lua b/mods/mobs/warthog.lua index 1bf184ea..da0dae8a 100755 --- a/mods/mobs/warthog.lua +++ b/mods/mobs/warthog.lua @@ -6,6 +6,7 @@ mobs:register_mob("mobs:pumba", { type = "animal", -- aggressive, deals 5 damage to player when threatened passive = false, + group_attack = true, attack_type = "dogfight", damage = 4, -- health & armor