Difference between revisions of "User:Kaeza/Test"
Jump to navigation
Jump to search
(Created page with " = add_entity = <code>minetest.add_entity(pos, name)</code> Spawns a Lua-defined entity at the specified position. The <code>name</code> parameter specifies the name of...") |
(No difference)
|
Revision as of 23:14, 18 June 2013
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})