use On Entity
Called on both the client and the server by Minecraft, when an entity uses the staff on an entity. This method may not be called, if the entity handles the use event (for example, a horse). This method will not be called, if the player is in spectator mode.
Return
On the logical client:
ActionResult.SUCCESS: sends a packet to the server, emits entity interact game event, and swings hand
ActionResult.CONSUME, ActionResult.CONSUME_PARTIAL: sends a packet to the server, emits entity interact game event, and doesn't swing hand
ActionResult.PASS, ActionResult.FAIL: sends a packet to the server, doesn't emit entity interact game event, doesn't swing hand, then interacts with the item using use
On the logical server (if used by player):
ActionResult.SUCCESS: Emits entity interact game event, triggers player interacted with entity criteria, and swings hand
ActionResult.CONSUME, ActionResult.CONSUME_PARTIAL: Emits entity interact game event, triggers player interacted with entity criteria, and doesn't swing hand
ActionResult.PASS, ActionResult.FAIL: Doesn't emit entity interact game event, doesn't trigger player interacted with entity criteria, and doesn't swing hand
Parameters
The item stack used to perform the action
The world the user is in
The entity, which used the staff
The entity, on which user used the staff