An open API service indexing awesome lists of open source software.

https://github.com/fameless9/chatresponseapi

API to get chat responses from players easily and asynchronously
https://github.com/fameless9/chatresponseapi

bukkit java jitpack library minecraft papermc plugin-development spigot spigot-api

Last synced: 5 months ago
JSON representation

API to get chat responses from players easily and asynchronously

Awesome Lists containing this project

README

          

# ChatResponseAPI

A simple and lightweight API to await player chat responses asynchronously in Spigot plugins.

[![JitPack](https://jitpack.io/v/Fameless9/ChatResponseAPI.svg)](https://jitpack.io/#Fameless9/ChatResponseAPI)

---

## ✨ Features

- Await player chat input asynchronously
- Works with timeouts
- Perfect for menus, prompts, or simple chat-based forms

---

## 📦 Installation

### Add JitPack to your repositories

build.gradle.kts (Kotlin DSL)

```kotlin
repositories {
maven("https://jitpack.io")
}
```

build.gradle (Groovy DSL)

```groovy
repositories {
maven { url 'https://jitpack.io' }
}
```

pom.xml (Maven)

```xml


jitpack.io
https://jitpack.io


```

---

### Add the dependency

build.gradle.kts

```kotlin
dependencies {
compileOnly("com.github.Fameless9:ChatResponseAPI:1.0.0")
}
```

build.gradle

```groovy
dependencies {
compileOnly 'com.github.Fameless9:ChatResponseAPI:1.0.0'
}
```

pom.xml

```xml

com.github.Fameless9
ChatResponseAPI
1.0.0
provided

```

---

### Register the API listener

Register the ChatResponseListener in your onEnable method:
```java
getServer().getPluginManager().registerEvents(ChatResponseListener.INSTANCE, this);
```

---

## 🛠️ Usage Example

```java
player.sendMessage("What does rule 4 say?");
ChatResponseAPI.awaitResponse(player, 10_000).thenAccept(response -> {
player.sendMessage("You answered: " + response);
});
```
---

## 📄 License

This project is licensed under the MIT License – see [LICENSE](LICENSE) for details.