Page 1 of 1

Lua API Events

Posted: Wed Jun 03, 2020 11:47 am
by slaugh7er
Some extra events in the Lua API to help encourage more scripted mods
EVENTS
on_entity_created: Entity
allow scripts to easily access entities that are created (will be call for any and all compatible entities)

on_entity_removed: Entity
allow scripts to easily access entities that are just about to be removed (will be call for any and all compatible entities)

on_entity_changed_chunk: Entity, ChunkNew, ChunkOld
useful for tracking and entity as it moves through the maps chunks
an example could be biters that will scan a chunk for a nest and if no nest is found then they build one in that chunk

on_player_changed_chunk: Player, ChunkNew, ChunkOld
same as above but filtered to players only
EXTENSIONS
player.cursor.x 'X'
position of players cursor/ mouse
player.cursor.y 'Y'
position of players cursor/ mouse
player.cursor.entity
Entity under the players cursor/ mouse (optional) (almost the same as player.selected)

WHY
the more events available the more powerful the mods can be it also opens up the Lua API to more people
this also adds easily accessible events with a considerable amount of power even if they must be filtered

Re: Lua API Events

Posted: Wed Jun 03, 2020 10:23 pm
by ssilk
moved to modding interface requests - ssilk