====== OnPlayerUsingBlock hook callback function ======
OnPlayerUsingBlock() is called when a player has right-clicked a block that can be used, such as a chest or a lever. It is called before MCServer processes the usage (sends the UI handling packets / toggles redstone). Plugins may refuse the interaction by returning true.

To get the world at which the right-click occurred, use the [[API:cPlayer|cPlayer:GetWorld]]() function.

===== Function signature =====
<code lua>
function OnPlayerUsingBlock(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ, BlockType, BlockMeta)
</code>
Parameters:
| Player | [[API:cPlayer|cPlayer]] | The player who has used the block |
| BlockX | number | X-coord of the block being used |
| BlockY | number | Y-coord of the block being used |
| BlockZ | number | Z-coord of the block being used |
| BlockFace | number | Face of the block being used through which the interaction was made. One of the BLOCK_FACE_ constants |
| CursorX | number | X-coord of the cursor crosshair on the block being used |
| CursorY | number | Y-coord of the cursor crosshair on the block being used |
| CursorZ | number | Z-coord of the cursor crosshair on the block being used |
| BlockType | BLOCKTYPE | BlockType of the block being used |
| BlockMeta | NIBBLETYPE | BlockMeta of the block being used |

===== Return values =====
If the function returns false or no value, other plugins' callbacks are called and then MCServer processes the interaction. If the function returns true, no other callbacks are called for this event and the interaction is silently dropped.

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