summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-15 08:11:01 +0200
committermadmaxoft <github@xoft.cz>2013-10-15 08:11:01 +0200
commiteb466334adaac7ee6ff6c1993e4969739ae28b6d (patch)
tree000ccb60ce4d1e7a6f55b2bcbdfc8f0b3c6e1843 /MCServer/Plugins/APIDump
parentAPIDump: Documented HOOK_PLAYER_BREAKING_BLOCK. (diff)
downloadcuberite-eb466334adaac7ee6ff6c1993e4969739ae28b6d.tar
cuberite-eb466334adaac7ee6ff6c1993e4969739ae28b6d.tar.gz
cuberite-eb466334adaac7ee6ff6c1993e4969739ae28b6d.tar.bz2
cuberite-eb466334adaac7ee6ff6c1993e4969739ae28b6d.tar.lz
cuberite-eb466334adaac7ee6ff6c1993e4969739ae28b6d.tar.xz
cuberite-eb466334adaac7ee6ff6c1993e4969739ae28b6d.tar.zst
cuberite-eb466334adaac7ee6ff6c1993e4969739ae28b6d.zip
Diffstat (limited to 'MCServer/Plugins/APIDump')
-rw-r--r--MCServer/Plugins/APIDump/APIDesc.lua33
1 files changed, 31 insertions, 2 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index af4818755..efc0c6dc6 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2639,8 +2639,8 @@ end;
DefaultFnName = "OnPlayerBreakingBlock", -- also used as pagename
Desc = [[
This hook is called when a {{cPlayer|player}} breaks a block, before the block is actually broken in
- the {{cWorld|World}}. Plugins may refuse the breaking.
-
+ the {{cWorld|World}}. Plugins may refuse the breaking.</p>
+ <p>
See also the {{OnPlayerBrokenBlock|HOOK_PLAYER_BROKEN_BLOCK}} hook for a similar hook called after
the block is broken.
]],
@@ -2662,6 +2662,35 @@ end;
]],
}, -- HOOK_PLAYER_BREAKING_BLOCK
+ HOOK_PLAYER_BROKEN_BLOCK =
+ {
+ CalledWhen = "After a player has broken a block. Notification only.",
+ DefaultFnName = "OnPlayerBrokenBlock", -- also used as pagename
+ Desc = [[
+ This function is called after a {{cPlayer|player}} breaks a block. The block is already removed
+ from the {{cWorld|world}} and {{cPickup|pickups}} have been spawned. To get the world in which the
+ block has been dug, use the {{cPlayer}}:GetWorld() function.</p>
+ <p>
+ See also the {{OnPlayerBreakingBlock|HOOK_PLAYER_BREAKING_BLOCK}} hook for a similar hook called
+ before the block is broken. To intercept the creation of pickups, see the
+ {{OnBlockToPickups|HOOK_BLOCK_TO_PICKUPS}} hook.
+ ]],
+ Params =
+ {
+ { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who broke the block" },
+ { 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 = "BlockFace", Type = "number", Notes = "Face of the block upon which the player interacted. One of the BLOCK_FACE_ constants" },
+ { Name = "BlockType", Type = "BLOCKTYPE", Notes = "The block type of the block" },
+ { Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "The block meta of the block" },
+ },
+ Returns = [[
+ If the function returns false or no value, the next plugin's callback is called. If the function
+ returns true, no other callback is called for this event.
+ ]],
+ }, -- HOOK_PLAYER_BROKEN_BLOCK
+
}, -- Hooks[]