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
@maplepy
Copy link

maplepy commented Aug 5, 2022

Very good tutorial, thanks !

@Nivirog
Copy link

Nivirog commented Oct 4, 2022

Can you help, how to add suffix support?

@arnokeesman
Copy link
Author

in case you want just suffixes, do this in you Styled Chat config: "displayName": "${default}%luckperms:suffix%", if you want both prefix and suffix set it to "displayName": "%luckperms:prefix%${default}%luckperms:suffix%",
in your luckperms config for the spacers do the same as with prefix (if you did it) but edit start-spacer (about 7 lines lower)
in case you dont know how to set the suffix in LuckPerms check their wiki

@Nivirog
Copy link

Nivirog commented Oct 4, 2022 via email

@arnokeesman
Copy link
Author

the prefix can't leak to the username, so the color stops where the prefix placeholder ends, if you want to color the name itself you will have to configure that in the styled chat config under permissionStyles

@NotFlow69
Copy link

how do i set the prefix in the player's nametag, i changed the prefix and it works in chat and the player list, but my name player namtag still doesnt have the prefix, how do i fix this?

@arnokeesman
Copy link
Author

@NotFlow69 OrderedPlayerList allows you to do this, it'll send fake groups to the client with the prefix from LuckPerms

@NotFlow69
Copy link

oh okay
thanks

@NotFlow69
Copy link

Excuse me, but im new to github, so could you just link a direct download? sorry 😅

@arnokeesman
Copy link
Author

arnokeesman commented Mar 31, 2023

edit: OPL now has releases, downloads can be grabbed from there.

@karacries
Copy link

hi! thank you for the well written tutorial! for some reason when i adjust everything the prefixes aren't added in chat or the playerlist and i've done everything. i'm not sure if i'm doing something wrong

@Superxp666
Copy link

Doesn't seem to support Minecraft 1.18.2?

@arnokeesman
Copy link
Author

arnokeesman commented May 9, 2023 via email

@StevenG5
Copy link

Does not work on 1.19.2 either. Followed instructions to the letter, no luck.

@arnokeesman
Copy link
Author

@StevenG5 The guide has not yet been updated since 1.19, what exact problems are you running into?

@StevenG5
Copy link

Here are some screenshots @arnokeesman

What it looks like in chat: https://gyazo.com/233989bb01e8a0d2f1611b01e4a69534
What I typed in the config file: https://gyazo.com/c53dafe003c80c66e87174f87ef1d494

I think it's close, but something must've bugged out; I copied it verbatim.

@arnokeesman
Copy link
Author

The prefix literally showing usually means you don't have LuckPerms-Fabric-PlaceholderAPI-Hook installed.
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.

@StevenG5
Copy link

That did the trick! Moving it to the chat line seemed to override whatever was causing this error to begin with. Thank you for your help!

@arnokeesman
Copy link
Author

A side effect of moving it to the chat line is that it won't automatically transfer over to the playerlist, you'll have to add the prefix there as well.

@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