Interface UseItemCallback


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

Upon return:

  • SUCCESS cancels further processing and, on the client, sends a packet to the server.
  • PASS falls back to further processing.
  • FAIL cancels further processing and does not send a packet to the server.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Event<UseItemCallback>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.InteractionResult
    interact(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level level, net.minecraft.world.InteractionHand hand)
     
  • Field Details

  • Method Details

    • interact

      net.minecraft.world.InteractionResult interact(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level level, net.minecraft.world.InteractionHand hand)