mirror of
				https://codeberg.org/tenplus1/mobs_redo.git
				synced 2025-10-31 15:45:22 +01:00 
			
		
		
		
	Update api.lua
This commit is contained in:
		
							
								
								
									
										6
									
								
								api.lua
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								api.lua
									
									
									
									
									
								
							| @@ -191,6 +191,7 @@ mobs.mob_class = { | ||||
| 	attack_animals = false, | ||||
| 	attack_players = true, | ||||
| 	attack_npcs = true, | ||||
| 	attack_allies = false, | ||||
| 	friendly_fire = true, | ||||
| 	facing_fence = false, | ||||
| 	_breed_countdown = nil, | ||||
| @@ -1913,6 +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 (self.specific_attack and not check_for(ent.name, self.specific_attack)) then | ||||
| 				objs[n] = nil | ||||
| --print("- mob", n, self.name, ent.name) | ||||
| @@ -3603,6 +3605,7 @@ minetest.register_entity(":" .. name, setmetatable({ | ||||
| 	}, | ||||
|  | ||||
| 	name = name, | ||||
| 	alliance = def.allaince, | ||||
| 	type = def.type, | ||||
| 	_nametag = def.nametag, | ||||
| 	attack_type = def.attack_type, | ||||
| @@ -3688,6 +3691,7 @@ 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, | ||||
| @@ -4968,4 +4972,4 @@ minetest.register_chatcommand("clear_mobs", { | ||||
|  | ||||
| 		minetest.chat_send_player(name, S("@1 mobs removed.", count)) | ||||
| 	end | ||||
| }) | ||||
| }) | ||||
		Reference in New Issue
	
	Block a user