From 291e7730cf24ba5081f10b5ddbf2494951333827 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Tue, 16 Jul 2019 19:20:06 +0200 Subject: Add player knockback on punch to builtin --- doc/lua_api.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc') 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 -- cgit v1.2.3