From 8c4f2fdd7b0920d9482e75eda6246369d45c11f6 Mon Sep 17 00:00:00 2001 From: anarquimico Date: Fri, 3 Mar 2023 21:55:56 -0300 Subject: [PATCH] TP to dark spots only on the overworld --- mods/ENTITIES/mobs_mc/enderman.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index d70bf77e9..8415084e1 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -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