From c5b4e541749c50805519ce040d98a0a8e5e0ec03 Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 16 May 2014 23:47:12 -0500 Subject: Add minetest.register_on_punchplayer --- doc/lua_api.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'doc/lua_api.txt') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 4c0baa5bc..8ade48b7b 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1760,6 +1760,16 @@ Call these functions only at load time! * Called after a new player has been created * `minetest.register_on_dieplayer(func(ObjectRef))` * Called when a player dies +* `minetest.register_on_punchplayer(func(player, hitter, time_from_last_punch, tool_capabilities, dir, damage))` + * Called when a player is punched + * `player` - ObjectRef - Player that was punched + * `hitter` - ObjectRef - Player that hit + * `time_from_last_punch`: Meant for disallowing spamming of clicks (can be nil) + * `tool_capabilities`: capability table of used tool (can be nil) + * `dir`: unit vector of direction of punch. Always defined. Points from + the puncher to the punched. + * `damage` - number that represents the damage calculated by the engine + * should return `true` to prevent the default damage mechanism * `minetest.register_on_respawnplayer(func(ObjectRef))` * Called when player is to be respawned * Called _before_ repositioning of player occurs @@ -2282,7 +2292,6 @@ These functions return the leftover itemstack. * `minetest.forceload_free_block(pos)` * stops forceloading the position `pos` - Please note that forceloaded areas are saved when the server restarts. minetest.global_exists(name) -- cgit v1.2.3