Supported software
Prefixes works with or without SimpleCloud. Only cross-server sync needs a SimpleCloud network.
Install the plugin
- Paper
- Minestom
1
2
Generate the configuration
Start a matching server. Prefixes creates
config.yml and messages.yml under plugins/simplecloud-prefixes/.3
Keep the configuration in the template
For a group server, copy
plugins/simplecloud-prefixes/ from the running server to the same path in its template before the server stops. Then edit the template copy.See Templates for the complete workflow.4
Apply and verify the configuration
Run
/scprefix reload after editing files on a running server. If you edited the template, start a new server instead.Join the server and confirm that your group prefix appears in chat, the tab list, and above your head for each enabled feature.
Configuration
Every player belongs to a group whose settings define these displays. Prefixes reads groups from its own configuration, from LuckPerms, or from a custom group provider.config.yml
The main configuration file controls the group source, group definitions, individual features, and cross-server synchronization.Group sources
general.source selects where groups come from.
LuckPerms mapping
When
source is luckperms, every value is read from the LuckPerms group. Prefixes picks the player’s group with the highest weight among their primary and inherited groups.
Placeholders
The following placeholders are available:Feature switches
Usefeatures to enable or disable each local part of the plugin:
chatformats local chat messages with the group’schat-formattablistshows the prefix, the player name in the group color, and the suffix in the tab list, sorted by prioritydisplay-nameshows the group’sdisplay-nameabove the player’s head; when disabled, the normal Minecraft name tag is shown
Cross-server sync
Sync can share two things over the SimpleCloud network:- Chat: formatted chat messages from players on other servers
- Tab list: tab list entries for players on other servers
sync.enabled to true to turn it on. Under channels, choose whether chat, tab list entries or both are synchronized. A channel only works when its matching option under features is also enabled.
The sources list controls which servers this server receives updates from:
CURRENTreceives updates from the current server group, or only this persistent server when running as a persistent serverALLreceives updates from every server in the network and must be the only list entry- A server group name or persistent server ID receives updates from that specific source
Enabling sync or changing
sync.sources only takes effect after a server restart.Commands
API
Use the API to read and change how players are shown, and to add your own groups.Add the dependency
Access the API
- Paper
- Minestom
PrefixesApiProvider.get(), which throws an IllegalStateException if Prefixes is not running.
Look up a player
The examples use theapi instance from above and a Paper or Minestom Player.
Get the group a player belongs to. The result is null if no group matches:
Change how a player is shown
Change a player’s prefix, suffix, color, or tab list position for everyone. The changes apply to chat, the tab list, and the name tag.setGroup takes a PrefixesGroup or a group name. With a name, it completes with false if no group with that name exists:
Show a player differently to certain players
Per-viewer changes let different players see the same player differently. Use them for anything that depends on the relationship between two players:- Friends: a player sees their friends with a
[Friend]prefix - Parties: party members see each other with a party prefix at the top of the tab list
- Teams: in a minigame, each team sees its own members in green and enemies in red
set method and setGroup takes an optional viewers argument. Only those players see the change; everyone else keeps seeing the normal prefix. viewers is an Adventure Audience, so you can pass one player or several with Audience.audience(players).
Show a friend with a [Friend] prefix, only to the player:
[Party] prefix at the top of the tab list, only to the party:
setGroup also accepts several targets at once. In a minigame, each team sees its own members with one group and the other team with another:
teammate and enemy must exist in your group source.
Use reset(targets, viewers) to remove only the changes that certain players see, for example when a friendship ends or a player leaves a party:
api.getPrefixData(friend.uniqueId, player).
If several changes apply, the change for a specific viewer wins over the change for everyone, which wins over the player’s group. Per-viewer changes are removed when either player leaves the server.
List and add groups
List all groups of the current group source, highest priority first:addGroup. With config, the group is saved to config.yml. With luckperms, it is created in LuckPerms. The future completes with false if a group with the same name already exists.
permission with config. A group implements PrefixesGroup:
Example: VipGroup
Example: VipGroup
Create a group provider
A group provider decides which groups exist and which group a player belongs to. Prefixes includes theconfig and luckperms providers. Create your own provider to take groups from your plugin, for example from your own role system.
Implement GroupProvider. This example keeps its groups and the team of each player in memory:
general.source in config.yml to its name:
config.yml
refreshPlayer afterwards so the new group is shown. Changes made through the API stay in place.
Best practices
- Keep priorities unique so the tab list order stays predictable
- Give every group the same
chat-formatunless a rank should visibly stand out in chat - Use
<color>indisplay-nameandchat-formatinstead of repeating hex codes - Point
default-groupat a group with an emptypermissionso every player matches something - Use the
viewersargument for friends, parties, and teams instead of creating a group for each