From adbaf2887b718f1d4ca1d98a486f37b14e8ccfcc Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Tue, 25 May 2021 21:53:47 -0700 Subject: [PATCH] Fix LuaDoc sections --- docs/api.html | 2 +- docs/modules/common.lua.html | 2 +- docs/modules/features.lua.html | 2 +- docs/modules/register.lua.html | 76 ++--- docs/modules/settings.lua.html | 2 +- register.lua | 498 +++++++++++++++++---------------- 6 files changed, 293 insertions(+), 289 deletions(-) diff --git a/docs/api.html b/docs/api.html index 54b47aa..80902f6 100644 --- a/docs/api.html +++ b/docs/api.html @@ -70,7 +70,7 @@
generated by LDoc 1.4.6 -Last updated 2021-05-24 22:52:24 +Last updated 2021-05-25 21:52:58
diff --git a/docs/modules/common.lua.html b/docs/modules/common.lua.html index 6ccc205..e4af3f6 100644 --- a/docs/modules/common.lua.html +++ b/docs/modules/common.lua.html @@ -244,7 +244,7 @@
generated by LDoc 1.4.6 -Last updated 2021-05-24 22:52:24 +Last updated 2021-05-25 21:52:58
diff --git a/docs/modules/features.lua.html b/docs/modules/features.lua.html index a7629ec..d859411 100644 --- a/docs/modules/features.lua.html +++ b/docs/modules/features.lua.html @@ -94,7 +94,7 @@
generated by LDoc 1.4.6 -Last updated 2021-05-24 22:52:24 +Last updated 2021-05-25 21:52:58
diff --git a/docs/modules/register.lua.html b/docs/modules/register.lua.html index d47c089..cf86f00 100644 --- a/docs/modules/register.lua.html +++ b/docs/modules/register.lua.html @@ -65,6 +65,10 @@ cmer.register_mob (def) Registers a new mob. + + cmer.register_alias (old_mob, new_mob) + Registers an alias for other mob, e.g. +

Tables

@@ -146,10 +150,6 @@ - - - -
CreatureDef.get_staticdata (self) Must return a table to save mob data (serialization is done by MOB-Engine).
cmer.register_alias (old_mob, new_mob)Registers an alias for other mob, e.g.

@@ -187,6 +187,39 @@ + +
+ + cmer.register_alias (old_mob, new_mob) +
+
+ Registers an alias for other mob, e.g. from other mods or removed ones. + + + + +

Parameters:

+ + +

Returns:

+
    + + bool + true if successful. +
+ + + +

Tables

@@ -1078,39 +1111,6 @@ - -
- - cmer.register_alias (old_mob, new_mob) -
-
- Registers an alias for other mob, e.g. from other mods or removed ones. - - - - -

Parameters:

- - -

Returns:

-
    - - bool - true if successful. -
