mirror of
https://github.com/minetest/minetest.git
synced 2024-09-20 07:20:46 +03:00
Document behavior
This commit is contained in:
parent
310c7b6e5b
commit
8369dd4b28
@ -5838,8 +5838,13 @@ Call these functions only at load time!
|
|||||||
* `clicker`: ObjectRef - Object that acted upon `player`, may or may not be a player
|
* `clicker`: ObjectRef - Object that acted upon `player`, may or may not be a player
|
||||||
* `minetest.register_on_player_hpchange(function(player, hp_change, reason), modifier)`
|
* `minetest.register_on_player_hpchange(function(player, hp_change, reason), modifier)`
|
||||||
* Called when the player gets damaged or healed
|
* Called when the player gets damaged or healed
|
||||||
|
* When `hp == 0`, damage doesn't trigger this callback.
|
||||||
|
* When `hp == hp_max`, healing does still trigger this callback.
|
||||||
* `player`: ObjectRef of the player
|
* `player`: ObjectRef of the player
|
||||||
* `hp_change`: the amount of change. Negative when it is damage.
|
* `hp_change`: the amount of change. Negative when it is damage.
|
||||||
|
* Historically, the new HP value was clamped to [0, 65535] before
|
||||||
|
calculating the HP change. This clamping has been removed as of
|
||||||
|
Minetest 5.10.0
|
||||||
* `reason`: a PlayerHPChangeReason table.
|
* `reason`: a PlayerHPChangeReason table.
|
||||||
* The `type` field will have one of the following values:
|
* The `type` field will have one of the following values:
|
||||||
* `set_hp`: A mod or the engine called `set_hp` without
|
* `set_hp`: A mod or the engine called `set_hp` without
|
||||||
|
Loading…
Reference in New Issue
Block a user