diff options
author | madmaxoft <github@xoft.cz> | 2013-10-14 15:53:41 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-10-14 15:53:41 +0200 |
commit | c8702e15bbced0a655d08761ea9173950445238c (patch) | |
tree | c32968c47744e647a0875840cb902795e8a6846d | |
parent | APIDump: Documented HOOK_CHUNK_UNLOADING. (diff) | |
download | cuberite-c8702e15bbced0a655d08761ea9173950445238c.tar cuberite-c8702e15bbced0a655d08761ea9173950445238c.tar.gz cuberite-c8702e15bbced0a655d08761ea9173950445238c.tar.bz2 cuberite-c8702e15bbced0a655d08761ea9173950445238c.tar.lz cuberite-c8702e15bbced0a655d08761ea9173950445238c.tar.xz cuberite-c8702e15bbced0a655d08761ea9173950445238c.tar.zst cuberite-c8702e15bbced0a655d08761ea9173950445238c.zip |
-rw-r--r-- | MCServer/Plugins/APIDump/APIDesc.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 013b3c69e..6044b0a0a 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -2297,6 +2297,33 @@ end; chunk is left in the memory. ]], }, -- HOOK_CHUNK_UNLOADING + + HOOK_COLLECTING_PICKUP = + { + CalledWhen = "Player is about to collect a pickup. Plugin can refuse / override behavior. ", + DefaultFnName = "OnCollectingPickup", -- also used as pagename + Desc = [[ + This hook is called when a player is about to collect a pickup. Plugins may refuse the action.</p> + <p> + Pickup collection happens within the world tick, so if the collecting is refused, it will be tried + again in the next world tick, as long as the player is within reach of the pickup.</p> + <p> + FIXME: There is no OnCollectedPickup() callback.</p> + <p> + FIXME: This callback is called even if the pickup doesn't fit into the player's inventory.</p> + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who's collecting the pickup" }, + { Name = "Pickup", Type = "{{cPickup}}", Notes = "The pickup being collected" }, + }, + Returns = [[ + If the function returns false or no value, MCServer calls other plugins' callbacks and finally the + pickup is collected. If the function returns true, no other plugins are called for this event and + the pickup is not collected. + ]], + }, -- HOOK_COLLECTING_PICKUP + }, -- Hooks[] |