====== OnPlayerUsedItem hook callback function ======
OnPlayerUsedItem() is called after a player has right-clicked with an item in hand that can be used (is not placeable, is not food and the clicked block is not use-able), such as a bucket or a hoe. It is called after MCServer processes the usage. This is a notification-only event, plugins wishing to refuse the interaction should use the [[API:plugin:OnPlayerUsingItem|OnPlayerUsingItem]] hook.

To get the world at which the right-click occurred, use the [[API:cPlayer|cPlayer:GetWorld]]() function. To get the item that the player has used, use the [[API:cPlayer|cPlayer:GetHeldItem]]() function.

===== Function signature =====
<code lua>
function OnPlayerUsedItem(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 clicked |
| BlockY | number | Y-coord of the block being clicked |
| BlockZ | number | Z-coord of the block being clicked |
| BlockFace | number | Face of the block being clicked through which the interaction was made. One of the BLOCK_FACE_ constants |
| CursorX | number | X-coord of the cursor crosshair on the block being clicked |
| CursorY | number | Y-coord of the cursor crosshair on the block being clicked |
| CursorZ | number | Z-coord of the cursor crosshair on the block being clicked |
| BlockType | BLOCKTYPE | BlockType of the block being clicked |
| BlockMeta | NIBBLETYPE | BlockMeta of the block being clicked |

===== 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_ITEM]]
<code lua>
cPluginManager:Get():AddHook(Plugin, cPluginManager.HOOK_PLAYER_USED_ITEM);
</code>
