Merge pull request 'Make enderman hostile towards endermites and fix it's behavior on other dimensions' (#3501) from anarquimico/MineClone2:enderman_hostile_endermite into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3501 Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>damage
commit
e15d0cd5a0
|
@ -345,7 +345,8 @@ mcl_mobs.register_mob("mobs_mc:enderman", {
|
||||||
self:teleport(nil)
|
self:teleport(nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else return end
|
end
|
||||||
|
|
||||||
-- AGRESSIVELY WARP/CHASE PLAYER BEHAVIOUR HERE.
|
-- AGRESSIVELY WARP/CHASE PLAYER BEHAVIOUR HERE.
|
||||||
if self.state == "attack" then
|
if self.state == "attack" then
|
||||||
if self.attack then
|
if self.attack then
|
||||||
|
@ -358,11 +359,13 @@ mcl_mobs.register_mob("mobs_mc:enderman", {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else --if not attacking try to tp to the dark
|
else --if not attacking try to tp to the dark
|
||||||
|
if dim == 'overworld' then
|
||||||
local light = minetest.get_node_light(enderpos)
|
local light = minetest.get_node_light(enderpos)
|
||||||
if light and light > minetest.LIGHT_MAX then
|
if light and light > minetest.LIGHT_MAX then
|
||||||
self:teleport(nil)
|
self:teleport(nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
-- ARROW / DAYTIME PEOPLE AVOIDANCE BEHAVIOUR HERE.
|
-- ARROW / DAYTIME PEOPLE AVOIDANCE BEHAVIOUR HERE.
|
||||||
-- Check for arrows and people nearby.
|
-- Check for arrows and people nearby.
|
||||||
|
|
||||||
|
@ -387,6 +390,7 @@ mcl_mobs.register_mob("mobs_mc:enderman", {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- PROVOKED BEHAVIOUR HERE.
|
-- PROVOKED BEHAVIOUR HERE.
|
||||||
local enderpos = self.object:get_pos()
|
local enderpos = self.object:get_pos()
|
||||||
if self.provoked == "broke_contact" then
|
if self.provoked == "broke_contact" then
|
||||||
|
@ -444,6 +448,22 @@ mcl_mobs.register_mob("mobs_mc:enderman", {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- ATTACK ENDERMITE
|
||||||
|
local enderpos = self.object:get_pos()
|
||||||
|
if math.random(1,140) == 1 then
|
||||||
|
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.attack = mob
|
||||||
|
self.state = 'attack'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- TAKE AND PLACE STUFF BEHAVIOUR BELOW.
|
-- TAKE AND PLACE STUFF BEHAVIOUR BELOW.
|
||||||
if not mobs_griefing then
|
if not mobs_griefing then
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue