Package net.kyori.adventure.text.event
Class ClickEvent
java.lang.Object
net.kyori.adventure.text.event.ClickEvent
- All Implemented Interfaces:
- ComponentBuilderApplicable,- StyleBuilderApplicable,- net.kyori.examination.Examinable
public final class ClickEvent extends Object implements net.kyori.examination.Examinable, StyleBuilderApplicable
A click event.
 
A click event processes an ClickEvent.Action when clicked on.
- Since:
- 4.0.0
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classClickEvent.ActionAn enumeration of click event actions.
- 
Method SummaryModifier and Type Method Description @NonNull ClickEvent.Actionaction()Gets the click event action.static @NonNull ClickEventchangePage(int page)Creates a click event that changes to a page.static @NonNull ClickEventchangePage(@NonNull String page)Creates a click event that changes to a page.static @NonNull ClickEventclickEvent(@NonNull ClickEvent.Action action, @NonNull String value)Creates a click event.static @NonNull ClickEventcopyToClipboard(@NonNull String text)Creates a click event that copies text to the clipboard.booleanequals(@Nullable Object other)@NonNull Stream<? extends net.kyori.examination.ExaminableProperty>examinableProperties()inthashCode()static @NonNull ClickEventopenFile(@NonNull String file)Creates a click event that opens a file.static @NonNull ClickEventopenUrl(@NonNull String url)Creates a click event that opens a url.static @NonNull ClickEventopenUrl(@NonNull URL url)Creates a click event that opens a url.static @NonNull ClickEventrunCommand(@NonNull String command)Creates a click event that runs a command.voidstyleApply(@NonNull Style.Builder style)Applies tostyle.static @NonNull ClickEventsuggestCommand(@NonNull String command)Creates a click event that suggests a command.StringtoString()@NonNull Stringvalue()Gets the click event value.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.kyori.adventure.text.format.StyleBuilderApplicablecomponentBuilderApply
- 
Method Details- 
openUrlCreates a click event that opens a url.- Parameters:
- url- the url to open
- Returns:
- a click event
- Since:
- 4.0.0
 
- 
openUrlCreates a click event that opens a url.- Parameters:
- url- the url to open
- Returns:
- a click event
- Since:
- 4.0.0
 
- 
openFileCreates a click event that opens a file.This action is not readable, and may only be used locally on the client. - Parameters:
- file- the file to open
- Returns:
- a click event
- Since:
- 4.0.0
 
- 
runCommandCreates a click event that runs a command.- Parameters:
- command- the command to run
- Returns:
- a click event
- Since:
- 4.0.0
 
- 
suggestCommandCreates a click event that suggests a command.- Parameters:
- command- the command to suggest
- Returns:
- a click event
- Since:
- 4.0.0
 
- 
changePageCreates a click event that changes to a page.- Parameters:
- page- the page to change to
- Returns:
- a click event
- Since:
- 4.0.0
 
- 
changePageCreates a click event that changes to a page.- Parameters:
- page- the page to change to
- Returns:
- a click event
- Since:
- 4.0.0
 
- 
copyToClipboardCreates a click event that copies text to the clipboard.- Parameters:
- text- the text to copy to the clipboard
- Returns:
- a click event
- Since:
- 4.0.0
 
- 
clickEventpublic static @NonNull ClickEvent clickEvent(@NonNull ClickEvent.Action action, @NonNull String value)Creates a click event.- Parameters:
- action- the action
- value- the value
- Returns:
- a click event
- Since:
- 4.0.0
 
- 
actionGets the click event action.- Returns:
- the click event action
- Since:
- 4.0.0
 
- 
valueGets the click event value.- Returns:
- the click event value
- Since:
- 4.0.0
 
- 
styleApplyDescription copied from interface:StyleBuilderApplicableApplies tostyle.- Specified by:
- styleApplyin interface- StyleBuilderApplicable
- Parameters:
- style- the style builder
 
- 
equals
- 
hashCodepublic int hashCode()
- 
examinableProperties- Specified by:
- examinablePropertiesin interface- net.kyori.examination.Examinable
 
- 
toString
 
-