Interface ClickEvent.Payload
- All Known Subinterfaces:
ClickEvent.Payload.Custom, ClickEvent.Payload.Dialog, ClickEvent.Payload.Int, ClickEvent.Payload.Text
- Enclosing class:
ClickEvent<T extends ClickEvent.Payload>
public static sealed interface ClickEvent.Payload
permits ClickEvent.Payload.Custom, ClickEvent.Payload.Dialog, ClickEvent.Payload.Int, ClickEvent.Payload.Text
A payload for a click event.
Note: although this interface is sealed, new implementations may be added at any time as and when needed.
- Since:
- 4.22.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA payload with a key and optional custom NBT data.static interfaceA payload that holds a dialog.static interfaceA payload that holds an integer.static interfaceA payload that holds a string. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ClickEvent.Payload.CustomCreates a custom payload.static ClickEvent.Payload.Customcustom(Key key, @Nullable BinaryTagHolder nbt) Creates a custom payload.static ClickEvent.Payload.Dialogdialog(DialogLike dialog) Creates a dialog payload.static ClickEvent.Payload.Intinteger(int integer) Creates an integer payload.static ClickEvent.Payload.TextCreates a text payload.
-
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
Creates a custom payload.- Parameters:
key- the key identifying the payload- Returns:
- the payload
- Since:
- 5.0.0
-
custom
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, optional- Returns:
- the payload
- Since:
- 4.23.0
-