Pages: Chat input

Chat input

Sometimes you want a player to type something in chat and have your plugin catch it, instead of using a command or a sign. ChatInputService handles this for you.

ChatInputService.begin(player) { input ->
    player.sendMessage("You typed: $input")
}

The player will get a small message asking them to type something. If you don't want that message, pass silent = true. You can also cancel it early with ChatInputService.cancel(player).