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.

Download

Supported Servers

The following table shows all currently supported server implementations:

Server typeAPI SupportLuckPermsThis Plugin
Paper & ForksYesYesYes
Spigot & ForksYesYesYes
Minestom*YesNoNo

Quick Setup

  1. Download the plugin for your server software
  2. Place it in your server's plugins folder
  3. Start your server
  4. 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:

PlaceholderDescription
namePlayer's name
name_coloredName with team color
prefixPlayer's prefix
suffixPlayer's suffix
messageChat 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()
    }
}

Best Practices

  1. Group Management
  • Use consistent prefix/suffix styles
  • Set appropriate group priorities
  • Document group hierarchies
  1. Performance
  • Cache group data when possible
  • Use async operations for database queries
  • Minimize chat format complexity

What's Next?

Was this page helpful?