Package net.kyori.adventure.text.event
Enum ClickEvent.Action
- All Implemented Interfaces:
Serializable,Comparable<ClickEvent.Action>
- Enclosing class:
- ClickEvent
An enumeration of click event actions.
- Since:
- 4.0.0
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionChanges the page of a book.Copies text to the clipboard.Sends a custom event to the server.Opens a file when clicked.Opens a url when clicked.Runs a command when clicked.Shows a dialog.Suggests a command into the chat box. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription@NotNull Class<? extends ClickEvent.Payload>The type of the payload this click event supports.booleanreadable()Tests if this action is readable.booleansupports(@NotNull ClickEvent.Payload payload) Returns if this action supports the provided payload.@NotNull StringtoString()static ClickEvent.ActionReturns the enum constant of this type with the specified name.static ClickEvent.Action[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
OPEN_URL
Opens a url when clicked.- Since:
- 4.0.0
-
OPEN_FILE
Opens a file when clicked.This action is not readable, and may only be used locally on the client.
- Since:
- 4.0.0
-
RUN_COMMAND
Runs a command when clicked.- Since:
- 4.0.0
-
SUGGEST_COMMAND
Suggests a command into the chat box.- Since:
- 4.0.0
-
CHANGE_PAGE
Changes the page of a book.- Since:
- 4.0.0
-
COPY_TO_CLIPBOARD
Copies text to the clipboard.- Since:
- 4.0.0
- Since Minecraft:
- 1.15
-
SHOW_DIALOG
Shows a dialog.This action is not readable at this time until Adventure has a full Dialog API.
- Since:
- 4.22.0
- Since Minecraft:
- 1.21.6
-
CUSTOM
Sends a custom event to the server.- Since:
- 4.22.0
- Since Minecraft:
- 1.21.6
-
-
Field Details
-
NAMES
The name map.- Since:
- 4.0.0
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
readable
public boolean readable()Tests if this action is readable.- Returns:
trueif this action is readable,falseif this action is not readable- Since:
- 4.0.0
-
supports
Returns if this action supports the provided payload.- Parameters:
payload- the payload- Returns:
trueif this action supports the payload- Since:
- 4.22.0
-
payloadType
The type of the payload this click event supports.- Returns:
- the payload type
- Since:
- 4.22.0
-
toString
- Overrides:
toStringin classEnum<ClickEvent.Action>
-