Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save arnokeesman/84411929a02f00b847d1b2cca30ebe18 to your computer and use it in GitHub Desktop.
Save arnokeesman/84411929a02f00b847d1b2cca30ebe18 to your computer and use it in GitHub Desktop.
How to use LuckPerms prefixes on a fabricmc server

A guide on setting up LuckPerms prefixes on a Minecraft Fabric server

This tutorial assumes you have a fabricmc server with fabric-api installed.
Coming over from bukkit, spigot or paper? Make sure to replace all legacy formatting (those done with &) with tags from Simplified Text Format!

Installing the mods

Download Styled Chat, Styled Player List Then get LuckPerms https://luckperms.net/download Download LuckPerms for Fabric

And get Fabric PlaceHolderAPI from the bottom of that same page Download Fabric PlaceHolderAPI

Now put all these files in your mods folder and restart the server.

Configuring the mods

Styled Chat

In your Styled Chat config (/config/styled-chat.json) add the Placeholder for the prefix(%luckperms:prefix%): On line 17 (as of writing this) change "displayName": "${default}", to "displayName": "%luckperms:prefix%${default}", as shown below Adding prefix placeholder Reload Styled Chat by running /styledchat reload

Styled Player List

In your Styled Player List config (/config/styledplayerlist/config.json) change some values to update the names. Set changePlayerName to true and playerNameUpdateRate to 20 as shown below Styled Player List config Reload Styled Chat by running /styledplayerlist reload

Setting up LuckPerms and prefixes

  1. in the console create a group to manage luckperms lp creategroup luckperms
  2. give the group luckperms rights (I will give it all) lp g luckperms permission set luckperms.*
  3. add yourself to the group lp u yourUsername parent add luckperms (this can only work if you have joined before, after doing this you can continue in-game)
  4. create a group with /lp creategroup <name> example: /lp creategroup owner
  5. give the group a prefix /lp g owner meta setprefix "<blue>Owner"
  6. give yourself the group /lp u yourUsername parent add owner

Note: for styling of prefixes use Simplified Text Format, formatting with & will not work.

Result

in-game screenshot

Putting something between the prefix and the username

As you might have noticed in the results, there is nothing between the prefix and the username. You can fix this in your LuckPerms config. Open the LuckPerms config (/config/luckperms/luckperms.conf) and search(ctrl+f) for meta-formatting, in the prefix section of this set end-spacer to " " to add a space between the prefix and your username. LuckPerms config Restart your server for this change to take effect.

Result

in-game screenshot

Common problems

  • Problem: The prefixes shows up but colors don't work
    Solution: Replace all legacy formatting (done with &) with tags from Simplified Text Format
  • Problem: Prefixes do not work/show up
    Possible solution: If you are using a FTB library build between 188 and 204, downgrade to 188 or upgrade to anything newer than or 204
@YTpooshistic
Copy link

What should I change if the styledplayerlist config is version 2?

@arnokeesman
Copy link
Author

means you're probably still on 1.18, check the first version of this guide
also means you're gonna need an old version of the placeholder hook which doesn't have an official download anymore, you should be able to grab it here though

@YTpooshistic
Copy link

@arnokeesman I use 1.20.1

@arnokeesman
Copy link
Author

ah wait, yes, got some things mixed up, principles of all the relevant options are the same, they just moved around a bit and got renamed
changePlayerName -> player.modify_name
playerNameUpdateRate -> player.update_tick_time

@infinity-atom
Copy link

If you do have it installed, try moving the prefix from the display_name to the chat line (2 lines below). Some other mod might be caching the username and messing with things.

I tried this but still did not work. It just says <%luckperms:prefix%player> Hi in chat.
This is my code:

...
"displayName": "${default}",
"chat": "<%luckperms:prefix%${player}> ${message}",
...

@arnokeesman
Copy link
Author

arnokeesman commented Oct 13, 2023

Yeah your config looks good, it's probably some combination of mods not wanting to work together
Send your modlist in the styled-chat channel on Patbox' Discord (link can be found on the mod pages of the styled- mods) so we can look further into it tomorrow (maybe someone else knows whats up before I can take a look as well)

Edit: Solved! LP placeholder hook was missing

@GeekCornerGH
Copy link

Does anybody have such mods for forge?

@shvecia
Copy link

shvecia commented Jun 20, 2024

on 1.21 fabric luckperms and fabric placeholder crashes the server

@arnokeesman
Copy link
Author

saw a report on this in the discord a couple days back as well
guess the fabric placeholder hook needs an update to 1.21
appears Polymeta has already updated it, just needs to get merged and released LuckPerms placeholders #58

@shvecia
Copy link

shvecia commented Jun 20, 2024

thx for the answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment