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
  • Method Details

    • string

      static ClickEvent.Payload.Text string(String value)
      Creates a text payload.
      Parameters:
      value - the payload value
      Returns:
      the payload
      Since:
      4.22.0
    • integer

      static ClickEvent.Payload.Int integer(int integer)
      Creates an integer payload.
      Parameters:
      integer - the integer
      Returns:
      the payload
      Since:
      4.22.0
    • dialog

      static ClickEvent.Payload.Dialog dialog(DialogLike dialog)
      Creates a dialog payload.
      Parameters:
      dialog - the payload value
      Returns:
      the payload
      Since:
      4.22.0
    • custom

      static ClickEvent.Payload.Custom custom(Key key)
      Creates a custom payload.
      Parameters:
      key - the key identifying the payload
      Returns:
      the payload
      Since:
      5.0.0
    • custom

      static ClickEvent.Payload.Custom custom(Key key, @Nullable 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 payload
      nbt - the payload nbt data, optional
      Returns:
      the payload
      Since:
      4.23.0