====== Plugin:OnBlockDig ======
OnBlockDig is called while is player left clicks on a block. It is called immediately after receiving the packet and decoding that it is a block dig packet, before any further processing is performed. The plugin may stop the default processing, effectively forbidding the player to dig blocks. Player tossing and item, which uses the same packet, is still processed before calling this hook (and the hook isn't called for an item being tossed).
===== Parameters =====
OnBlockDig has two parameters, first is the [[api:cPacket_BlockDig | BlockDig Packet ]] and the second the player who is digging.
<code lua>
function OnBlockDig( PacketData, Player )

end
</code>
===== Return Values =====
The OnBlockDig callback expects you to return a boolean value. Returning true means you override default behaviour and therefore prevent a block from being removed. It will also prevent other plugins from receiving this callback. Returning false will let the server go on with it's usual business and other plugins will receive the callback.

===== Register Callback =====
To register your plugin for a callback on this function use the hook [[api:plugin:hooks | HOOK_BLOCK_DIG]]
<code lua>
PluginManager = cPluginManager:GetPluginManager()
PluginManager:AddHook( Plugin, cPluginManager.HOOK_BLOCK_DIG )
</code>