From Starbounder - Starbound Wiki
Jump to: navigation, search


These monster hooks are stubs for global functions that monster scripts can define, which will be called by the C++ engine. Documentation for it was removed from the assets, but an old and outdated (2015) version can be found here:



Called (once) after the monster is added to the world. Note that the monster's position may not yet be valid


The update loop handler. Called once every scriptDelta (defined in the .monstertype file) ticks. The dt argument indicates the number of seconds since the last invocation.


Not tested, but probably works the same way object's onInteract() works.


Called after the monster has taken damage.
'args' is a map of info about the damage, structured as:

sourceId = <entity id of entity that caused the damage>,
damage = <numeric amount of damage that was taken>,
sourceDamage = <numeric amount of damage that was originally dealt>,
sourceKind = <string kind of damage being applied, as defined in "damageKind" value in a *.projectile config>

Note that "sourceDamage" can be higher than "damage" if - for instance - some damage was blocked by a shield.


Called each update to determine if the monster should die. If not defined in the monster's lua, will default to returning true when the monster's health has been depleted.

Returns boolean - true if the monster can die, false to keep the monster alive


Called when shouldDie has returned true and the monster and is about to be removed from the world

Quick Navigation