forked from Mirrorlandia_minetest/mod-sneeker
Add method 'sneaker.spawn' to spawn entity
This commit is contained in:
parent
d336800b35
commit
1dc5b92314
@ -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
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user