Skip to content
OwlBe edited this page May 8, 2026 · 3 revisions

The Basics

For most operations that use users in Skript-LuckPerms, we need a user. We get this via the load player effect:

function example(p: offlineplayer):
    get luckperms user {_p} and store it in {_lp}

(The effect supports online & offline players). This will load the user into {_lp} which allows for modification of the user later on.

Modifying Prefixes/Suffixes of a User

Getting/setting a prefix/suffix of a user is quite simple (ish).

For Setting:

First we need a builder. We do this via

set {_m} to a new prefix builder:
    value: "<red>VIP"
    priority: 5
    duration: 7 days

This sets {_m} to a prefix builder with value "VIP" priority 5 and expires in 7 days. To apply it to a player, we simply:

add {_m} to prefixes of {_lp}

Now the user's prefix will be "VIP" for 7 days unless they have a prefix that has higher priority. So simple!

For Getting:

Getting is much easier, all we need to do is:

set {_prefix} to formatted luckperms prefix of {_lp}
set {_prefixes::*} to luckperms prefixes of {_lp}

{_prefix} = the user's primary prefix (one with highest priority). {_prefixes::*} = all of the user's prefixes. If you want to get source/priority of either of these use the chat meta source/chat meta priority expression.

To get/set suffixes of a user just follow this guide but replace prefix with suffix

User Events

Now, I won't explain every user event as there is a lot but here is a few:

User Receive Permission

Basic event called when a user gets a permission.

on user receive permission:
    send "You just got the permission %event-permission% for %event-duration%" to player

(Note that for events that have %event-duration% duration will be 0 seconds if the group is set to be FOREVER (never expire)).

User Lose Permission

Basically same as above but called when a user loses a permission.

on user lose permission:
    send "You just lost %event-permission%!" to player

User Receive Group

Called when a user gets a group.

on user receive group:
    send "You just received %event-group% for %event-duration%!" to player

User Lose Group

Explains itself at this point.

on user lose group:
    send "You just lost %event-group% ;c" to player

And yeah, that sums up some basic events. You may have some questions like: Why are events player based and not user based? This is to prevent needless loading. Although async its still performance wasted to load a possibly un cached player & you'd have to deal with converting a user to a player for certain things like eg sending a message.

Clone this wiki locally