Add method 'sneaker.spawn' to spawn entity

This commit is contained in:
AntumDeluge 2017-05-29 00:58:55 -07:00
parent d336800b35
commit 1dc5b92314
2 changed files with 7 additions and 1 deletions

@ -12,3 +12,9 @@ function sneeker.log_debug(message)
sneeker.log('[DEBUG] ' .. message)
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
if count >= sneeker.spawn_cap then return end -- Max sneekers already exist
minetest.add_entity(pos, sneeker.mob_name)
sneeker.spawn(pos)
end
})