Only zombies attack villagers

This commit is contained in:
cora 2022-08-01 00:36:33 +02:00
parent 6cb9e936fc
commit b7dc1311ba
3 changed files with 4 additions and 1 deletions

View File

@ -1947,7 +1947,7 @@ local monster_attack = function(self)
-- find specific mob to attack, failing that attack player/npc/animal
if specific_attack(self.specific_attack, name)
and (type == "player" or type == "npc"
and (type == "player" or ( type == "npc" and self.attack_npcs )
or (type == "animal" and self.attack_animals == true)) then
p = player:get_pos()
@ -4025,6 +4025,7 @@ minetest.register_entity(name, {
dogshoot_count_max = def.dogshoot_count_max or 5,
dogshoot_count2_max = def.dogshoot_count2_max or (def.dogshoot_count_max or 5),
attack_animals = def.attack_animals or false,
attack_npcs = def.attack_npcs or false,
specific_attack = def.specific_attack,
runaway_from = def.runaway_from,
owner_loyal = def.owner_loyal,

View File

@ -133,6 +133,7 @@ mcl_mobs:register_mob("mobs_mc:villager_zombie", {
view_range = 16,
fear_height = 4,
harmed_by_heal = true,
attack_npcs = true,
})
mcl_mobs:spawn_specific(

View File

@ -95,6 +95,7 @@ local zombie = {
view_range = 16,
attack_type = "dogfight",
harmed_by_heal = true,
attack_npcs = true,
}
mcl_mobs:register_mob("mobs_mc:zombie", zombie)