APIDump: Documented OnBlockToPickups.
This commit is contained in:
parent
990fa9dfe1
commit
50e5afd67d
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user