mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Document hpchange callback ordering thing (#3981)
Document hpchange callback ordering thing
Callbacks registered by register_on_player_hpchange are ordered so that non-modifiers are called after modifiers are called. Credit to @TeTpaAka who mentioned this previously-undocumented feature in #3799.
See also commit
aa13baa30a
"Add minetest.register_on_player_hpchange"
This commit is contained in:
parent
af799d4bd2
commit
c566a8f2de
1 changed files with 1 additions and 0 deletions
|
@ -1870,6 +1870,7 @@ Call these functions only at load time!
|
||||||
* `modifier`: when true, the function should return the actual hp_change.
|
* `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.
|
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.
|
modifiers can return true as a second argument to stop the execution of further functions.
|
||||||
|
Non-modifiers receive the final hp change calculated by the modifiers.
|
||||||
* `minetest.register_on_respawnplayer(func(ObjectRef))`
|
* `minetest.register_on_respawnplayer(func(ObjectRef))`
|
||||||
* Called when player is to be respawned
|
* Called when player is to be respawned
|
||||||
* Called _before_ repositioning of player occurs
|
* Called _before_ repositioning of player occurs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue