Block Scripts: Game Entry Points

Back

You can define these functions in your block Lua scripts and they will be called by the engine. They are called during normal gameplay in the Game Lua state.

Block Lua scripts are Lua scripts found in the WorldNodes/Nodes directory (and its subdirectories) of your package.

Called During Main Game

void __on_close(int level, BlockPos pos);
void __on_adj_block_changed(
    int level, BlockPos pos, int side,
    string old_bt, string new_bt);
void __change_to(
    int level, BlockPos pos,
    string cur_bt, string new_bt);
bool __get_can_use(int level, BlockPos pos);
string __get_use_msg(int level, BlockPos pos);
void __on_use(int level, BlockPos pos);
void __on_use2(int level, BlockPos pos);
void __on_chunk_update(int level, BlockPos pos);
void __on_block_update(int level, BlockPos pos);
void __on_render(int level, BlockPos pos);