From 2f0ca063e98aae4223460ed3d9df96cc41573f37 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 29 Aug 2022 21:13:52 +0200 Subject: [PATCH] Make monsters less likely to spawn in groups --- mods/ENTITIES/mcl_mobs/spawning.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 120cae9dc1..f6e9f81097 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -525,6 +525,7 @@ if mobs_spawn then local mob_def = mob_library_worker_table[mob_index] local spawn_in_group = minetest.registered_entities[mob_def.name].spawn_in_group or 4 local spawn_in_group_min = minetest.registered_entities[mob_def.name].spawn_in_group_min or 1 + local mob_type = minetest.registered_entities[mob_def.name].type if spawn_check(spawning_position,mob_def) then if mob_def.type_of_spawning == "water" then spawning_position = get_water_spawn(spawning_position) @@ -537,7 +538,7 @@ if mobs_spawn then end --everything is correct, spawn mob local object - if spawn_in_group then + if spawn_in_group and ( mob_type ~= "monster" or math.random(5) == 1 ) then object = spawn_group(spawning_position,mob_def,{minetest.get_node(vector.offset(spawning_position,0,-1,0)).name},spawn_in_group,spawn_in_group_min) else object = minetest.add_entity(spawning_position, mob_def.name)