Channels
Give your server global, nearby and permission-only chat channels, and let players switch with /channel or a prefix.
A channel is where a message goes. Out of the box there is one: global, where everybody reads everybody. You can add a channel for nearby chat or one only some players can read.
Before you start#
The built-in chat must be on (modules.chat: true, see The chat module). Channels live in plugins/ExyliaChatCosmetics/lang/<language>/chat/channels.yml, for example lang/en/chat/channels.yml.
Add a staff channel#
Open the file
Edit lang/en/chat/channels.yml (your language folder).
Add the channel
Under channels: add:
staff:
type: CUSTOM
name: '{warning}Staff'
permission: exyliachatcosmetics.chat.channel.staff
prefix: '@'Give the permission
Give exyliachatcosmetics.chat.channel.staff to your staff group in your permissions plugin, see Permissions.
Reload
Run /cca chat reload.
The node name is yours to choose: a channel's permission is any node you write. A channel behind a permission is written and read only by its holders.
Check that it works#
As a staff member, type @hello: the message goes to the staff channel only, once, and the @ is removed. Run /channel staff (or /ch staff) to move all your messages there, and /channel global to go back. A player without the permission who types @hello simply sends it to global with the @ left in.
Turn on nearby chat#
Two channels ship: global with prefix !, and local, which is off. In channels.yml, delete enabled: false from local (or set it to true) and run /cca chat reload. Players in the same world within radius blocks (100 by default) read it, plus the sender. Type .hello to speak there once, or /channel local to stay in it. A player who never picked a channel talks in global.
A message has to go somewhere. If global is missing, a built-in global channel is used and the problem is logged.
Chat between several servers#
Set cross-server: enabled: true in chat/config.yml and configure Redis in ExyliaLib's database.yml, see Database. A channel with cross-server: true then sends its messages to your other servers; the other side only decides who reads them. local never crosses servers. Without Redis nothing is sent. Whispers, the chat mute, /clearchat and /broadcast travel the same way, see Chat features.
Give a channel its own look#
Add format: vip to a channel to always draw its messages with formats/vip.yml, see Formats.
Channel keys
| Key | Default | Meaning |
|---|---|---|
type | CUSTOM | GLOBAL (everybody), LOCAL (same world within radius, plus the sender) or CUSTOM (holders of permission) |
name | the id | What messages and menus call it; colours work. See Colours |
permission | empty | Needed to talk and to read. Empty means everybody |
prefix | none | One character typed before a message to send that one message here. Longer prefixes are cut to the first character, with a warning |
radius | 100 | Blocks, LOCAL only |
format | empty | A file from formats/ this channel always uses |
cross-server | true (false for LOCAL) | Whether messages travel to other servers |
enabled | true | false keeps the channel out |
Ids are lowercase a-z 0-9 _ -. A line is sent to: the channel named by a usable prefix, else the one the player switched to, else global. If the player's channel was deleted or they lost its permission, they fall back to global. Only a non-global channel is stored per player. type: STAFF from an older version is read as CUSTOM. A cancelled ChannelSwitchEvent keeps the player where they were.
Across servers the already rendered line travels, with the channel id and the sender. The other server does not re-run the filter or the cosmetics.
Something missing on this page? Tell us on Discord