User:Kaeza/Test

From Minetest Developer Wiki
Revision as of 23:14, 18 June 2013 by Kaeza (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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})