A simple and lightweight API to await player chat responses asynchronously in Spigot plugins.
- Await player chat input asynchronously
- Works with timeouts
- Perfect for menus, prompts, or simple chat-based forms
build.gradle.kts
(Kotlin DSL)
repositories {
maven("https://jitpack.io")
}
build.gradle
(Groovy DSL)
repositories {
maven { url 'https://jitpack.io' }
}
pom.xml
(Maven)
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
build.gradle.kts
dependencies {
compileOnly("com.github.Fameless9:ChatResponseAPI:1.0.0")
}
build.gradle
dependencies {
compileOnly 'com.github.Fameless9:ChatResponseAPI:1.0.0'
}
pom.xml
<dependency>
<groupId>com.github.Fameless9</groupId>
<artifactId>ChatResponseAPI</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
Register the ChatResponseListener in your onEnable method:
getServer().getPluginManager().registerEvents(ChatResponseListener.INSTANCE, this);
player.sendMessage("What does rule 4 say?");
ChatResponseAPI.awaitResponse(player, 10_000).thenAccept(response -> {
player.sendMessage("You answered: " + response);
});
This project is licensed under the MIT License – see LICENSE for details.