From bf50a17f2e9991122036c46886f6221ef7f75fee Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Tue, 31 Jan 2023 18:13:36 +0000 Subject: [PATCH] Limit spawning of mobs outside y axis as well --- mods/ENTITIES/mcl_mobs/spawning.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 3ff5184ca..32640a5bf 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -815,7 +815,7 @@ if mobs_spawn then repeat local goal_pos = get_next_mob_spawn_pos(pos) - if math.abs(goal_pos.x) <= SPAWN_MAPGEN_LIMIT and math.abs(goal_pos.z) <= SPAWN_MAPGEN_LIMIT then + if math.abs(goal_pos.x) <= SPAWN_MAPGEN_LIMIT and math.abs(pos.y) <= SPAWN_MAPGEN_LIMIT and math.abs(goal_pos.z) <= SPAWN_MAPGEN_LIMIT then local spawning_position_list = find_nodes_in_area_under_air( {x = goal_pos.x, y = y_min, z = goal_pos.z}, {x = goal_pos.x, y = y_max, z = goal_pos.z},