====== OnBlockToPickups hook callback function ======
This callback gets called whenever a block is about to be dug. This includes players digging blocks, entities causing blocks to disappear (TNT, Endermen) and natural causes (water washing away a block). Plugins may override the amount and kinds of pickups this action produces.

===== Function signature =====
<code lua>
function OnBlockToPickups(World, Digger, BlockX, BlockY, BlockZ, BlockType, BlockMeta, Pickups)
</code>
Parameters:
| World | [[API:cWorld|cWorld]] | The world in which this block resides |
| Digger | [[API:cEntity|cEntity]] | The entity causing the digging. May be a [[API:cPlayer|cPlayer]], TNT, Enderman or even nil (natural causes) |
| BlockX | number | X-coord of the block |
| BlockY | number | Y-coord of the block |
| BlockZ | number | Z-coord of the block |
| BlockType | BLOCKTYPE | Block type of the block |
| BlockMeta | NIBBLETYPE | Block meta of the block |
| Pickups | [[API:cItems|cItems]] | Items that will be spawned as pickups |

===== Return values =====
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. 

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.

===== Registering the callback =====
To register your plugin to receive a callback through this function, use the hook [[api:plugin:hooks|HOOK_BLOCK_TO_PICKUPS]]
<code lua>
PluginManager = cPluginManager:GetPluginManager()
PluginManager:AddHook(Plugin, cPluginManager.HOOK_BLOCK_TO_PICKUPS)
</code>

===== Example code =====
This example callback function adds a diamond shovel to every pickup:
<code lua>
function OnBlockToPickups(World, Digger, BlockX, BlockY, BlockZ, BlockType, BlockMeta, Pickups)
	Pickups:Add(cItem:new(E_ITEM_DIAMOND_SHOVEL, 1));
end;
</code>