Interface ISpecialBlockPickItem


public interface ISpecialBlockPickItem
An item that supports middle-clicking
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull net.minecraft.world.InteractionResult
    onBlockPick(@NotNull net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.core.BlockPos pos, boolean ctrlKey)
    Called first on client side when the player presses "pick block" (default middle mouse) with this item selected.
  • Method Details

    • onBlockPick

      @NotNull @NotNull net.minecraft.world.InteractionResult onBlockPick(@NotNull @NotNull net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.world.item.ItemStack stack, @Nullable @Nullable net.minecraft.core.BlockPos pos, boolean ctrlKey)
      Called first on client side when the player presses "pick block" (default middle mouse) with this item selected. If that succeeds, called again on server side.
      Parameters:
      player - the player
      stack - the item stack
      pos - the focused block, or null if on air
      ctrlKey - ctrl key is pressed too
      Returns:
      (client) return SUCCESS to send to server, FAIL to cancel, or PASS to do normal pick action. (server) return value is ignored.