Interface BlockEvents.UseItemOnCallback

Enclosing interface:
BlockEvents
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface BlockEvents.UseItemOnCallback
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.minecraft.world.InteractionResult
    useItemOn(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos blockPos, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand interactionHand, net.minecraft.world.phys.BlockHitResult blockHitResult)
    Handles block-side interaction, which uses item stack as a context.
  • Method Details

    • useItemOn

      @Nullable net.minecraft.world.InteractionResult useItemOn(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos blockPos, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand interactionHand, net.minecraft.world.phys.BlockHitResult blockHitResult)
      Handles block-side interaction, which uses item stack as a context.
      Parameters:
      itemStack - the stack used for interaction
      blockState - the interacted block state
      level - the level in which block resides
      blockPos - the position of the block
      player - the player causing the interaction
      interactionHand - player's hand used in interaction
      blockHitResult - the hit-result pointing at interacted block
      Returns:
      any InteractionResult to indicate that interaction was handler or null to pass it forward to other listeners and vanilla