Interface UseEntityCallback


public interface UseEntityCallback
Callback for right-clicking ("using") an entity. Is hooked in before the spectator check, so make sure to check for the player's game mode as well!

On the logical client, the return values have the following meaning:

  • SUCCESS/SUCCESS_NO_ITEM_USED cancels further processing, causes a hand swing, and sends a packet to the server.
  • CONSUME cancels further processing, and sends a packet to the server. It does NOT cause a hand swing.
  • PASS falls back to further processing.
  • FAIL cancels further processing and does not send a packet to the server.

On the logical server, the return values have the following meaning:

  • PASS falls back to further processing.
  • Any other value cancels further processing.

Note that on the server, the EntityHitResult may be null if the client successfully interacted using the position-less overload. On the client, the EntityHitResult will never be null.