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

28 lines
879 B
Lua
Raw Normal View History

2014-06-30 09:22:48 -04:00
return
{
HOOK_PLAYER_FOOD_LEVEL_CHANGE =
{
2014-07-02 08:49:08 -04:00
CalledWhen = "Called before the player food level changed. Plugin may override",
2014-06-30 09:22:48 -04:00
DefaultFnName = "OnPlayerFoodLevelChange", -- also used as pagename
Desc = [[
2014-07-01 14:30:13 -04:00
This hook is called before the food level changes.
The food level is not changed yet, plugins may choose
2014-07-02 08:49:08 -04:00
to refuse the change.
2014-06-30 09:22:48 -04:00
]],
Params =
{
2014-07-01 14:30:13 -04:00
{ Name = "Player", Type = "{{cPlayer}}", Notes = "The player who changes the food level." },
2014-07-02 08:49:08 -04:00
{ Name = "NewFoodLevel", Type = "number", Notes = "The new food level." },
2014-06-30 09:22:48 -04:00
},
Returns = [[
If the function returns false or no value, the next plugin's callback is called. Afterwards, the
2014-07-01 14:30:13 -04:00
server changes the food level of the player. If the function returns true, no
2014-06-30 09:22:48 -04: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 14:30:13 -04:00