diff --git a/api.lua b/api.lua index 3599fb4..6fdb5a2 100644 --- a/api.lua +++ b/api.lua @@ -88,6 +88,7 @@ local mob_chance_multiplier = tonumber(settings:get("mob_chance_multiplier") or local peaceful_player_enabled = settings:get_bool("enable_peaceful_player") local mob_smooth_rotate = settings:get_bool("mob_smooth_rotate") ~= false local mob_height_fix = settings:get_bool("mob_height_fix") ~= false +local mob_log_spawn = settings:get_bool("mob_log_spawn") == true local active_mobs = 0 -- get loop timers for node and main functions @@ -4100,6 +4101,12 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, inter -- .. minetest.pos_to_string(pos) .. " on " -- .. node.name .. " near " .. neighbors[1]) + if mob_log_spawn then + + minetest.log("[MOBS] Spawned " .. name .. " at " + .. minetest.pos_to_string(pos)) + end + if on_spawn and mob then on_spawn(mob:get_luaentity(), pos) end diff --git a/api.txt b/api.txt index cf04172..8d7c645 100644 --- a/api.txt +++ b/api.txt @@ -744,6 +744,7 @@ the tools own meta to override the default. External Settings for "minetest.conf" ------------------------------------ + 'mob_log_spawn' When True will log spawning position of mobs. 'mob_node_timer_interval' How often mobs get nodes around them (0.25 is default) for every 1/4 second. 'mob_main_timer_interval' How often mobs run main functions (1.0 is default) for diff --git a/readme.MD b/readme.MD index 51d406d..8af900a 100644 --- a/readme.MD +++ b/readme.MD @@ -35,6 +35,7 @@ https://forum.minetest.net/viewtopic.php?f=11&t=9917 * Added 'mobs_attack_creatura' setting so that monsters can attack Creatura mobs * Nodes can be added to 'runaway_from' table * Better Mineclone2 compatibility with api, items and recipes +* Added 'mob_log_spawn' setting to log spawning of mobs and position ### Version 1.56 diff --git a/settingtypes.txt b/settingtypes.txt index 18db2bf..fcec162 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -58,6 +58,8 @@ mob_smooth_rotate (Smooth rotation for mobs) bool true # Fix Mob Height if too low so they cannot escape through specific nodes mob_height_fix (Fix Mob Height) bool true +mob_log_spawn (Log Mob Spawning) bool false + [Pathfinding] # Enable pathfinding (default Enabled) mob_pathfinding_enable (Enable pathfinding) bool true