public final class ClickEvent
extends java.lang.Object
A click event processes an ClickEvent.Action when clicked on.
| Modifier and Type | Class and Description |
|---|---|
static class |
ClickEvent.Action
An enumeration of click event actions.
|
| Modifier and Type | Method and Description |
|---|---|
@NonNull ClickEvent.Action |
action()
Gets the click event action.
|
static @NonNull ClickEvent |
changePage(int page)
Creates a click event that changes to a page.
|
static @NonNull ClickEvent |
changePage(@NonNull java.lang.String page)
Creates a click event that changes to a page.
|
boolean |
equals(@Nullable java.lang.Object other) |
int |
hashCode() |
static @NonNull ClickEvent |
of(@NonNull ClickEvent.Action action,
@NonNull java.lang.String value)
Creates a click event.
|
static @NonNull ClickEvent |
openFile(@NonNull java.lang.String file)
Creates a click event that opens a file.
|
static @NonNull ClickEvent |
openUrl(@NonNull java.lang.String url)
Creates a click event that opens a url.
|
static @NonNull ClickEvent |
runCommand(@NonNull java.lang.String command)
Creates a click event that runs a command.
|
static @NonNull ClickEvent |
suggestCommand(@NonNull java.lang.String command)
Creates a click event that suggests a command.
|
java.lang.String |
toString() |
@NonNull java.lang.String |
value()
Gets the click event value.
|
public static @NonNull ClickEvent of(@NonNull ClickEvent.Action action, @NonNull java.lang.String value)
action - the actionvalue - the valuepublic static @NonNull ClickEvent openUrl(@NonNull java.lang.String url)
url - the url to openpublic static @NonNull ClickEvent openFile(@NonNull java.lang.String file)
This action is not readable, and may only be used locally on the client.
file - the file to openpublic static @NonNull ClickEvent runCommand(@NonNull java.lang.String command)
command - the command to runpublic static @NonNull ClickEvent suggestCommand(@NonNull java.lang.String command)
command - the command to suggestpublic static @NonNull ClickEvent changePage(@NonNull java.lang.String page)
page - the page to change topublic static @NonNull ClickEvent changePage(int page)
page - the page to change topublic @NonNull ClickEvent.Action action()
public @NonNull java.lang.String value()
public boolean equals(@Nullable java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object