Add Loggin Actions to mob spawning, and fixed log message for spawn egg use
This commit is contained in:
parent
e5d4e410ae
commit
fc362f0e9c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user