Interface AnvilInputBuilder


public interface AnvilInputBuilder
Builder for creating Anvil-based text input GUIs.
  • Method Details

    • title

      @NotNull @NotNull AnvilInputBuilder title(@NotNull @NotNull String title)
      Sets the title of the anvil GUI.
      Parameters:
      title - the title
      Returns:
      this builder
    • initialText

      @NotNull @NotNull AnvilInputBuilder initialText(@NotNull @NotNull String text)
      Sets the initial text in the rename slot.
      Parameters:
      text - the initial text
      Returns:
      this builder
    • leftItem

      @NotNull @NotNull AnvilInputBuilder leftItem(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Sets the left input item stack.
      Parameters:
      item - the item stack
      Returns:
      this builder
    • maxLength

      @NotNull @NotNull AnvilInputBuilder maxLength(int limit)
      Sets the maximum character limit for the input.
      Parameters:
      limit - the max character length
      Returns:
      this builder
    • onSubmit

      @NotNull @NotNull AnvilInputBuilder onSubmit(@NotNull @NotNull BiConsumer<org.bukkit.entity.Player,String> callback)
      Sets the callback executed when the player submits the input (clicks the output slot). The callback receives the player and the typed text.
      Parameters:
      callback - the submit callback
      Returns:
      this builder
    • onClose

      @NotNull @NotNull AnvilInputBuilder onClose(@NotNull @NotNull Consumer<org.bukkit.entity.Player> callback)
      Sets the callback executed when the GUI is closed without submitting.
      Parameters:
      callback - the close callback
      Returns:
      this builder
    • closePolicy

      @NotNull @NotNull AnvilInputBuilder closePolicy(@NotNull @NotNull ClosePolicy policy)
      Sets the close policy for this Anvil GUI.
      Parameters:
      policy - the close policy
      Returns:
      this builder
    • open

      void open(@NotNull @NotNull org.bukkit.entity.Player player)
      Opens the anvil GUI for the specified player.
      Parameters:
      player - the player