mirror of
git://repo.or.cz/minetest_mana.git
synced 2025-06-30 14:10:21 +02:00
Add API for Mana regneration
This commit is contained in:
13
API.md
13
API.md
@ -43,6 +43,12 @@ If the new maximum would become smaller than the current value,
|
||||
the current value will automatically be set to
|
||||
the new maximum.
|
||||
|
||||
### `mana.setregen(playername, value)`
|
||||
Sets the mana regeneration per mana tick of the player to `value`.
|
||||
Negative values are not permitted.
|
||||
The length of one “mana tick” is specified as the server-wide setting
|
||||
`mana_default_regen` in seconds.
|
||||
|
||||
|
||||
### `mana.get(playername)`
|
||||
Returns the current mana of the specified player as number.
|
||||
@ -52,6 +58,13 @@ Returns the current mana of the specified player as number.
|
||||
Returns the current maximum mana of the specified player as number.
|
||||
|
||||
|
||||
### `mana.getregen(playername)`
|
||||
Returns the current mana regneration per mana tick of the specified
|
||||
player as number.
|
||||
The length of one “mana tick” is specified as the server-wide setting
|
||||
`mana_default_regen` in seconds.
|
||||
|
||||
|
||||
### `mana.add(playername, value)`
|
||||
Adds the specified non-negative amount of mana to the player, but only
|
||||
if the sum would not be greater than the maximum,
|
||||
|
Reference in New Issue
Block a user