====== OnPlayerUsedBlock hook callback function ======
OnPlayerUsedBlock() is called after a player has right-clicked a block that can be used, such as a chest or a lever. It is called after MCServer processes the usage (sends the UI handling packets / toggles redstone). Note that for UI-related blocks, the player is most likely still using the UI. This is a notification-only event, plugins wishing to refuse the interaction should use the [[API:plugin:OnPlayerUsingBlock|OnPlayerUsingBlock]] hook.

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

===== Function signature =====
<code lua>
function OnPlayerUsedBlock(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. If the function returns true, no other callbacks are called for this event.

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