Skip to content
StudioCubed

Prison Chat Core

PrisonChat runs your server's chat. It formats every line by rank, with tags and colours players unlock, and lets players show off items, mention each other and send private messages. Filters catch spam, adverts and swearing, and staff get mute, clear and slow mode tools. Players change their own settings in one menu, /chat.

The short version

Upload the PrisonChat jar to your plugins folder next to PinnaPrison and restart the server. Then join as an operator and run:

text
/prisonchat status
/chat
/prisonchat test join play.example.net
/prisonchat games start math
  1. /prisonchat status shows what PrisonChat hooked into (LuckPerms or permission groups, PlaceholderAPI, DiscordSRV), the storage type, and how many formats, tags, colours, filters and games loaded.
  2. /chat opens the menu players use to pick a tag and colours, and to set mention alerts, private messages and ignored players.
  3. /prisonchat test <message> runs a message through every filter the way a normal player would see it. This one should come back blocked by advert.
  4. /prisonchat games start math starts a chat game straight away. Type the answer in chat to win the reward.

Send a normal chat message to see the format. As an operator you own every tag and colour, but your players own none until you give them permissions. See Tags and colours are unlocked by permission.

What you need

Requirement Details
Paper 26.1.1 The server software the set-up is built for, running on Java 25.
PinnaPrison 1.2.25 Required. PrisonChat disables itself without it. EdLib ships inside the PinnaPrison jar, so don't install it separately.
LuckPerms (optional) Chat formats follow LuckPerms groups (inherited groups count) and {prefix} / {suffix} come from LuckPerms. Without it, a player is in format group x when they have prisonchat.group.x, and prefixes are empty.
PlaceholderAPI (optional, recommended) Fills in %placeholders% in formats, hovers and messages, including the rank and rebirth numbers in the default chat line. It also adds PrisonChat's own %tags_...% and %prisonchat_...% placeholders.
DiscordSRV (optional) Relays public chat to Discord without extra setup. Staff chat can go to a Discord channel too.
Internet on first start Paper downloads the database drivers (HikariCP, SQLite and MySQL) the first time PrisonChat loads. After that it works offline.
Permissions Run the admin commands as an operator. Operators hold every PrisonChat permission except prisonchat.silentjoin, including every filter bypass.

How a chat line is built

Each chat line comes from a format in formats.yml. PrisonChat uses the format with the highest priority whose groups include one of the player's groups. groups: ['*'] matches everyone, and an optional permission: must also be held.

yaml
formats:
  default:
    priority: 0
    groups: ['*']
    format: '&8[{rebirth}&8✦ {rank}&8] {prefix} {name}&8 {tag} » {message}'
    name: '&7{player}'
    name-click: 'suggest_command:/msg {player} '
    message-color: '&7'

To give a rank its own look, copy the default block, rename it (for example vip), raise its priority and list that rank's LuckPerms groups in groups. The comment block at the top of the file lists every token, such as {tag}, {prefix}, {rank}, {rebirth}, {name} and {message}. You can also use any PlaceholderAPI placeholder. name-hover sets the lines shown when someone hovers over a name, and name-click sets what clicking it does. {rank} and {rebirth} come from the text: placeholder at the top of rankcolors.yml and rebirthcolors.yml. Run /prisonchat debug <player> to see which groups, format, tag and colours a player ends up with.

Every chat-facing string in PrisonChat's files accepts & colour codes, &#RRGGBB hex and MiniMessage tags such as <gradient>, <hover> and <click>. What players type is never read as MiniMessage. They can only use the & codes their prisonchat.color permissions allow.

Tags and colours are unlocked by permission

Players start with no tags and no colours. Each tag in tags.yml needs prisonchat.tag.<id>, and each colour needs a node for its part. Give them out with your permissions plugin, for example:

text
/lp group default permission set prisonchat.tag.prisoner true
/lp group default permission set prisonchat.namecolor.gray true

Players can colour five parts of their chat line. Each part has its own palette file, command, menu and permission nodes:

Part File Command Colour permission
Message text chatcolors.yml /chatcolor prisonchat.chatcolor.<id>
Name namecolors.yml /namecolor prisonchat.namecolor.<id>
LuckPerms prefix prefixcolors.yml /prefixcolor prisonchat.prefixcolor.<id>
Rank number rankcolors.yml /rankcolor prisonchat.rankcolor.<id>
Rebirth number rebirthcolors.yml /rebirthcolor prisonchat.rebirthcolor.<id>

.* in place of <id> unlocks every colour in that file, and prisonchat.tag.* unlocks every tag. A tag or colour with its own permission: line uses that node instead.

