summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2019-07-16 19:20:06 +0200
committersfan5 <sfan5@live.de>2019-08-10 19:44:27 +0200
commit291e7730cf24ba5081f10b5ddbf2494951333827 (patch)
treeba898a07025935ed768fe1d7daaf03db3f78d271 /doc
parentcf64054390970f3cf974afb2b174340a3e1da382 (diff)
downloadminetest-291e7730cf24ba5081f10b5ddbf2494951333827.tar.gz
minetest-291e7730cf24ba5081f10b5ddbf2494951333827.tar.bz2
minetest-291e7730cf24ba5081f10b5ddbf2494951333827.zip
Add player knockback on punch to builtin
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 9fd2ba3f5..6506dc2b2 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -5019,6 +5019,15 @@ Misc.
of the creative mode setting, checks for "sneak" to set the `invert_wall`
parameter and `prevent_after_place` set to `true`.
+* `minetest.calculate_knockback(player, hitter, time_from_last_punch,
+ tool_capabilities, dir, distance, damage)`
+ * Returns the amount of knockback applied on the punched player.
+ * Arguments are equivalent to `register_on_punchplayer`, except the following:
+ * `distance`: distance between puncher and punched player
+ * This function can be overriden by mods that wish to modify this behaviour.
+ * You may want to cache and call the old function to allow multiple mods to
+ change knockback behaviour.
+
* `minetest.forceload_block(pos[, transient])`
* forceloads the position `pos`.
* returns `true` if area could be forceloaded