1
0
Fork 0
cuberite-2a/Server/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua

28 lines
879 B
Lua
Raw Normal View History

2014-06-30 13:22:48 +00:00
return
{
HOOK_PLAYER_FOOD_LEVEL_CHANGE =
{
2014-07-02 12:49:08 +00:00
CalledWhen = "Called before the player food level changed. Plugin may override",
2014-06-30 13:22:48 +00:00
DefaultFnName = "OnPlayerFoodLevelChange", -- also used as pagename
Desc = [[
2014-07-01 18:30:13 +00:00
This hook is called before the food level changes.
The food level is not changed yet, plugins may choose
2014-07-02 12:49:08 +00:00
to refuse the change.
2014-06-30 13:22:48 +00:00
]],
Params =
{
2014-07-01 18:30:13 +00:00
{ Name = "Player", Type = "{{cPlayer}}", Notes = "The player who changes the food level." },
2014-07-02 12:49:08 +00:00
{ Name = "NewFoodLevel", Type = "number", Notes = "The new food level." },
2014-06-30 13:22:48 +00:00
},
Returns = [[
If the function returns false or no value, the next plugin's callback is called. Afterwards, the
2014-07-01 18:30:13 +00:00
server changes the food level of the player. If the function returns true, no
2014-06-30 13:22:48 +00:00
other callback is called for this event and the player's food level doesn't change.
]],
}, -- HOOK_PLAYER_FOOD_LEVEL_CHANGE
};
2014-07-01 18:30:13 +00:00