At the top of each palette file, enabled: false turns that part off, and default-color sets the colour used when a player hasn't picked one. Bold and italic are part of a colour, so "White Bold" is its own entry with decorations: ['bold'] and its own permission. The ids custom, use and gradient are reserved. Players with prisonchat.<part>color.custom can type their own hex colours, and prisonchat.<part>color.gradient lets them use several (up to chat-color.custom-max-colors in config.yml, 4 by default) as a gradient, stepped or rainbow style.

Filters and staff tools

Filters run in the order set in filters.yml. The first filter that blocks a message stops it, and filters that change a message (lower-casing caps, censoring a word) pass the changed text on. Each filter has a bypass permission, prisonchat.bypass.<id>. When notify-staff is on, staff with prisonchat.staff.filtered get an alert they can hover over to see the original message.

yaml
order: ['slowmode', 'cooldown', 'flood', 'similarity', 'caps', 'advert', 'rules']

advert:
  enabled: true
  action: block
  whitelist:
    - 'yourserver.net'
    - 'discord.gg/yourserver'
    - 'youtube.com'

Blocked words live under rules.list. Each rule has one or more regex lines and an action (replace, block or notify), and can run commands as the console. /prisonchat regex <word> --add swearing builds a pattern that catches common spellings like f.u.c.k and adds it to the swearing rule. Private messages go through the filters listed in private-messages.filters in config.yml.

/staffchat switches a staff member's chat to staff only. Anyone with prisonchat.staffchat can also start a message with # to send just that line to staff. Change or blank the staff-chat.shortcut in config.yml if that gets in the way. To send staff chat to Discord, set staff-chat.discordsrv-channel to a DiscordSRV channel name. /mutechat and /slowmode only last until the next restart. moderation.default-slowmode in config.yml sets the slow mode the server starts with.

Chat games and extras

Every 600 seconds, if at least 2 players are online, games.yml starts a random chat game: typist, unscramble, math or trivia. The first player to type the answer wins and the game's rewards run. A reward line starting [console], [player], [message] or [broadcast] runs a command or sends text. Any other line is a PinnaPrison action, such as the bundled give-eco tokens 25k. Use {player} in a line for the winner's name.

The rest works out of the box, but a few parts are worth a look before you open:

  • Announcements. announcements.yml broadcasts one message every 300 seconds. The bundled ones link to https://discord.gg/yourserver and run /buy and /vote, so change them to match your server.
  • Emojis and links. emojis.yml swaps typed text such as :heart: or [discord]. [discord] and [store] point at placeholder addresses. [bal], [tokens], [rank] and [gang] need prisonchat.placeholder.balance, .tokens, .rank and .gang.
  • Showcase and mentions. Players type [item], [inv] or [enderchest] to show them in chat, and @name to mention someone. Shown inventories stay clickable for showcase.snapshot-seconds (300). Mention alerts are set under mentions in config.yml, and each player can switch alerts off in /chat.
  • Join and quit messages. join-quit in config.yml sets one pair per group and a first-join welcome. prisonchat.silentjoin hides them for a player.
  • Mine finds. mine-finds in config.yml sends a player a message when they mine a listed block by hand (a beacon or gilded blackstone by default). Players switch it off in /chat.

Commands

Player commands:

