Interface ClientHotbarScrollEvents.Allow

Enclosing class:
ClientHotbarScrollEvents
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 ClientHotbarScrollEvents.Allow
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    allowScroll(net.minecraft.world.entity.player.Inventory inventory, int currentSlot, int newSlot, double xOffset, double yOffset)
    Called before player scrolling changes the selected slot.
  • Method Details

    • allowScroll

      boolean allowScroll(net.minecraft.world.entity.player.Inventory inventory, int currentSlot, int newSlot, double xOffset, double yOffset)
      Called before player scrolling changes the selected slot.
      Parameters:
      inventory - The player's inventory.
      currentSlot - The currently selected slot before changing.
      newSlot - The slot about to be selected.
      xOffset - The X scroll offset.
      yOffset - The Y scroll offset.
      Returns:
      true if the selected slot will change to newSlot, otherwise false if the slot will remain currentSlot.