Interface DialogBody

All Known Implementing Classes:
DialogBody.Item, DialogBody.PlainMessage

public sealed interface DialogBody permits DialogBody.PlainMessage, DialogBody.Item
A single element of a dialog body, that is the contents shown between the title and the inputs or the action buttons.
Since:
0.1.0
See Also:
  • Field Details

    • MAX_WIDTH

      static final int MAX_WIDTH
      Largest width the client accepts for a body element.
      Since:
      0.1.0
      See Also:
    • DEFAULT_WIDTH

      static final int DEFAULT_WIDTH
      Default width of a body element.
      Since:
      0.1.0
      See Also:
  • Method Details

    • message

      @Contract("_ -> new") static DialogBody.PlainMessage message(ComponentLike contents)
      Creates a multiline label of the default width.
      Parameters:
      contents - the text to display
      Returns:
      the body element
      Since:
      0.1.0
    • message

      @Contract("_, _ -> new") static DialogBody.PlainMessage message(ComponentLike contents, int width)
      Creates a multiline label.
      Parameters:
      contents - the text to display
      width - the maximum width of the message, between 1 and 1024
      Returns:
      the body element
      Since:
      0.1.0
    • item

      @Contract("_ -> new") static DialogBody.Item.Builder item(ItemStack item)
      Starts building an item body element.
      Parameters:
      item - the stack to display
      Returns:
      a fresh builder
      Since:
      0.1.0