Enum Class ClickAction
- All Implemented Interfaces:
Serializable, Comparable<ClickAction>, Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCopies the value to the player's clipboard.Opens the value as a URL.Runs the value as a command as the clicking player.Places the value in the player's chat input without sending it. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClickActionReturns the enum constant of this class with the specified name.static ClickAction[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RUN_COMMAND
Runs the value as a command as the clicking player. -
SUGGEST_COMMAND
Places the value in the player's chat input without sending it. -
OPEN_URL
Opens the value as a URL. -
COPY_TO_CLIPBOARD
Copies the value to the player's clipboard.Not available before 1.16. Implementations below that version throw
UnsupportedOperationExceptionnaming 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
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
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 nameNullPointerException- if the argument is null
-