summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump/APIDesc.lua
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-12 11:46:00 +0200
committermadmaxoft <github@xoft.cz>2013-10-12 11:46:00 +0200
commit50e5afd67da8d0b004193f86fa8023c015d64ea7 (patch)
treeab06c2e3645a387168da995b7c2ed4a4e2bc55f8 /MCServer/Plugins/APIDump/APIDesc.lua
parentAPIDump: Hook notes are linkified. (diff)
downloadcuberite-50e5afd67da8d0b004193f86fa8023c015d64ea7.tar
cuberite-50e5afd67da8d0b004193f86fa8023c015d64ea7.tar.gz
cuberite-50e5afd67da8d0b004193f86fa8023c015d64ea7.tar.bz2
cuberite-50e5afd67da8d0b004193f86fa8023c015d64ea7.tar.lz
cuberite-50e5afd67da8d0b004193f86fa8023c015d64ea7.tar.xz
cuberite-50e5afd67da8d0b004193f86fa8023c015d64ea7.tar.zst
cuberite-50e5afd67da8d0b004193f86fa8023c015d64ea7.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/APIDump/APIDesc.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 33e1da976..513af7816 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2058,6 +2058,36 @@ World:ForEachEntity(
Hooks =
{
+ HOOK_BLOCK_TO_PICKUPS =
+ {
+ CalledWhen = "A block is about to be dug ({{cPlayer|player}}, {{cEntity|entity}} or natural reason), plugins may override what pickups that will produce.",
+ DefaultFnName = "OnBlockToPickups", -- also used as pagename
+ Desc = [[
+ This callback gets called whenever a block is about to be dug. This includes {{cPlayer|players}}
+ digging blocks, entities causing blocks to disappear ({{cTNTEntity|TNT}}, Endermen) and natural
+ causes (water washing away a block). Plugins may override the amount and kinds of pickups this
+ action produces.
+ ]],
+ Params =
+ {
+ { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the block resides" },
+ { Name = "Digger", Type = "{{cEntity}} descendant", Notes = "The entitycausing the digging. May be a {{cPlayer}}, {{cTNTEntity}} or even nil (natural causes)" },
+ { Name = "BlockX", Type = "number", Notes = "X-coord of the block" },
+ { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" },
+ { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" },
+ { Name = "BlockType", Type = "BLOCKTYPE", Notes = "Block type of the block" },
+ { Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "Block meta of the block" },
+ { Name = "Pickups", Type = "{{cItems}}", Notes = "Items that will be spawned as pickups" },
+ },
+ Returns = [[
+ If the function returns false or no value, the next callback in the hook chain will be called. If
+ the function returns true, no other callbacks in the chain will be called.</p>
+ <p>
+ Either way, the server will then spawn pickups specified in the Pickups parameter, so to disable
+ pickups, you need to Clear the object first, then return true.
+ ]],
+ }, -- HOOK_BLOCK_TO_PICKUPS
+
HOOK_CHAT =
{
CalledWhen = "Player sends a chat message",