Skip to content

Chat and alerts

The chat module handles staff communication and public chat moderation. Options: config/chat.yml (reloadable with /cobaltstaff reload chat).

Each staff chat channel automatically creates its commands:

Command Effect Permission
/<command> <message> Write in the channel <permission>
/<command> Toggle: everything you type in chat goes to the channel <permission>
/<command> mute (alias muet) Stop receiving the channel <permission>.mute
/<command> son (alias sound) Turn the receive sound on or off <permission>.sound

Only the word alone counts: /sc mute this player is a message sent to the channel, not the subcommand.

Two channels are bundled:

staff-chat:
channels:
staff:
command: sc
aliases: [staffchat]
permission: cobaltstaff.staffchat.staff
prefix: "<gradient:#6FE2E8:#6180C9><b>ꜱᴛᴀꜰꜰ</b></gradient>"
format: "" # empty = language format
shortcut: "@" # "@message" in chat = message in this channel
sound: {name: block.note_block.hat, volume: 0.6, pitch: 1.6}
admin:
command: ac
aliases: [adminchat]
permission: cobaltstaff.staffchat.admin
shortcut: "#"

Add as many channels as needed (guides, managers…). The format accepts the <prefixe>, <joueur> and <message> variables.

/chat clear clear the chat
/chat toggle [on|off] lock or reopen the chat
/chat slow <seconds|off> [duration] slow mode, optionally time-limited
Action Permission Bypass
Clear cobaltstaff.chat.clear Staff keeps its history (chat.clear-keep-staff)
Lock cobaltstaff.chat.toggle cobaltstaff.chat.bypass-lock
Slow mode cobaltstaff.chat.slow cobaltstaff.chat.bypass-slow

The filter applies to chat, signs, anvils and books. It detects:

  • forbidden words, regardless of case, accents, “leet” digits, repeated or spaced letters;
  • forbidden words hidden inside another word (merging), with a list of allowed words for false positives;
  • forbidden characters, anywhere in the message;
  • links, including with a fake dot (site(dot)com, site [.] fr), except domains in allowed-links.

By default, the word is censored with *; block-message: true blocks the whole message. Staff with cobaltstaff.blacklist.see-uncensored see the original message on hover, and a blacklist-detection alert is sent to subscribers. cobaltstaff.blacklist.bypass disables the filter for a player.

Groups of phrases trigger a chat-phrase-detection alert and actions. A phrase is matched as whole words, ignoring case, accents and punctuation (“x-ray” also matches “xray”).

phrase-detection:
enabled: true
groups:
pub:
phrases: ["rejoignez mon serveur", "venez sur mon serveur", "mon discord"]
alert: true
block-message: true
actions:
- command: "warn %player% LEGER Advertising"
executor: console

Variables: %player%, %phrases%. Bypass: cobaltstaff.alerts.chat-phrase-detection.bypass.

List Applies to
blocked-commands Players with cobaltstaff.block (unless cobaltstaff.block.bypass): for example op, stop, reload for a staff member with limited trust
blocked-mode-commands Any staff member in staff mode: give, kit, pay, sell, enchant… so nothing is gained through staff mode
/alerts view your subscriptions alias /alertes
/alerts <type> [on|off] subscribe or unsubscribe

A staff member receives an alert if they have the cobaltstaff.alerts.<type> permission and are subscribed to it (subscribed by default). Clicking an alert about a player runs alerts.click-command (/tp %player% by default).

Type Trigger
namechange A player joins with a new name
mention A staff member is mentioned in chat (with or without @, option mention.require-at)
xray Suspicious mining of rare ores
alt-detects Likely alt account
chat-phrase-detection Watched phrase
command-detection Watched command
blacklist-detection Message filtered by the blacklist
grimac Alert relayed from the GrimAC anticheat

Each type can be enabled, copied to the console and given its own sound (config.yml > alerts.sounds.<type>).

Each watched block follows a simple format:

Format Alert
BLOCK On every block broken
BLOCK:N On the N-th block
BLOCK:N:duration N blocks within the given duration
xray:
ignore-creative: true
blocks:
- SPAWNER
- ANCIENT_DEBRIS:4:5m
- DIAMOND_ORE:8:5m
- EMERALD_ORE:5
nexo-blocks: # custom Nexo ores, same format
- ruby_ore:6:5m

Bypass: cobaltstaff.alerts.xray-bypass.

If GrimAC is installed, its alerts are relayed in /alerts (type grimac), with a violation threshold, per-player and per-check anti-spam (cooldown) and a list of ignored checks.

A custom message can be broadcast on join depending on the player’s permission; the highest weight wins. No message is sent for a vanished player.

join-messages:
enabled: true
messages:
staff:
permission: cobaltstaff.join-message.staff
weight: 10
message: "<gray><white><joueur><gray> just joined."
/broadcast <message> alias /diffuser

Sends an announcement to the whole server (permission cobaltstaff.broadcast).