Enum Class ClickAction

java.lang.Object
java.lang.Enum<ClickAction>
com.kamikazejam.kamicommon.nms.text.ClickAction
All Implemented Interfaces:
Serializable, Comparable<ClickAction>, Constable

public enum ClickAction extends Enum<ClickAction>
A click behaviour that can be attached to a VersionedComponent.

This exists so that callers can build clickable text without naming an Adventure type. The shaded Adventure copy is an implementation detail of the versions/* modules: it is present only for servers with no native Adventure, and anything above this module that referenced it would pin it onto every server. See VersionedComponent#click.

  • Enum Constant Details

    • RUN_COMMAND

      public static final ClickAction RUN_COMMAND
      Runs the value as a command as the clicking player.
    • SUGGEST_COMMAND

      public static final ClickAction SUGGEST_COMMAND
      Places the value in the player's chat input without sending it.
    • OPEN_URL

      public static final ClickAction OPEN_URL
      Opens the value as a URL.
    • COPY_TO_CLIPBOARD

      public static final ClickAction COPY_TO_CLIPBOARD
      Copies the value to the player's clipboard.

      Not available before 1.16. Implementations below that version throw UnsupportedOperationException naming the server version rather than dropping the behaviour silently, because a click that quietly does nothing is worse than one that fails loudly during development.

  • Method Details

    • values

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

      public static ClickAction valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null