From d0022db2a5633333ab2aa7ae6b5647d286415e88 Mon Sep 17 00:00:00 2001 From: anarquimico Date: Thu, 2 Mar 2023 08:28:06 -0300 Subject: [PATCH] Make enderman hostile towards endermites --- mods/ENTITIES/mobs_mc/enderman.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index 873255862..36876f420 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -297,6 +297,7 @@ mcl_mobs.register_mob("mobs_mc:enderman", { run_velocity = 3.4, damage = 7, reach = 2, + -- specific_attack = "mobs_mc:endermite", particlespawners = psdefs, drops = { {name = "mcl_throwing:ender_pearl", @@ -387,6 +388,7 @@ mcl_mobs.register_mob("mobs_mc:enderman", { end end end + -- PROVOKED BEHAVIOUR HERE. local enderpos = self.object:get_pos() if self.provoked == "broke_contact" then @@ -444,6 +446,20 @@ mcl_mobs.register_mob("mobs_mc:enderman", { end end + -- ATTACK ENDERMITE + local enderpos = self.object:get_pos() + local mobsnear = minetest.get_objects_inside_radius(enderpos, 64) + for n=1, #mobsnear do + local mob = mobsnear[n] + if mob then + local entity = mob:get_luaentity() + if entity and entity.name == "mobs_mc:endermite" then + self.state = 'attack' + self.attack = mob + end + end + end + -- TAKE AND PLACE STUFF BEHAVIOUR BELOW. if not mobs_griefing then return