aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 4301762e2..012c6eae1 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1785,6 +1785,13 @@ Call these functions only at load time!
the puncher to the punched.
* `damage` - number that represents the damage calculated by the engine
* should return `true` to prevent the default damage mechanism
+* `minetest.register_on_player_hpchange(func(player, hp_change), modifier)`
+ * Called when the player gets damaged or healed
+ * `player`: ObjectRef of the player
+ * `hp_change`: the amount of change. Negative when it is damage.
+ * `modifier`: when true, the function should return the actual hp_change.
+ Note: modifiers only get a temporary hp_change that can be modified by later modifiers.
+ modifiers can return true as a second argument to stop the execution of further functions.
* `minetest.register_on_respawnplayer(func(ObjectRef))`
* Called when player is to be respawned
* Called _before_ repositioning of player occurs