summaryrefslogtreecommitdiffstats
path: root/Server/Plugins/APIDump/Hooks/OnPlayerEating.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Server/Plugins/APIDump/Hooks/OnPlayerEating.lua')
-rw-r--r--Server/Plugins/APIDump/Hooks/OnPlayerEating.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerEating.lua b/Server/Plugins/APIDump/Hooks/OnPlayerEating.lua
new file mode 100644
index 000000000..e77d02a96
--- /dev/null
+++ b/Server/Plugins/APIDump/Hooks/OnPlayerEating.lua
@@ -0,0 +1,27 @@
+return
+{
+ 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
+}
+
+
+
+
+