Module net.kyori.adventure.api
Package net.kyori.adventure.text.event
Class ClickEvent.Action<T extends ClickEvent.Payload>
java.lang.Object
net.kyori.adventure.text.event.ClickEvent.Action<T>
- Type Parameters:
T- the payload type
- Direct Known Subclasses:
ClickEvent.Action.ChangePage,ClickEvent.Action.Custom,ClickEvent.Action.ShowDialog,ClickEvent.Action.TextCarrier
- Enclosing class:
ClickEvent<T extends ClickEvent.Payload>
public abstract static sealed class ClickEvent.Action<T extends ClickEvent.Payload>
extends Object
permits ClickEvent.Action.ChangePage, ClickEvent.Action.Custom, ClickEvent.Action.ShowDialog, ClickEvent.Action.TextCarrier
An enumeration of click event actions.
Note: although this interface is sealed, new implementations may be added at any time as and when needed.
- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classChanges the page of a book.static final classCopies text to the clipboard.static final classSends a custom event to the server.static final classOpens a file when clicked.static final classOpens a url when clicked.static final classRuns a command when clicked.static final classShows a dialog.static final classSuggests a command.static classAn action with a text payload. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClickEvent.Action.ChangePageChanges the page of a book.static final ClickEvent.Action.CopyToClipboardCopies text to the clipboard.static final ClickEvent.Action.CustomSends a custom event to the server.static final Index<String, ClickEvent.Action<?>> The name map.static final ClickEvent.Action.OpenFileOpens a file when clicked.static final ClickEvent.Action.OpenUrlOpens a url when clicked.static final ClickEvent.Action.RunCommandRuns a command when clicked.static final ClickEvent.Action.ShowDialogShows a dialog.static final ClickEvent.Action.SuggestCommandSuggests a command into the chat box. -
Method Summary
-
Field 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
-
NAMES
The name map.- Since:
- 4.0.0
-
-
Method Details
-
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
-
name
Returns the name of this action.- Returns:
- the name of the action
- Since:
- 4.0.0
-
toString
-
hashCode
public int hashCode() -
equals
-