Command Permission What it does
/chat [tags|colors|namecolors|prefixcolors|rankcolors|rebirthcolors|mentions|messages|ignored] prisonchat.use Opens the chat settings menu, or one of its pages. Alias /chatsettings.
/tags [tag|off|list] prisonchat.use Opens the tag menu, equips a tag, removes yours (off) or lists the tags you own. Aliases /tag, /titles.
/chatcolor [colour|reset|list|custom|mode|hex <#hex...> [gradient|stepped|rainbow]] prisonchat.chatcolor.use Opens the message colour menu, or picks, resets or lists colours. Aliases /chatcolour, /colour, /color, /colors, /colours.
/namecolor, /prefixcolor, /rankcolor, /rebirthcolor prisonchat.<part>color.use The same for your name, prefix, rank number and rebirth number. Each also works with colour in place of color.
/msg <player> <message> prisonchat.use Sends a private message. Aliases /tell, /w, /whisper, /m, /pm, /message.
/reply <message> prisonchat.use Replies to your last private conversation. Alias /r.
/togglemsg prisonchat.use Turns receiving private messages on or off. Aliases /msgtoggle, /togglepm, /tpm.
/ignore <player|list> prisonchat.use Ignores or un-ignores a player, or lists who you ignore. With no argument it opens the ignored players menu. Aliases /unignore, /block.
/ignoreall prisonchat.ignoreall Turns hiding everyone's chat and private messages on or off.
/chatinv <id> None Opens an inventory someone showed with [inv] or [enderchest]. Players run it by clicking the item in chat.

In the colour commands, custom asks you to type hex colours in chat, hex sets them directly, and mode cycles gradient, stepped and rainbow. custom and hex need prisonchat.<part>color.custom. mode, and using more than one colour, need prisonchat.<part>color.gradient.

Staff and admin commands:

Command Permission What it does
/staffchat [message] prisonchat.staffchat Switches your chat to staff chat, or sends one message there. Aliases /sc, /schat.
/spymsg prisonchat.spy Shows you other players' private messages. Aliases /socialspy, /spy.
/mutechat [-s] prisonchat.mutechat Mutes or unmutes chat for everyone. Aliases /mc, /lockchat.
/clearchat [-s] prisonchat.clearchat Clears everyone's chat. Aliases /cc, /chatclear.
/slowmode <seconds|off> [-s] prisonchat.slowmode Sets slow mode (up to 3600 seconds) or turns it off. With no argument it shows the current setting. Aliases /chatslow, /slowchat.
/prisonchat reload prisonchat.admin Reloads PrisonChat's files (not the menus). Aliases for /prisonchat are /pchat and /pc.
/prisonchat status prisonchat.admin Shows hooks, storage, loaded formats, tags, colours, filters and games, and whether chat is muted.
/prisonchat debug [player] prisonchat.admin Shows a player's groups, format, tag, colours and chat settings.
/prisonchat test <message> prisonchat.admin Runs a message through the filters, ignoring your bypass permissions. In game only.
/prisonchat regex <word> [--whole] [--add <rule>] prisonchat.admin Builds a filter pattern for a word. --whole stops it matching inside longer words, and --add saves it to that rule in filters.yml and reloads.
/prisonchat similar <first> | <second> prisonchat.admin Shows how similar two messages are, to help tune the similarity filter.
/prisonchat games [start [type]|stop|list] prisonchat.admin Starts a chat game (random or typist, unscramble, math, trivia), stops it, or lists enabled games.
/prisonchat announce <id> prisonchat.admin Sends an announcement from announcements.yml now.

A trailing -s on /mutechat, /clearchat or /slowmode skips the broadcast to players. On /prisonchat reload, regex, games or announce it skips your confirmation message.

Permissions

Permission Default What it gives
prisonchat.use Everyone /chat, /tags, /msg, /reply, /togglemsg, /ignore and the menus.
prisonchat.mention Everyone Mentioning players with @name.
prisonchat.mention.everyone Op Mentioning everyone with @everyone or @here.
prisonchat.showcase.item / .inv / .enderchest Everyone Showing your held item, inventory or ender chest in chat.
prisonchat.emoji Everyone The replacements in emojis.yml (entries with their own permission: also need that).
prisonchat.ignoreall Everyone /ignoreall.
prisonchat.<part>color.use Everyone That part's command and menu. <part> is chat, name, prefix, rank or rebirth.
prisonchat.<part>color.<id> / .* Op One colour from that part's file, or all of them.
prisonchat.<part>color.custom Op Typing your own hex colour for that part.
prisonchat.<part>color.gradient Op Several custom colours and the gradient, stepped and rainbow styles.
prisonchat.tag.<id> / prisonchat.tag.* Op One tag, or every tag.
prisonchat.color Op Every & code in chat. Split it with prisonchat.color.<0-9a-f>, .format (&l &o &n &m &k) and .hex (&#RRGGBB).
prisonchat.staff Op Staff chat, message spy, filter alerts, /mutechat, /clearchat and /slowmode.
prisonchat.staffchat, .spy, .staff.filtered, .mutechat, .clearchat, .slowmode Op Each part of prisonchat.staff on its own.
prisonchat.bypass Op Every prisonchat.bypass.<x> below.
prisonchat.bypass.<filter> Op Skips one filter: slowmode, cooldown, flood, similarity, caps, advert or rules.
prisonchat.bypass.mutechat / .clearchat Op Chatting while chat is muted / keeping your chat on /clearchat.
prisonchat.bypass.ignore Op Players can't ignore you, and your chat and private messages still reach players who ignore everyone.
prisonchat.bypass.msgtoggle Op Messaging players who turned private messages off.
prisonchat.silentjoin Nobody No join or quit message for this player.
prisonchat.group.<name> Op Only without LuckPerms: puts a player in that format group.
prisonchat.admin Op /prisonchat.
prisonchat.* Op Every node in this table except the per-tag and per-colour nodes, prisonchat.group.<name> and prisonchat.silentjoin.

Files

File Edit it to
plugins/prisonchat/config.yml Change storage (SQLite or MySQL), mentions, showcase, private message and staff chat formats, join and quit messages, mine finds and DiscordSRV settings.
plugins/prisonchat/formats.yml Change how the chat line looks for each group.
plugins/prisonchat/tags.yml Add, remove or reorder tags.
plugins/prisonchat/chatcolors.yml, namecolors.yml, prefixcolors.yml, rankcolors.yml, rebirthcolors.yml Change each part's colours, turn a part off or set its default colour.
plugins/prisonchat/filters.yml Tune or turn off filters and edit blocked words.
plugins/prisonchat/games.yml Change chat game timing, words, questions and rewards.
plugins/prisonchat/announcements.yml, emojis.yml Edit the automatic announcements, and the emojis, links and live values players can type.
plugins/prisonchat/messages.yml Reword any message. Set one to '' to turn it off.
plugins/prisonchat/chat.db Nothing. It's the SQLite database of player settings (not used with MySQL).
plugins/PinnaPrison/guis/prisonchat/ Edit the 12 menus, such as chat-main.yml (the /chat hub), chat-tags.yml and one colour menu per part.

Every file starts with a comment block explaining its keys. PrisonChat creates its files once and never overwrites them. /prisonchat reload applies changes to all of them, except the storage section, chat.listener-priority and placeholders.tags-expansion, which need a restart. If a file has a YAML error, the console says so, the reload reply names it, and PrisonChat runs on the built-in copy of that file until you fix it and reload.

The menus are PinnaPrison GUI files. PrisonChat installs them into plugins/PinnaPrison/guis/prisonchat/ on first start and never overwrites them, so delete a file and restart to get the default back. Menu changes reload with /pinna reload, not /prisonchat reload.

Placeholders

PlaceholderAPI placeholders need PlaceholderAPI. The PinnaPrison variables work wherever PinnaPrison fills in its own variables.

PlaceholderAPI PinnaPrison variable Shows
%tags_tag% %pinnaprison_variable_chat_tag% The equipped tag, in colour.
%tags_tag_raw% %pinnaprison_variable_chat_tag_raw% The tag without colours.
%tags_tag_id% %pinnaprison_variable_chat_tag_id% The tag's id.
%tags_tag_formatted% – The tag as it appears in chat, with its trailing space.
%prisonchat_chatcolor% %pinnaprison_variable_chat_color% The name of the selected message colour.
%prisonchat_name%, _prefix%, _rank%, _rebirth% %pinnaprison_variable_chat_name%, _prefix%, _rank%, _rebirth% That part in the player's chosen colour, for tab lists, scoreboards and nametags. Add _legacy to the PlaceholderAPI version for & codes.
%prisonchat_namecolor%, _prefixcolor%, _rankcolor%, _rebirthcolor% – The name of the colour picked for that part.
%prisonchat_mentions%, _pms% %pinnaprison_variable_chat_mentions%, _pms% Whether mention alerts and private messages are on (true / false).
%prisonchat_ignore_all%, _staffchat%, _spy%, _ignored% – Whether ignore-all, staff chat and spy are on, and how many players they ignore.
%prisonchat_games_won% %pinnaprison_variable_chat_games_won% Chat games won.
%prisonchat_chat_muted%, _slowmode%, _game_active% – Whether chat is muted, the slow mode in seconds, and whether a game is running.

If another plugin already uses the tags identifier, set placeholders.tags-expansion: false in config.yml and restart. %prisonchat_tag%, %prisonchat_tag_raw% and %prisonchat_tag_id% still work.

Troubleshooting

Filters, slow mode and mute chat don't affect you. Operators hold every bypass permission. Test with a non-op account, or run /prisonchat test <message>, which ignores your bypasses.

Players can't pick any tag or colour. They need prisonchat.tag.<id> and prisonchat.<part>color.<id> nodes. Nobody but operators has them by default. See Tags and colours are unlocked by permission.

The chat line shows %pinnaprison_...% text, or the rank and rebirth numbers are wrong. Install PlaceholderAPI and restart. The default format and the rank and rebirth numbers rely on it. /prisonchat status shows PlaceholderAPI: true once it's hooked.

/msg, /r, /tags or /ignore run another plugin's version. Another plugin, often Essentials, registered the same command. /prisonchat:msg always reaches PrisonChat. Remove the command from the other plugin, or point it at PrisonChat in the server's commands.yml:

yaml
aliases:
  msg:
  - prisonchat:msg $1-

Menu changes don't show up. Run /pinna reload. Menus belong to PinnaPrison, so /prisonchat reload doesn't touch them.

PrisonChat disables itself on start. Check the console. Could not open the chat database (mysql) means the details under storage.mysql in config.yml are wrong or the database can't be reached. Fix them and restart. If the error is about downloading libraries, the server couldn't reach the internet on first start. Allow outbound access once and restart.

Last updated

Type at least two letters to search the docs.