minetest.register_entity

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

minetest.register_entity(entity_name, entity_definition)
  • entity_name — The registered name of the entity, used as the hash key for minetest.regsitered_entities and as the name property of each instantiated LuaEntity.
  • entity_definition — A table of LuaEntity properties.

Description

Registers a LuaEntity that can be spawned as a LuaEntitySAO using minetest.add_entity(...).

Mbox important.png This article is incomplete.
Please help expand this article to include more useful information.
Mbox information.png This article is missing examples.
Feel free to add them.

Object property table

{
    hp_max = 1,
    physical = true,
    weight = 5,
    collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
    visual = "cube"/"sprite"/"upright_sprite"/"mesh"/"wielditem",
    visual_size = {x=1, y=1},
    mesh = "model",
    textures = {}, -- number of required textures depends on visual
    colors = {}, -- number of required colors depends on visual
    spritediv = {x=1, y=1},
    initial_sprite_basepos = {x=0, y=0},
    is_visible = true,
    makes_footstep_sound = false,
    automatic_rotate = false,
}
Mbox important.png This article is incomplete.
Please help expand this article to include more useful information.
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox