Interface IScrollableItem


public interface IScrollableItem
An item that supports shift-wheel-scrolling
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull net.minecraft.world.InteractionResult
    onMouseScroll(@NotNull net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.item.ItemStack stack, double delta, boolean ctrlKey)
    Called first on client side when the player shift-scrolls with this item selected.
  • Method Details

    • onMouseScroll

      @NotNull @NotNull net.minecraft.world.InteractionResult onMouseScroll(@NotNull @NotNull net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.world.item.ItemStack stack, double delta, boolean ctrlKey)
      Called first on client side when the player shift-scrolls with this item selected. If that succeeds, called again on server side.
      Parameters:
      player - the player
      stack - the item stack
      delta - the scroll delta; negative is up, positive is down
      ctrlKey - the ctrl key is held
      Returns:
      (client) return SUCCESS to pass to server, FAIL to cancel, or PASS to do normal scrolling. (server) return value is ignored.