Basic Entity Scripts Entry Points

Back

You can define these functions in your basic entity Lua scripts and they will be called by the engine. The first group of functions are called during initialization in the Initialization Lua state. The next group of functions are called during normal gameplay in the Game Lua state.

Basic entity Lua scripts are Lua scripts found in the BasicEnts directory (and its subdirectories) of your package.

Called During (Type) Initialization

string __get_mesh();
string __get_mesh2();
bool   __get_pulsates();
float  __get_scale();
float  __get_touch_dist();

Called During Main Game

void   __on_touch(int level, BlockPos bp);
bool   __get_can_use(int level, BlockPos bp);
string __get_use_msg(int level, BlockPos bp);
void   __on_use(int level, BlockPos bp);
void   __on_use2(int level, BlockPos bp);
void   __on_render(int level, BlockPos bp);