Prefixes Plugin
The Prefixes Plugin provides comprehensive rank management for chat and tab list displays. It integrates with LuckPerms by default but can be extended with custom implementations. The plugin uses Adventure Components and MiniMessage for rich text formatting.
DownloadThe plugin is currently taking a little break, and the documentation needs a refresh. Don't miss any updates on our Community Discord.
Supported Servers
The following table shows all currently supported server implementations:
Server type | API Support | LuckPerms | This Plugin |
---|---|---|---|
Paper & Forks | Yes | Yes | Yes |
Spigot & Forks | Yes | Yes | Yes |
Minestom* | Yes | No | No |
*Minestom support requires custom implementation using the provided API.
Quick Setup
- Download the plugin for your server software
- Place it in your server's plugins folder
- Start your server
- Configure using LuckPerms and
config.json
Configuration
LuckPerms Integration
The plugin automatically syncs with LuckPerms groups, converting them to prefix groups with their respective prefixes, suffixes, and team colors.
Group Management
# Set group prefix
/lp group admin meta addprefix 100 "<red>[Admin] "
# Set group suffix
/lp group admin meta addsuffix 100 " <gray>✦"
# Set team color (Spigot: use ChatColor, others: use hex)
/lp group admin meta set color #FF0000
Chat Configuration
The chat format is configured in config.json
:
{
"chatFormat": "<prefix><name_colored><suffix><gray>:</gray> <white><message></white>"
}
Available placeholders:
Placeholder | Description |
---|---|
name | Player's name |
name_colored | Name with team color |
prefix | Player's prefix |
suffix | Player's suffix |
message | Chat message |
API Usage
Accessing the API
val prefixesApiProvider = Bukkit.getServicesManager()
.getRegistration(PrefixesApi::class.java)
val api: PrefixesApi = prefixesApiProvider.provider
// Use API
api.setPrefix(player.uniqueId, Component.text("[VIP] "))
Core API Methods
// Player Management
fun setWholeName(uniqueId: UUID, group: PrefixesGroup)
fun setPrefix(uniqueId: UUID, prefix: Component)
fun setSuffix(uniqueId: UUID, suffix: Component)
fun setColor(uniqueId: UUID, color: String)
// Group Management
fun getGroups(): List<PrefixesGroup>
fun getHighestGroup(uniqueId: UUID): PrefixesGroup
fun addGroup(group: PrefixesGroup)
Custom Implementation
Creating a Custom Group
class CustomGroup : PrefixesGroup {
override fun getName(): String = "vip"
override fun getPrefix(): Component = Component.text("[VIP] ")
override fun getSuffix(): Component = Component.text(" ⭐")
override fun getColor(): String = "#FFD700"
override fun getPriority(): Int = 100
override fun containsPlayer(uniqueId: UUID): Boolean {
// Custom logic
return true
}
}
Custom Actor Implementation
class CustomActor : PrefixesActor {
override fun applyGroup(target: UUID, group: PrefixesGroup) {
// Apply group formatting
}
override fun setPrefix(target: UUID, prefix: Component) {
// Set player prefix
}
override fun formatMessage(target: UUID, format: String, message: Component): Component {
// Format chat message
return Component.text()
.append(prefix)
.append(message)
.build()
}
}
For complete implementation examples, check our GitHub repository.
Best Practices
- Group Management
- Use consistent prefix/suffix styles
- Set appropriate group priorities
- Document group hierarchies
- Performance
- Cache group data when possible
- Use async operations for database queries
- Minimize chat format complexity