mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 03:07:32 +01:00
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,11 +359,13 @@ mcl_mobs.register_mob("mobs_mc:enderman", {
|
||||
end
|
||||
end
|
||||
else --if not attacking try to tp to the dark
|
||||
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.
|
||||
-- Check for arrows and people nearby.
|
||||
|
||||
@ -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
Block a user