minetest.add_entity

From Minetest Developer Wiki
Jump to: navigation, search

Contents

Syntax

minetest.add_entity(pos, "name", [staticdata])

Description

Spawns Lua entitiy at pos. Returns ObjectRef or nil if failed.

Parameters

1: List of 3 vertices (x, y, z)

2: Entity name

3: Optional static data for the entity

Example

local obj = minetest.add_entity({x=0, y=10, z=0}, "mobs:sheep", {naked = true})
if obj then
    obj:setacceleration({x=0, y=-10, z=0})
end
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox