summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-15 08:18:08 +0200
committermadmaxoft <github@xoft.cz>2013-10-15 08:18:08 +0200
commitb902c0b29e72098242bb81caabb99e333fb2da97 (patch)
treef3b11deba6d4697ce28c9321d406bf2d4f7897ac
parentAPIDump: Documented HOOK_PLAYER_BROKEN_BLOCK. (diff)
downloadcuberite-b902c0b29e72098242bb81caabb99e333fb2da97.tar
cuberite-b902c0b29e72098242bb81caabb99e333fb2da97.tar.gz
cuberite-b902c0b29e72098242bb81caabb99e333fb2da97.tar.bz2
cuberite-b902c0b29e72098242bb81caabb99e333fb2da97.tar.lz
cuberite-b902c0b29e72098242bb81caabb99e333fb2da97.tar.xz
cuberite-b902c0b29e72098242bb81caabb99e333fb2da97.tar.zst
cuberite-b902c0b29e72098242bb81caabb99e333fb2da97.zip
-rw-r--r--MCServer/Plugins/APIDump/APIDesc.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index efc0c6dc6..84e7588db 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2691,6 +2691,26 @@ end;
]],
}, -- HOOK_PLAYER_BROKEN_BLOCK
+ HOOK_PLAYER_EATING =
+ {
+ CalledWhen = "When the player starts eating",
+ DefaultFnName = "OnPlayerEating", -- also used as pagename
+ Desc = [[
+ This hook gets called when the {{cPlayer|player}} starts eating, after the server checks that the
+ player can indeed eat (is not satiated and is holding food). Plugins may still refuse the eating by
+ returning true.
+ ]],
+ Params =
+ {
+ { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who started eating" },
+ },
+ Returns = [[
+ If the function returns false or no value, the server calls the next plugin handler, and finally
+ lets the player eat. If the function returns true, the server doesn't call any more callbacks for
+ this event and aborts the eating. A "disallow" packet is sent to the client.
+ ]],
+ }, -- HOOK_PLAYER_EATING
+
}, -- Hooks[]