Package net.kyori.adventure.text.event
Interface ClickEvent.Payload
- All Superinterfaces:
net.kyori.examination.Examinable
- All Known Subinterfaces:
ClickEvent.Payload.Custom,ClickEvent.Payload.Dialog,ClickEvent.Payload.Int,ClickEvent.Payload.Text
- Enclosing class:
- ClickEvent
public static interface ClickEvent.Payload
extends net.kyori.examination.Examinable
A payload for a click event.
- Since:
- 4.22.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA payload that holds custom data.static interfaceA payload that holds a dialog.static interfaceA payload that holds an integer.static interfaceA payload that holds a string. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ClickEvent.Payload.CustomDeprecated.static @NotNull ClickEvent.Payload.Customcustom(@NotNull Key key, @NotNull BinaryTagHolder nbt) Creates a custom payload.static @NotNull ClickEvent.Payload.Dialogdialog(@NotNull DialogLike dialog) Creates a dialog payload.static @NotNull ClickEvent.Payload.Intinteger(int integer) Creates an integer payload.static @NotNull ClickEvent.Payload.TextCreates a text payload.Methods inherited from interface net.kyori.examination.Examinable
examinableName, examinableProperties, examine
-
Method Details
-
string
Creates a text payload.- Parameters:
value- the payload value- Returns:
- the payload
- Since:
- 4.22.0
-
integer
Creates an integer payload.- Parameters:
integer- the integer- Returns:
- the payload
- Since:
- 4.22.0
-
dialog
Creates a dialog payload.- Parameters:
dialog- the payload value- Returns:
- the payload
- Since:
- 4.22.0
-
custom
@Deprecated static @NotNull ClickEvent.Payload.Custom custom(@NotNull @NotNull Key key, @NotNull @NotNull String data) Deprecated.For removal since 4.23.0, payloads hold NBT data, usecustom(Key, BinaryTagHolder)instead. This method will create NBT usingBinaryTagHolder.binaryTagHolder(String).Creates a custom payload.- Parameters:
key- the key identifying the payloaddata- the payload data- Returns:
- the payload
- Since:
- 4.22.0
-
custom
static @NotNull ClickEvent.Payload.Custom custom(@NotNull @NotNull Key key, @NotNull @NotNull BinaryTagHolder nbt) Creates a custom payload.See
BinaryTagHolder.binaryTagHolder(String)for a simple way to create NBT from SNBT. For simple use cases, you can use plain strings directly as SNBT.- Parameters:
key- the key identifying the payloadnbt- the payload nbt data- Returns:
- the payload
- Since:
- 4.23.0
-
custom(Key, BinaryTagHolder)instead.