- - - -
@@ -1119,7 +1119,7 @@
generated by LDoc 1.4.6 -Last updated 2021-05-24 22:52:24 +Last updated 2021-05-25 21:52:58
diff --git a/docs/modules/settings.lua.html b/docs/modules/settings.lua.html index 59ff741..a935ea6 100644 --- a/docs/modules/settings.lua.html +++ b/docs/modules/settings.lua.html @@ -234,7 +234,7 @@
generated by LDoc 1.4.6 -Last updated 2021-05-24 22:52:24 +Last updated 2021-05-25 21:52:58
diff --git a/register.lua b/register.lua index 96de931..86ba789 100644 --- a/register.lua +++ b/register.lua @@ -270,11 +270,6 @@ local function translate_def(def) end ---- Registers a new mob. --- --- @function cmer.register_mob --- @tparam CreatureDef def Creature definition table. --- @treturn bool `true` if successfule. function cmer.register_mob(def) -- returns true if sucessfull if not def or not def.name then throw_error("Can't register mob. No name or Definition given.") @@ -307,242 +302,6 @@ function cmer.register_mob(def) -- returns true if sucessfull return true end ---- Creature definition table. --- --- @table CreatureDef --- @tfield string name E.g. "creatures:sheep". --- @tfield[opt] string nametag String to be displayed in entity's nametag. --- @tfield[opt] bool ownable Flag for defining if entity is ownable by players (default: *false*). --- @tfield StatsDef stats Stats definitions. --- @tfield ModeDef modes Entity bahavior defintions. --- @tfield ModelDef model Model definitions. --- @tfield[opt] table sounds Table of `SoundDef`. Additionally, `play_default_hit` can be set to `false` here to disable default "hit" sound. --- @tfield[opt] table drops List of item `DropDef`. Can also be a function. receives "self" reference. --- @tfield[opt] CombatDef combat Specifies behavior of hostile mobs in "attack" mode. --- @tfield[opt] SpawnDef spawning Defines spawning in world. --- @tfield callback on_activate see: `CreatureDef.on_activate` --- @tfield callback on_step see: `CreatureDef.on_step` --- @tfield callback on_punch see: `CreatureDef.on_punch` --- @tfield callback on_rightclick see: `CreatureDef.on_rightclick` --- @tfield callback on_death see: `CreatureDef.on_death` --- @tfield callback get_staticdata see: `CreatureDef.get_staticdata` - - ---- Definition Tables --- --- @section defs - ---- Stats definition table. --- --- @table StatsDef --- @tparam int hp Full health level (1 HP = 1/2 player heart). --- @tparam[opt] bool hostile Is mob hostile (required for mode "attack") (default: `false`). --- @tparam[opt] int lifetime After which time mob despawns, in seconds. --- @tparam[opt] bool dies_when_tamed Stop despawn when tamed (default: `false`). --- @tparam[opt] int can_jump Height in nodes (default: 0). --- @tparam[opt] bool can_swim Can mob swim or will it drown (default: `false`). --- @tparam[opt] bool can_fly Allows to fly (requires mode "fly") and disable step sounds (default: `false`). --- @tparam[opt] bool can_burn Takes damage of lava (default: `false`). --- @tparam[opt] bool can_panic Runs fast around when hit (requires mode "walk") (default: `false`). --- @tparam[opt] bool has_falldamage Deals damage if falling more than 3 blocks (default: `false`). --- @tparam[opt] bool has_knockback Get knocked back when hit (default: `false`). --- @tparam[opt] bool sneaky Disables step sounds if `true` (default: `false`). --- @tparam[opt] table light Which light level will burn creature (requires can_burn = true). --- --- Example: --- --- light = {min=10, max=15} - ---- Modes definition table. --- --- Entity behavior definition. Behavior types are ***idle***, ***walk***, ***attack***, ***follow***, ***eat***, ***death***, & ***panic***. The sum of all modes must be 1.0. --- --- Example: --- --- modes = { --- idle = {chance=0.3,}, --- walk = {chance=0.7, moving_speed=1,}, --- } --- --- @table ModeDef --- @tfield float chance Number between 0.0 and 1.0 (***NOTE:** sum of all modes MUST be 1.0*). If chance is 0 then mode is not chosen automatically. --- @tfield int duration Time in seconds until the next mode is chosen (depending on chance). --- @tfield[opt] int moving_speed Moving speed (walking/flying/swimming). --- @tfield[opt] int update_yaw Timer in seconds until the looking dir is changed. If moving_speed > 0 then the moving direction is also changed. --- @tfield int radius *(follow & eat modes only)* Search distance in blocks/nodes for player. --- @tfield int timer *(follow & eat modes only)* Time in seconds between each check for player. --- @tfield table items *(follow & eat modes only)* Table of items to make mob follow in format {<Itemname>, <Itemname>}; e.g. {"farming:wheat"}. --- @tfield table nodes *(eat mode only)* Eatable nodes in format {<Itemname>, <Itemname>}; e.g. {"default:dirt\_with\_grass"}. - ---- Model definition table. --- --- @table ModelDef --- @tfield string mesh Mesh name (see Minetest Documentation for supported filetypes). --- @tfield table textures Table of textures (see Minetest Documentation). --- @tfield[opt] NodeBox collisionbox Defines mesh collision box (see Minetest Documentation). --- @tfield[opt] table scale Sets visual scale (default: {x=1, y=1}). --- @tfield[opt] float rotation Sets rotation offset when moving (default: 0.0). --- @tfield[opt] bool backface_culling Set to `true` to enable backface culling. --- @tfield[opt] table animations Table of `AnimationDef` used if defined. --- @tfield[opt] bool collide_with_objects Collide with other objects (default: `true`). - ---- Animations defiintion table. --- --- Animations coincide with modes. E.g. ***idle***, ***walk***, etc. --- --- Example: --- --- animations = { --- idle = {start=25, stop=75, speed=15,}, --- walk = {start=75, stop=100, speed=15,}, --- } --- --- @table AnimationDef --- @tfield int start Start frame. --- @tfield int stop End frame. --- @tfield int speed Animation speed. --- @tfield[opt] bool loop If `false`, animation if just played once (default: `true`). --- @tfield[opt] int duration *(death mode only)* Sets time the animation needs until mob is removed. - ---- Sounds definition table. --- --- Sounds can be defined for these actions: ***on_damage***, ***on_death***, ***swim***, & ***random***. --- --- ***random*** is a table of `SoundDef` that will be played randomly during the modes for which they are set. --- --- Example: --- --- sounds = { --- on_damage = {name="creatures_horse_neigh_02", gain=1.0}, --- on_death = {name="creatures_horse_snort_02", gain=1.0}, --- random = { --- idle = {name="creatures_horse_snort_01", gain=1.0}, --- follow = {name="creatures_horse_neigh_01", gain=1.0, time_min=10}, --- }, --- } --- --- @table SoundsDef --- @tparam[opt] SoundDef on_damage Sound played when entity is hit. --- @tparam[opt] SoundDef on_death Sound played when entity dies. --- @tparam[opt] SoundDef swim Sound played while entity is swimming. --- @tparam[opt] table Random Sounds that will play randomly during specified modes. E.g. ***idle***, ***walk***, etc. - ---- Sound definition. --- --- @table SoundDef --- @tfield string name Sound file name without file type extension (e.g. "my_sound", not "my_sound.ogg") (see Minetest documentation). --- @tfield float gain Sound gain (see Minetest documentation). --- @tfield[opt] int distance Distance in blocks/nodes at which sound can be heard. --- @tfield[opt] int time_min *(random mode only)* Minimum time in seconds between sounds. --- @tfield[opt] int time_max *(random mode only)* Maximum time in seconds between sounds. - ---- Item drops definition table. --- --- Example: --- --- drops = { --- {"default:wood"}, -- 1 item with 100% chance --- {"default:wool", 1, chance=0.3}, -- 1 item with 30% chance --- {"default:stick", {min=2, max=3}, chance=0.2}, -- between 2-3 items with 20% chance --- } --- --- @table DropDef - ---- Combat definition table. --- --- @table CombatDef --- @tfield int attack_damage How much damage is dealt on each hit. --- @tfield[opt] float attack_speed Time in seconds between hits (default: 1.0). --- @tfield float attack_radius Distance in blocks mob can reach to hit. --- @tfield bool search_enemy `true` to search enemies to attack. --- @tfield[opt] int search_timer Time in seconds to search an enemy (only if none found yet) (default: 2). --- @tfield int search_radius Radius in blocks within enemies are searched. --- @tfield string search_type What enemy is being searched (see types at `cmer.findTarget`). - ---- Spawning definition table. --- --- @table SpawnDef --- @tfield ABMNodesDef abm_nodes On what nodes mob can spawn. --- @tfield int abm_interval Time in seconds until Minetest tries to find a node with set specs. --- @tfield int abm_chance Chance is 1/. --- @tfield int max_number Maximum mobs of this kind per mapblock (16x16x16). --- @tfield int number How many mobs are spawned if found suitable spawn position. Can be `int` or `table`: number = {min=<value>, max=<value>} --- @tfield[opt] table time_range Time range in time of day format (0-24000) (table with *min* & *max* values). --- @tfield[opt] table light Min and max lightvalue at spawn position (table with *min* & *max* values). --- @tfield[opt] table height_limit Min and max height (world Y coordinate) (table with *min* & *max* values). --- @tfield[opt] SpawnerDef spawner Is set a spawner_node is added to creative inventory. - ---- ABM nodes definition table. --- --- @table ABMNodesDef --- @tfield[opt] table spawn_on List of nodes on which the mob can spawn. --- @tfield table neighbors List of nodes that should be neighbors where mob can spawn. Can be nil or table as above. "air" is forced always as neighbor. - ---- Spawner definition table. --- --- @table SpawnerDef --- @tfield int range Defines an area (in blocks/nodes) within mobs are spawned. --- @tfield int number Maxmimum number of mobs spawned in area defined via range. --- @tfield[opt] string description Item description as string. --- @tfield[opt] table light Min and max lightvalue at spawn position. - - ---- Callbacks --- --- @section callbacks - ---- Called when mob (re-)activated. --- --- Note: staticdata is deserialized by MOB-Engine (including custom values). --- --- @function CreatureDef.on_activate --- @param self --- @tparam string staticdata Formatted string data to be deserialized. --- @tparam int dtime_s The time passed since the object was unloaded, which can be used for updating the entity state. - ---- Called each server step, after movement and collision processing. --- --- @function CreatureDef.on_step --- @param self --- @tparam float dtime Usually 0.1 seconds, as per the `dedicated_server_step` setting in `minetest.conf`. --- @treturn bool Prevents default action when returns `true`. - ---- Called when mob is punched. --- --- @function CreatureDef.on_punch --- @param self --- @tparam ObjectRef puncher --- @param time_from_last_punch Meant for disallowing spamming of clicks. --- @tparam table tool_capabilities See: http://minetest.gitlab.io/minetest/tools.html --- @param dir Unit vector of direction of punch. Always defined. Points from the puncher to the punched. --- @tparam int damage Damage that will be done to entity. --- @treturn bool Prevents default action when returns `true`. - ---- Called when mob is right-clicked. --- --- @function CreatureDef.on_rightclick --- @param self --- @tparam ObjectRef clicker Entity that did the punching. --- @treturn bool Prevents default action when returns `true`. - ---- Called when mob dies. --- --- @function CreatureDef.on_death --- @param self --- @tparam ObjectRef killer (can be `nil`) - ---- Must return a table to save mob data (serialization is done by MOB-Engine). --- --- e.g: --- --- return { --- custom_mob_data = self.my_value, --- } --- --- @function CreatureDef.get_staticdata --- @param self --- @treturn table - local function inRange(min_max, value) if not value or not min_max or not min_max.min or not min_max.max then @@ -856,12 +615,6 @@ local function register_alias_entity(old_mob, new_mob) end ---- Registers an alias for other mob, e.g. from other mods or removed ones. --- --- @function cmer.register_alias --- @tparam string old_mob Name of mob to be replaced. E.g. "creatures:oerrki" --- @tparam string new_mob Name of mob that will replace instances old one. E.g. "creatures:oerkki" --- @treturn bool `true` if successful. function cmer.register_alias(old_mob, new_mob) local def = core.registered_entities[new_mob] if not def then @@ -878,3 +631,254 @@ function cmer.register_alias(old_mob, new_mob) return true end + + +--- Registers a new mob. +-- +-- @function cmer.register_mob +-- @tparam CreatureDef def Creature definition table. +-- @treturn bool `true` if successfule. + +--- Registers an alias for other mob, e.g. from other mods or removed ones. +-- +-- @function cmer.register_alias +-- @tparam string old_mob Name of mob to be replaced. E.g. "creatures:oerrki" +-- @tparam string new_mob Name of mob that will replace instances old one. E.g. "creatures:oerkki" +-- @treturn bool `true` if successful. + + +--- Creature definition table. +-- +-- @table CreatureDef +-- @tfield string name E.g. "creatures:sheep". +-- @tfield[opt] string nametag String to be displayed in entity's nametag. +-- @tfield[opt] bool ownable Flag for defining if entity is ownable by players (default: *false*). +-- @tfield StatsDef stats Stats definitions. +-- @tfield ModeDef modes Entity bahavior defintions. +-- @tfield ModelDef model Model definitions. +-- @tfield[opt] table sounds Table of `SoundDef`. Additionally, `play_default_hit` can be set to `false` here to disable default "hit" sound. +-- @tfield[opt] table drops List of item `DropDef`. Can also be a function. receives "self" reference. +-- @tfield[opt] CombatDef combat Specifies behavior of hostile mobs in "attack" mode. +-- @tfield[opt] SpawnDef spawning Defines spawning in world. +-- @tfield callback on_activate see: `CreatureDef.on_activate` +-- @tfield callback on_step see: `CreatureDef.on_step` +-- @tfield callback on_punch see: `CreatureDef.on_punch` +-- @tfield callback on_rightclick see: `CreatureDef.on_rightclick` +-- @tfield callback on_death see: `CreatureDef.on_death` +-- @tfield callback get_staticdata see: `CreatureDef.get_staticdata` + + +--- Definition Tables +-- +-- @section defs + +--- Stats definition table. +-- +-- @table StatsDef +-- @tparam int hp Full health level (1 HP = 1/2 player heart). +-- @tparam[opt] bool hostile Is mob hostile (required for mode "attack") (default: `false`). +-- @tparam[opt] int lifetime After which time mob despawns, in seconds. +-- @tparam[opt] bool dies_when_tamed Stop despawn when tamed (default: `false`). +-- @tparam[opt] int can_jump Height in nodes (default: 0). +-- @tparam[opt] bool can_swim Can mob swim or will it drown (default: `false`). +-- @tparam[opt] bool can_fly Allows to fly (requires mode "fly") and disable step sounds (default: `false`). +-- @tparam[opt] bool can_burn Takes damage of lava (default: `false`). +-- @tparam[opt] bool can_panic Runs fast around when hit (requires mode "walk") (default: `false`). +-- @tparam[opt] bool has_falldamage Deals damage if falling more than 3 blocks (default: `false`). +-- @tparam[opt] bool has_knockback Get knocked back when hit (default: `false`). +-- @tparam[opt] bool sneaky Disables step sounds if `true` (default: `false`). +-- @tparam[opt] table light Which light level will burn creature (requires can_burn = true). +-- +-- Example: +-- +-- light = {min=10, max=15} + +--- Modes definition table. +-- +-- Entity behavior definition. Behavior types are ***idle***, ***walk***, ***attack***, ***follow***, ***eat***, ***death***, & ***panic***. The sum of all modes must be 1.0. +-- +-- Example: +-- +-- modes = { +-- idle = {chance=0.3,}, +-- walk = {chance=0.7, moving_speed=1,}, +-- } +-- +-- @table ModeDef +-- @tfield float chance Number between 0.0 and 1.0 (***NOTE:** sum of all modes MUST be 1.0*). If chance is 0 then mode is not chosen automatically. +-- @tfield int duration Time in seconds until the next mode is chosen (depending on chance). +-- @tfield[opt] int moving_speed Moving speed (walking/flying/swimming). +-- @tfield[opt] int update_yaw Timer in seconds until the looking dir is changed. If moving_speed > 0 then the moving direction is also changed. +-- @tfield int radius *(follow & eat modes only)* Search distance in blocks/nodes for player. +-- @tfield int timer *(follow & eat modes only)* Time in seconds between each check for player. +-- @tfield table items *(follow & eat modes only)* Table of items to make mob follow in format {<Itemname>, <Itemname>}; e.g. {"farming:wheat"}. +-- @tfield table nodes *(eat mode only)* Eatable nodes in format {<Itemname>, <Itemname>}; e.g. {"default:dirt\_with\_grass"}. + +--- Model definition table. +-- +-- @table ModelDef +-- @tfield string mesh Mesh name (see Minetest Documentation for supported filetypes). +-- @tfield table textures Table of textures (see Minetest Documentation). +-- @tfield[opt] NodeBox collisionbox Defines mesh collision box (see Minetest Documentation). +-- @tfield[opt] table scale Sets visual scale (default: {x=1, y=1}). +-- @tfield[opt] float rotation Sets rotation offset when moving (default: 0.0). +-- @tfield[opt] bool backface_culling Set to `true` to enable backface culling. +-- @tfield[opt] table animations Table of `AnimationDef` used if defined. +-- @tfield[opt] bool collide_with_objects Collide with other objects (default: `true`). + +--- Animations defiintion table. +-- +-- Animations coincide with modes. E.g. ***idle***, ***walk***, etc. +-- +-- Example: +-- +-- animations = { +-- idle = {start=25, stop=75, speed=15,}, +-- walk = {start=75, stop=100, speed=15,}, +-- } +-- +-- @table AnimationDef +-- @tfield int start Start frame. +-- @tfield int stop End frame. +-- @tfield int speed Animation speed. +-- @tfield[opt] bool loop If `false`, animation if just played once (default: `true`). +-- @tfield[opt] int duration *(death mode only)* Sets time the animation needs until mob is removed. + +--- Sounds definition table. +-- +-- Sounds can be defined for these actions: ***on_damage***, ***on_death***, ***swim***, & ***random***. +-- +-- ***random*** is a table of `SoundDef` that will be played randomly during the modes for which they are set. +-- +-- Example: +-- +-- sounds = { +-- on_damage = {name="creatures_horse_neigh_02", gain=1.0}, +-- on_death = {name="creatures_horse_snort_02", gain=1.0}, +-- random = { +-- idle = {name="creatures_horse_snort_01", gain=1.0}, +-- follow = {name="creatures_horse_neigh_01", gain=1.0, time_min=10}, +-- }, +-- } +-- +-- @table SoundsDef +-- @tparam[opt] SoundDef on_damage Sound played when entity is hit. +-- @tparam[opt] SoundDef on_death Sound played when entity dies. +-- @tparam[opt] SoundDef swim Sound played while entity is swimming. +-- @tparam[opt] table Random Sounds that will play randomly during specified modes. E.g. ***idle***, ***walk***, etc. + +--- Sound definition. +-- +-- @table SoundDef +-- @tfield string name Sound file name without file type extension (e.g. "my_sound", not "my_sound.ogg") (see Minetest documentation). +-- @tfield float gain Sound gain (see Minetest documentation). +-- @tfield[opt] int distance Distance in blocks/nodes at which sound can be heard. +-- @tfield[opt] int time_min *(random mode only)* Minimum time in seconds between sounds. +-- @tfield[opt] int time_max *(random mode only)* Maximum time in seconds between sounds. + +--- Item drops definition table. +-- +-- Example: +-- +-- drops = { +-- {"default:wood"}, -- 1 item with 100% chance +-- {"default:wool", 1, chance=0.3}, -- 1 item with 30% chance +-- {"default:stick", {min=2, max=3}, chance=0.2}, -- between 2-3 items with 20% chance +-- } +-- +-- @table DropDef + +--- Combat definition table. +-- +-- @table CombatDef +-- @tfield int attack_damage How much damage is dealt on each hit. +-- @tfield[opt] float attack_speed Time in seconds between hits (default: 1.0). +-- @tfield float attack_radius Distance in blocks mob can reach to hit. +-- @tfield bool search_enemy `true` to search enemies to attack. +-- @tfield[opt] int search_timer Time in seconds to search an enemy (only if none found yet) (default: 2). +-- @tfield int search_radius Radius in blocks within enemies are searched. +-- @tfield string search_type What enemy is being searched (see types at `cmer.findTarget`). + +--- Spawning definition table. +-- +-- @table SpawnDef +-- @tfield ABMNodesDef abm_nodes On what nodes mob can spawn. +-- @tfield int abm_interval Time in seconds until Minetest tries to find a node with set specs. +-- @tfield int abm_chance Chance is 1/. +-- @tfield int max_number Maximum mobs of this kind per mapblock (16x16x16). +-- @tfield int number How many mobs are spawned if found suitable spawn position. Can be `int` or `table`: number = {min=<value>, max=<value>} +-- @tfield[opt] table time_range Time range in time of day format (0-24000) (table with *min* & *max* values). +-- @tfield[opt] table light Min and max lightvalue at spawn position (table with *min* & *max* values). +-- @tfield[opt] table height_limit Min and max height (world Y coordinate) (table with *min* & *max* values). +-- @tfield[opt] SpawnerDef spawner Is set a spawner_node is added to creative inventory. + +--- ABM nodes definition table. +-- +-- @table ABMNodesDef +-- @tfield[opt] table spawn_on List of nodes on which the mob can spawn. +-- @tfield table neighbors List of nodes that should be neighbors where mob can spawn. Can be nil or table as above. "air" is forced always as neighbor. + +--- Spawner definition table. +-- +-- @table SpawnerDef +-- @tfield int range Defines an area (in blocks/nodes) within mobs are spawned. +-- @tfield int number Maxmimum number of mobs spawned in area defined via range. +-- @tfield[opt] string description Item description as string. +-- @tfield[opt] table light Min and max lightvalue at spawn position. + + +--- Callbacks +-- +-- @section callbacks + +--- Called when mob (re-)activated. +-- +-- Note: staticdata is deserialized by MOB-Engine (including custom values). +-- +-- @function CreatureDef.on_activate +-- @param self +-- @tparam string staticdata Formatted string data to be deserialized. +-- @tparam int dtime_s The time passed since the object was unloaded, which can be used for updating the entity state. + +--- Called each server step, after movement and collision processing. +-- +-- @function CreatureDef.on_step +-- @param self +-- @tparam float dtime Usually 0.1 seconds, as per the `dedicated_server_step` setting in `minetest.conf`. +-- @treturn bool Prevents default action when returns `true`. + +--- Called when mob is punched. +-- +-- @function CreatureDef.on_punch +-- @param self +-- @tparam ObjectRef puncher +-- @param time_from_last_punch Meant for disallowing spamming of clicks. +-- @tparam table tool_capabilities See: http://minetest.gitlab.io/minetest/tools.html +-- @param dir Unit vector of direction of punch. Always defined. Points from the puncher to the punched. +-- @tparam int damage Damage that will be done to entity. +-- @treturn bool Prevents default action when returns `true`. + +--- Called when mob is right-clicked. +-- +-- @function CreatureDef.on_rightclick +-- @param self +-- @tparam ObjectRef clicker Entity that did the punching. +-- @treturn bool Prevents default action when returns `true`. + +--- Called when mob dies. +-- +-- @function CreatureDef.on_death +-- @param self +-- @tparam ObjectRef killer (can be `nil`) + +--- Must return a table to save mob data (serialization is done by MOB-Engine). +-- +-- e.g: +-- +-- return { +-- custom_mob_data = self.my_value, +-- } +-- +-- @function CreatureDef.get_staticdata +-- @param self +-- @treturn table