Update api.lua

This commit is contained in:
ShadowOfHassen 2024-02-29 20:55:39 +00:00
parent 0fb7c78ac0
commit 847b1da2f7
1 changed files with 3 additions and 4 deletions

View File

@ -134,6 +134,7 @@ mobs.mob_class = {
owner = "",
order = "",
jump_height = 4,
alliance = nil,
lifetimer = 180, -- 3 minutes
texture_mods = "",
view_range = 5,
@ -191,7 +192,6 @@ mobs.mob_class = {
attack_animals = false,
attack_players = true,
attack_npcs = true,
attack_allies = false,
friendly_fire = true,
facing_fence = false,
_breed_countdown = nil,
@ -1914,7 +1914,7 @@ function mob_class:general_attack()
or (not self.attack_animals and ent.type == "animal")
or (not self.attack_monsters and ent.type == "monster")
or (not self.attack_npcs and ent.type == "npc")
or (not self.attack_allies and self.alliance == ent.alliance)
or (not self.alliance == nil and self.alliance == ent.alliance)
or (self.specific_attack and not check_for(ent.name, self.specific_attack)) then
objs[n] = nil
--print("- mob", n, self.name, ent.name)
@ -3605,7 +3605,7 @@ minetest.register_entity(":" .. name, setmetatable({
},
name = name,
alliance = def.allaince,
alliance = def.alliance,
type = def.type,
_nametag = def.nametag,
attack_type = def.attack_type,
@ -3691,7 +3691,6 @@ minetest.register_entity(":" .. name, setmetatable({
attack_animals = def.attack_animals,
attack_players = def.attack_players,
attack_npcs = def.attack_npcs,
attack_allies = def.attack_allies,
specific_attack = def.specific_attack,
friendly_fire = def.friendly_fire,
runaway_from = def.runaway_from,