Enum SlotActionType

java.lang.Object
java.lang.Enum<SlotActionType>
net.minecraft.screen.slot.SlotActionType
All Implemented Interfaces:
Serializable, Comparable<SlotActionType>, java.lang.constant.Constable

public enum SlotActionType
extends Enum<SlotActionType>
  • Enum Constant Details

    • PICKUP

      public static final SlotActionType PICKUP
      Performs a normal slot click. This can pickup or place items in the slot, possibly merging the cursor stack into the slot, or swapping the slot stack with the cursor stack if they can't be merged.
    • QUICK_MOVE

      public static final SlotActionType QUICK_MOVE
      Performs a shift-click. This usually quickly moves items between the player's inventory and the open screen handler.
    • SWAP

      public static final SlotActionType SWAP
      Exchanges items between a slot and a hotbar slot. This is usually triggered by the player pressing a 1-9 number key while hovering over a slot.

      When the action type is swap, the click data is the hotbar slot to swap with (0-8).

    • CLONE

      public static final SlotActionType CLONE
      Clones the item in the slot. Usually triggered by middle clicking an item in creative mode.
    • THROW

      public static final SlotActionType THROW
      Throws the item out of the inventory. This is usually triggered by the player pressing Q while hovering over a slot, or clicking outside the window.

      When the action type is throw, the click data determines whether to throw a whole stack (1) or a single item from that stack (0).

    • QUICK_CRAFT

      public static final SlotActionType QUICK_CRAFT
      Drags items between multiple slots. This is usually triggered by the player clicking and dragging between slots.

      This action happens in 3 stages. Stage 0 signals that the drag has begun, and stage 2 signals that the drag has ended. In between multiple stage 1s signal which slots were dragged on.

      The stage is packed into the click data along with the mouse button that was clicked. See ScreenHandler.packQuickCraftData(int, int) for details.

    • PICKUP_ALL

      public static final SlotActionType PICKUP_ALL
      Replenishes the cursor stack with items from the screen handler. This is usually triggered by the player double clicking.
  • Constructor Details

    • SlotActionType

      private SlotActionType()
  • Method Details

    • values

      public static SlotActionType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static SlotActionType valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null