ALB Studio

Chat input

Ask a player to type something in chat. Works for Bedrock players too.

Docs updated · What changed

On this page

Ask a player to type something in chat. It works for Bedrock players too, unlike anvil or sign input.

Asking for textLink to this section

Kotlin
ChatInput.ask(plugin, player, prompt = "&7Type a name for the home.", onCancel = { openHomes(it, null) }) { text ->
    if (text.length > 16) { lang.send(player, "home.too-long"); false }   // keep asking
    else { createHome(player, text); openHomes(player, null); true }     // done
}

How it behavesLink to this section

  • The open menu is closed, the prompt and a cancel hint are sent, and the player's chat message is cancelled and handed to your code on the main thread.
  • Typing a cancel word (chat-input.cancel-words in ALBCore's lang.yml, default cancel) or the timeout (default 60 s) runs onCancel. cancelWords = emptyList() gives every message to your handler.

Type a class, method, config key or topic. Use the arrow keys and Enter to open a result.