forked from VoxeLibre/VoxeLibre
TP to dark spots only on the overworld
This commit is contained in:
parent
a3ab67cb55
commit
8c4f2fdd7b
|
@ -346,6 +346,7 @@ mcl_mobs.register_mob("mobs_mc:enderman", {
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- AGRESSIVELY WARP/CHASE PLAYER BEHAVIOUR HERE.
|
||||
if self.state == "attack" then
|
||||
if self.attack then
|
||||
|
@ -358,9 +359,11 @@ mcl_mobs.register_mob("mobs_mc:enderman", {
|
|||
end
|
||||
end
|
||||
else --if not attacking try to tp to the dark
|
||||
local light = minetest.get_node_light(enderpos)
|
||||
if light and light > minetest.LIGHT_MAX then
|
||||
self:teleport(nil)
|
||||
if dim == 'overworld' then
|
||||
local light = minetest.get_node_light(enderpos)
|
||||
if light and light > minetest.LIGHT_MAX then
|
||||
self:teleport(nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- ARROW / DAYTIME PEOPLE AVOIDANCE BEHAVIOUR HERE.
|
||||
|
@ -454,8 +457,8 @@ mcl_mobs.register_mob("mobs_mc:enderman", {
|
|||
if mob then
|
||||
local entity = mob:get_luaentity()
|
||||
if entity and entity.name == "mobs_mc:endermite" then
|
||||
self.state = 'attack'
|
||||
self.attack = mob
|
||||
self.state = 'attack'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue