User:Kaeza/Test
Jump to navigation
Jump to search
add_entity
minetest.add_entity(pos, name)
Spawns a Lua-defined entity at the specified position.
The name
parameter specifies the name of the entity to add, which
must have been previously registered via a call to register_entity
.
Returns the new entity as a LuaObjectRef.
Example
local pos
local entity = minetest.add_entity(pos, "foo_mod:bar_entity")
-- Do something with it.
entity:setacceleration({x=0, y=-1, z=0})