PurpurInsight is a Paper plugin for Minecraft 1.21.4 that integrates a Discord bot to display server statistics via a slash command (/stats
). It uses the Purpur API and JDA-KTX for bot functionality.
- Online player count
- TPS (1, 5, 15 minute averages) and MSPT
- RAM usage (used / max)
- CPU load
- Server uptime
- Number of loaded plugins
- World statistics (worlds, chunks, entities)
- Average player latency
- Top 5 players by playtime
- Disk usage (total / free)
- Scheduled updates to the stats channel
- Ping command
- Admin alerts for critical server load
- In-game command
/purpurinsight
to change Discord channel IDs or restart the bot
- Java 21
- Paper/Purpur Server 1.21.4
- Gradle (Kotlin DSL)
- Discord bot token with
bot
andapplications.commands
scopes
- Clone the repository and set the package name to
cancelcloud
. - Build the plugin with Gradle:
./gradlew shadowJar
- Copy the generated
PurpurInsight-1.0.0.jar
to your server'splugins/
folder. - Start the server to generate the default
config.yml
. - Fill in your Discord bot token, guild ID, channel ID, and command name in
plugins/PurpurInsight/config.yml
. - Restart the server.
bot:
token: "YOUR_BOT_TOKEN"
guild-id: 123456789012345678
stats-channel-id: 123456789012345678
admin-channel-id: 123456789012345678
command-name: "stats"
auto-update-minutes: 30
playtime: {}
- In Discord, type
/stats
in your configured guild and channel. - The bot will reply with an embed containing all configured statistics.
- Use
/purpurinsight <stats-channel|admin-channel> <id>
in-game to update the Discord channel IDs. The bot will restart automatically. - Run
/purpurinsight restart
in-game to manually restart the bot without restarting the server.
- Source code is under
src/main/kotlin/cancelcloud/
. - Build scripts:
build.gradle.kts
,settings.gradle.kts
.
Pull requests are welcome. Please follow the Kotlin coding conventions and include tests if applicable.
This project is licensed under the MIT License.
PurpurInsight ist ein Paper-Plugin für Minecraft 1.21.4, das einen Discord-Bot integriert, um Serverstatistiken per Slash-Command (/stats
) anzuzeigen. Es verwendet die Purpur-API und JDA-KTX.
- Anzahl der Online-Spieler
- TPS (1-, 5- und 15-Minuten-Durchschnitte) und MSPT
- RAM-Nutzung (verwendet / maximal)
- CPU-Auslastung
- Server-Laufzeit
- Anzahl der geladenen Plugins
- Weltstatistiken (Welten, Chunks, Entities)
- Durchschnittliche Spieler-Latenz
- Top 5 Spieler nach Spielzeit
- Festplattennutzung (gesamt / frei)
- Automatische Updates im Discord-Kanal
- Ping-Befehl
- Admin-Benachrichtigungen bei kritischer Serverlast
- Befehl
/purpurinsight
, um Discord-Kanäle zu ändern oder den Bot neu zu starten
- Java 21
- Paper-/Purpur-Server 1.21.4
- Gradle (Kotlin DSL)
- Discord-Bot-Token mit
bot
- undapplications.commands
-Scopes
- Repository klonen und Paketname auf
cancelcloud
setzen. - Plugin mit Gradle bauen:
./gradlew shadowJar
- Die erzeugte
PurpurInsight-1.0.0.jar
in denplugins/
-Ordner des Servers kopieren. - Server starten, um die Standard-
config.yml
zu erstellen. - Discord-Bot-Token, Guild-ID, Channel-ID und Command-Name in
plugins/PurpurInsight/config.yml
ausfüllen. - Server neu starten.
bot:
token: "DEIN_BOT_TOKEN"
guild-id: 123456789012345678
stats-channel-id: 123456789012345678
admin-channel-id: 123456789012345678
command-name: "stats"
auto-update-minutes: 30
playtime: {}
- In Discord
/stats
in der konfigurierten Gilde und im Kanal eingeben. - Der Bot antwortet mit einem Embed, das alle Statistiken enthält.
- Mit
/purpurinsight <stats-channel|admin-channel> <id>
können die Discord-Kanäle im Spiel geändert werden; der Bot startet danach neu. - Mit
/purpurinsight restart
lässt sich der Bot neu starten, ohne den Server neu zu starten.
Pull-Requests sind willkommen. Bitte halte dich an die Kotlin-Coding-Conventions und füge bei Bedarf Tests hinzu.
Dieses Projekt ist unter der MIT-Lizenz lizenziert.