Interface DialogAction

All Known Implementing Classes:
DialogAction.DynamicCustom, DialogAction.DynamicRunCommand, DialogAction.ShowDialog, DialogAction.Static

  • Method Details

    • of

      @Contract("_ -> new") static DialogAction of(ClickEvent<?> event)
      Wraps an Adventure click event as a static dialog action.
      Parameters:
      event - the click event to perform
      Returns:
      the action
      Throws:
      IllegalArgumentException - if event opens a file, which dialogs do not support
      Since:
      0.1.0
    • openUrl

      @Contract("_ -> new") static DialogAction openUrl(String url)
      Opens a URL in the player's browser.
      Parameters:
      url - the address to open
      Returns:
      the action
      Since:
      0.1.0
    • runCommand

      @Contract("_ -> new") static DialogAction runCommand(String command)
      Runs a command as the player, who therefore needs the matching permission.
      Parameters:
      command - the command to run, with or without its leading slash
      Returns:
      the action
      Since:
      0.1.0
    • suggestCommand

      @Contract("_ -> new") static DialogAction suggestCommand(String command)
      Opens the chat box pre-filled with some text.
      Parameters:
      command - the text to suggest
      Returns:
      the action
      Since:
      0.1.0
    • copyToClipboard

      @Contract("_ -> new") static DialogAction copyToClipboard(String value)
      Copies text to the player's clipboard.
      Parameters:
      value - the text to copy
      Returns:
      the action
      Since:
      0.1.0
    • callback

      @Contract("_ -> new") static DialogAction callback(ClickCallback<Audience> callback)
      Runs server-side code when the button is pressed.
      Parameters:
      callback - the code to run, receiving the player who clicked
      Returns:
      the action
      Since:
      0.1.0
    • callback

      @Contract("_, _ -> new") static DialogAction callback(ClickCallback<Audience> callback, ClickCallback.Options options)
      Runs server-side code when the button is pressed.
      Parameters:
      callback - the code to run, receiving the player who clicked
      options - how long the callback lives and how often it may fire
      Returns:
      the action
      Since:
      0.1.0
    • custom

      @Contract("_ -> new") static DialogAction custom(Key id)
      Sends a bare event to the server, without any dialog input attached.
      Parameters:
      id - the identifier the server matches on
      Returns:
      the action
      Since:
      0.1.0
    • custom

      @Contract("_, _ -> new") static DialogAction custom(Key id, @Nullable BinaryTagHolder payload)
      Sends an event with a fixed payload to the server.
      Parameters:
      id - the identifier the server matches on
      payload - the payload to attach, or null for none
      Returns:
      the action
      Since:
      0.1.0
    • showDialog

      @Contract("_ -> new") static DialogAction showDialog(Dialog dialog)
      Opens another dialog, defined inline or referenced from the registry.
      Parameters:
      dialog - the dialog to open
      Returns:
      the action
      Since:
      0.1.0
    • dynamicRunCommand

      @Contract("_ -> new") static DialogAction dynamicRunCommand(String template)
      Builds a command from the dialog's inputs and runs it as the player.
      Parameters:
      template - the macro command to run, with or without its leading slash
      Returns:
      the action
      Since:
      0.1.0
    • dynamicCustom

      @Contract("_ -> new") static DialogAction dynamicCustom(Key id)
      Sends every input value back to the server under a single identifier.
      Parameters:
      id - the identifier the server matches on
      Returns:
      the action
      Since:
      0.1.0
    • dynamicCustom

      @Contract("_, _ -> new") static DialogAction dynamicCustom(Key id, @Nullable CompoundBinaryTag additions)
      Sends every input value back to the server, alongside some fixed data.
      Parameters:
      id - the identifier the server matches on
      additions - extra tags merged into the payload next to the input values
      Returns:
      the action
      Since:
      0.1.0