Make enderman hostile towards endermites

This commit is contained in:
anarquimico 2023-03-02 08:28:06 -03:00
parent d83c6fe906
commit d0022db2a5

@ -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