Enum ClickType

java.lang.Object
java.lang.Enum<ClickType>
org.bukkit.event.inventory.ClickType
All Implemented Interfaces:
Serializable, Comparable<ClickType>, java.lang.constant.Constable

public enum ClickType extends Enum<ClickType>
What the client did to trigger this action (not the result).
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Holding Ctrl while pressing the "Drop" key (defaults to Q).
    Any action done with the Creative inventory open.
    Pressing the left mouse button twice in quick succession.
    The "Drop" key (defaults to Q).
    The left (or primary) mouse button.
    The middle mouse button, or a "scrollwheel click".
    One of the number keys 1-9, correspond to slots on the hotbar.
    The right mouse button.
    Holding shift while pressing the left mouse button.
    Holding shift while pressing the right mouse button.
    The "swap item with offhand" key (defaults to F).
    A type of inventory manipulation not yet recognized by Bukkit.
    Clicking the left mouse button on the grey area around the inventory.
    Clicking the right mouse button on the grey area around the inventory.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Gets whether this ClickType represents an action that can only be performed by a Player in creative mode.
    boolean
    Gets whether this ClickType represents the pressing of a key on a keyboard.
    boolean
    Gets whether this ClickType represents a left click.
    boolean
    Gets whether this ClickType represents a right click.
    boolean
    Gets whether this ClickType indicates that the shift key was pressed down when the click was made.
    static ClickType
    Returns the enum constant of this type with the specified name.
    static ClickType[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • LEFT

      public static final ClickType LEFT
      The left (or primary) mouse button.
    • SHIFT_LEFT

      public static final ClickType SHIFT_LEFT
      Holding shift while pressing the left mouse button.
    • SHIFT_RIGHT

      public static final ClickType SHIFT_RIGHT
      Holding shift while pressing the right mouse button.
    • WINDOW_BORDER_LEFT

      public static final ClickType WINDOW_BORDER_LEFT
      Clicking the left mouse button on the grey area around the inventory.
    • WINDOW_BORDER_RIGHT

      public static final ClickType WINDOW_BORDER_RIGHT
      Clicking the right mouse button on the grey area around the inventory.
    • MIDDLE

      public static final ClickType MIDDLE
      The middle mouse button, or a "scrollwheel click".
    • NUMBER_KEY

      public static final ClickType NUMBER_KEY
      One of the number keys 1-9, correspond to slots on the hotbar.
    • DOUBLE_CLICK

      public static final ClickType DOUBLE_CLICK
      Pressing the left mouse button twice in quick succession.
    • DROP

      public static final ClickType DROP
      The "Drop" key (defaults to Q).
    • CONTROL_DROP

      public static final ClickType CONTROL_DROP
      Holding Ctrl while pressing the "Drop" key (defaults to Q).
    • CREATIVE

      public static final ClickType CREATIVE
      Any action done with the Creative inventory open.
    • SWAP_OFFHAND

      public static final ClickType SWAP_OFFHAND
      The "swap item with offhand" key (defaults to F).
    • UNKNOWN

      public static final ClickType UNKNOWN
      A type of inventory manipulation not yet recognized by Bukkit.

      This is only for transitional purposes on a new Minecraft update, and should never be relied upon.

      Any ClickType.UNKNOWN is called on a best-effort basis.

  • Method Details

    • values

      public static ClickType[] 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 ClickType 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
    • isKeyboardClick

      public boolean isKeyboardClick()
      Gets whether this ClickType represents the pressing of a key on a keyboard.
      Returns:
      true if this ClickType represents the pressing of a key
    • isCreativeAction

      public boolean isCreativeAction()
      Gets whether this ClickType represents an action that can only be performed by a Player in creative mode.
      Returns:
      true if this action requires Creative mode
    • isRightClick

      public boolean isRightClick()
      Gets whether this ClickType represents a right click.
      Returns:
      true if this ClickType represents a right click
    • isLeftClick

      public boolean isLeftClick()
      Gets whether this ClickType represents a left click.
      Returns:
      true if this ClickType represents a left click
    • isShiftClick

      public boolean isShiftClick()
      Gets whether this ClickType indicates that the shift key was pressed down when the click was made.
      Returns:
      true if the action uses Shift.