Add method 'sneaker.spawn' to spawn entity

This commit is contained in:
AntumDeluge 2017-05-29 00:58:55 -07:00 committed by Jordan Irwin
parent 1f04669a68
commit 439646417a
2 changed files with 7 additions and 1 deletions

@ -12,3 +12,9 @@ function sneeker.log_debug(message)
sneeker.log('[DEBUG] ' .. message) sneeker.log('[DEBUG] ' .. message)
end end
end end
-- Spawns a sneaker entity
function sneeker.spawn(pos)
minetest.add_entity(pos, sneeker.mob_name)
sneeker.log_debug('Spawned entity "' .. sneeker.mob_name .. '" at ' .. tostring(pos.x) .. ',' .. tostring(pos.y))
end

@ -52,6 +52,6 @@ minetest.register_abm({
end end
if count >= sneeker.spawn_cap then return end -- Max sneekers already exist if count >= sneeker.spawn_cap then return end -- Max sneekers already exist
minetest.add_entity(pos, sneeker.mob_name) sneeker.spawn(pos)
end end
}) })