AstralChat Overview
AstralChat is the network-wide chat plugin for AstralRealms. It replaces vanilla chat with a configurable channel system, cross-server private messaging, filters, tags, mentions, and a public API that other plugins can hook into.
What it provides
Feature | Summary |
|---|---|
Channels | YAML-defined chat channels with their own format, permission, cooldown, and optional custom command. |
Private messages |
|
Social spy | Staff command to monitor private messages with bypass permissions. |
Filters | Regex, caps, and similarity filters with configurable per-violation actions. |
Auto moderation | Every stored message is scored by a remote classifier; hits notify staff and are recorded, with a sampled set of clean ones, as a labellable training set. |
Message archive | Public channel messages and private messages are persisted to |
Mentions |
|
Chat tags | YAML-defined prefix tags players can equip via menu actions. |
Nicknames |
|
Hide paid roles | Players can toggle their paid rank prefix on/off. |
AstralCore actions | Registers five action types — four globally, one plugin-scoped. |
Developer API | Public services, a cancellable |
Requirements
Dependency | Required | Notes |
|---|---|---|
Paper 1.21+ | Yes |
|
AstralCore | Yes | Menus, configuration, action framework, placeholders. |
AstralSync | Yes | Persists |
LuckPerms | Yes |
|
CraftEngine | Yes |
|
LiteBans | Optional |
|
RabbitMQ | Yes | Cross-server private messages, mentions, channel pause/broadcast. |
Redis | Yes | Caching for ignores and player data. |
MariaDB/PostgreSQL | Yes | Persistence for |
A moderation classifier | Optional | The endpoint |
Architecture at a glance
Service | Responsibility |
|---|---|
| Pause/resume/broadcast channel messages, schedule auto-resume. |
| Renders and broadcasts the actual chat component to viewers. |
| Routes |
| Reads/writes the |
| Runs each registered |
| Detects |
| Loads |
| Two jobs: the recent-message cache the similarity filter and the cooldowns read, and the HTTP call to the moderation classifier. |
| Applies the local thresholds, notifies staff, and records decisions into |
| Persists chat and private messages to |
| Caches |
The chat pipeline is driven by three Bukkit listeners:
ChannelListener— enforces pause state and per-channel cooldown.FiltersListener— runs filters when the channel hasfiltered: true.DefaultChannelChatListener— hands the message body toPaperChatService, which firesChannelChatEvent(filters run there), renders the final line, broadcasts it to the other servers, caches it for the similarity filter and stores it; the listener then trims the viewer list and fires mentions.
Filters only ever see the player's own words: the component handed to ChannelChatEvent is the unrendered message body, and the final line is rendered from whatever the filters left of it, so a prefix or a display name can never be censored.
Setting disable-all-chat-channels: true in config.yml skips all three listeners, registers no per-channel command, and drops incoming cross-server chat packets — useful on a server that must load the plugin for its API and its private messages without taking over chat.