use On Block
Called on both the client and the server by Minecraft, when an entity uses the staff on a block. This method may not be called, if the block handles the use event (for example, a chest).
On the logical client, the return values have the following meaning:
SUCCESS: send a packet to the server, and swing hand
CONSUME, CONSUME_PARTIAL, FAIL: send a packet to the server, and don't swing hand
PASS: send a packet to the server, don't swing hand, then interact with the item by itself (see use)
On the logical server, the return values have the following meaning (if used by player):
SUCCESS: Increment player used item stat, trigger item used on block criterion, and swing hand
CONSUME: Increment player used item stat, trigger item used on block criterion, and don't swing hand
CONSUME_PARTIAL: Don't increment player used item stat, trigger item used on block criterion, and don't swing hand
PASS, FAIL: Don't increment player used item stat, don't trigger item used on block criterion, and don't swing hand
On the logical server, the return values are processed by the caller code (if not used by player).
Parameters
The item stack used to perform the action
The world the user is in
The entity, which used the staff
The block, on which user used the staff
The side of the block, on which the staff was used