From fc362f0e9c78b811f15868386e9185b54ac184af Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Thu, 1 Sep 2022 20:13:05 -0600 Subject: [PATCH] Add Loggin Actions to mob spawning, and fixed log message for spawn egg use --- mods/ENTITIES/mcl_mobs/api.lua | 3 ++- mods/ENTITIES/mcl_mobs/spawning.lua | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 8f49e71d4..6b91f2f87 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -4339,7 +4339,8 @@ function mcl_mobs:register_egg(mob, desc, background, addegg, no_creative) pos.y = pos.y - 0.5 local mob = minetest.add_entity(pos, mob) - minetest.log("action", "Mob spawned: "..name.." at "..minetest.pos_to_string(pos)) + local entityname = itemstack:get_name() + minetest.log("action", "Player " ..name.." spawned "..entityname.." at "..minetest.pos_to_string(pos)) local ent = mob:get_luaentity() -- don't set owner if monster or sneak pressed diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index c0167be8c..bdfe1398f 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -538,8 +538,10 @@ if mobs_spawn then local object 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) + minetest.log("action", "A group of mob " .. mob_def.name .. " spawns at " .. minetest.pos_to_string(spawning_position, 1)) else object = minetest.add_entity(spawning_position, mob_def.name) + minetest.log("action", "Mob " .. mob_def.name .. " spawns at " .. minetest.pos_to_string(spawning_position, 1)) end