Skip to main content

Supported software

Prefixes works with or without SimpleCloud. Only cross-server sync needs a SimpleCloud network.

Install the plugin

1

Install the plugin

Download Prefixes from GitHub or Modrinth and place it in the server template’s plugins/ folder.Install LuckPerms as well if you plan to use general.source: luckperms.
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.
Prefixes updates players automatically when their LuckPerms groups or group data change.

Placeholders

The following placeholders are available:
Use <color> instead of writing the same hex code into every value. It is applied as a style, so everything after it inherits the group color.

Feature switches

Use features to enable or disable each local part of the plugin:
  • chat formats local chat messages with the group’s chat-format
  • tablist shows the prefix, the player name in the group color, and the suffix in the tab list, sorted by priority
  • display-name shows the group’s display-name above 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 is disabled by default. Set 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:
  • CURRENT receives updates from the current server group, or only this persistent server when running as a persistent server
  • ALL receives 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
You can combine multiple group names and persistent server IDs. To exchange updates in both directions, configure each participating server to receive from the other server’s group or ID.
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

On every platform, you can also use PrefixesApiProvider.get(), which throws an IllegalStateException if Prefixes is not running.

Look up a player

The examples use the api instance from above and a Paper or Minestom Player. Get the group a player belongs to. The result is null if no group matches:
Get what is currently shown for a player. The result includes every change made through the API:

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:
Changes only work for online players and are removed when the player leaves the server. Set them again on join if they should stay.

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
Every 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:
Show party members with a [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:
The groups 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:
To check what one player sees, pass them as the viewer: 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:
Add a group with 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.
Players get an added group like any other group, for example through its permission with config. A group implements PrefixesGroup:

Create a group provider

A group provider decides which groups exist and which group a player belongs to. Prefixes includes the config 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:
Register the provider and set general.source in config.yml to its name:
config.yml
Prefixes does not know when your plugin changes a player’s group. Call refreshPlayer afterwards so the new group is shown. Changes made through the API stay in place.
See the built-in providers on GitHub for complete implementations, including the LuckPerms provider.

Best practices

  • Keep priorities unique so the tab list order stays predictable
  • Give every group the same chat-format unless a rank should visibly stand out in chat
  • Use <color> in display-name and chat-format instead of repeating hex codes
  • Point default-group at a group with an empty permission so every player matches something
  • Use the viewers argument for friends, parties, and teams instead of creating a group for each