Interface DialogBody

All Known Subinterfaces:
ItemDialogBody, PlainMessageDialogBody

public sealed interface DialogBody permits ItemDialogBody, PlainMessageDialogBody
Represents the body of a dialog.
  • Method Details

    • item

      @Contract(pure=true, value="_, _, _, _, _, _ -> new") static ItemDialogBody item(ItemStack item, @Nullable PlainMessageDialogBody description, boolean showDecorations, boolean showTooltip, int width, int height)
      Creates an item body for a dialog.
      Parameters:
      item - the item to display in the dialog
      description - the description of the body, or null if not set
      showDecorations - whether to show decorations around the item
      showTooltip - whether to show a tooltip for the item
      width - the width of the item body
      height - the height of the item body
      Returns:
      a new item body instance
    • item

      @Contract(pure=true, value="_ -> new") static ItemDialogBody.Builder item(ItemStack item)
      Creates a new item dialog body builder.
      Parameters:
      item - the item to display in the dialog
      Returns:
      a new item dialog body builder instance
    • plainMessage

      @Contract(pure=true, value="_, -> new") static PlainMessageDialogBody plainMessage(Component contents)
      Creates a plain message body for a dialog.
      Parameters:
      contents - the contents of the message
      Returns:
      a new plain message body instance
    • plainMessage

      @Contract(pure=true, value="_, _ -> new") static PlainMessageDialogBody plainMessage(Component contents, @org.jetbrains.annotations.Range(from=1L, to=1024L) int width)
      Creates a plain message body for a dialog.
      Parameters:
      contents - the contents of the message
      width - the width of the message body
      Returns:
      a new plain message body instance