Class AnvilInputView.Builder

java.lang.Object
me.agent.vgui.api.input.AnvilInputView.Builder
Enclosing class:
AnvilInputView

public static final class AnvilInputView.Builder extends Object
Builder for AnvilInputView.
  • Method Details

    • title

      public AnvilInputView.Builder title(net.kyori.adventure.text.Component title)
      Window title.
    • initialText

      public AnvilInputView.Builder initialText(String initialText)
      Text pre-filled in the rename field.
    • itemType

      public AnvilInputView.Builder itemType(com.github.retrooper.packetevents.protocol.item.type.ItemType itemType)
      Item type shown in the input and output slots (default paper).
    • onConfirm

      public AnvilInputView.Builder onConfirm(BiConsumer<com.velocitypowered.api.proxy.Player, String> onConfirm)
      Called when the player clicks the output slot to confirm.
    • onCancel

      public AnvilInputView.Builder onCancel(Consumer<com.velocitypowered.api.proxy.Player> onCancel)
      Called when the player closes the prompt without confirming.
    • onType

      Called on every keystroke with the full current text.
    • build

      public AnvilInputView build()
      Builds the view.
    • open

      public void open(com.velocitypowered.api.proxy.Player player)
      Builds the view and opens it for a player.