#luckperms-api

1 messages ยท Page 7 of 1

main dagger
#

then theres not really anything you can do

chilly swallow
#

hi, how i register a custom event in my plugin that uses luckperms api? i use currently NodeAddEvent

#

it is for bungee

#

( it is a bungeee plugin )

fast delta
#

bungee does not have a services manager

#

you need to use the static accessor LuckPermProvider

chilly swallow
#

the event dont get fired

fast delta
#

though, events like NodeAddEvent will only fire on the LP that change occurred in

#

so, if you want to listen to that event on the proxy, you will have to run /lpb ... permission set

chilly swallow
#

And since everything is mysql connected even If i do /lp user instead of /lpb user The event stills trigger and Bans The offender

fast delta
#

events do not fire across the network

chilly swallow
#

I have tested with /lp and i think it banned them

#

I think it IS because It IS mysql synced?

#

So ALL instances are connected?

fast delta
#

no, events do not propagate, most events will be called only on the source server the changed happened on

chilly swallow
#

I have It on spigot side too. My plugin IS both for spigot and bungeecord. So i think that IS why It banned

fast delta
#

some "exceptions" are things like, UserDataRecalculateEvent, but that is only because the user data is recalculated everywhere when a change is made

chilly swallow
#

So If they somehow got * and dont have The primary group seted was owner

#

IS a ban

#

In spigot side i forked The antiop plugin from spigot and made somes changes. The owner primary group thing IS only in bungeecord

fast delta
#

well, if you install the plugin everywhere then yeah, one of your plugins will catch the event ๐Ÿ˜› wherever it is called

chilly swallow
#

So no bypasses here

#

If he IS not owner on bungee side or dont have his UUID or name in config on spigot side and has *
He got a PERMANENT IP BAN

fast delta
#

scary

chilly swallow
#

It is to Prevent skids and hackers to get opped in my server without my consent

fading kite
#

Can I give the player a node that disappears after 0:00?
If that doesn't work, I wonder if there is a way to remove all players in the group.
(using LuckPerms API)

wild whale
fading kite
wild whale
#

after 00:00 as in expires at a specified time, or 00:00 as in expires immediately

fast delta
#

nodes have an expiry date, with the API you can pass an Instant or what have you to NodeBuilder.expiry

hybrid marten
#

is there an event that triggers this?
"[LuckPerms] [Messaging] Received user update ping for 'name' with id: b8992870-c7cc-410a-99ba-c9607d6b6b98"
cant seem to find any what i want todo is when it receive this update it run some code

fast delta
#

probably the NetworkSyncEvent

night pier
#

Is that cancellable. I want to break my server

night pier
nocturne elbow
#

I want to create a GUI on the server and add it to the group in the luckperm plugin when I click on a specific item, but I don't know how to implement it with a script. Please tell me how to do it.

viral river
#

This is very confusing...

#

I installed the PAPI Placeholders Extension for Luckperms, then upon using %luckperms_meta_messagecolor%, it returns nothing.

#

This is my group's values.

main dagger
simple raft
#

hey en der kan hjรฆlp

past wolf
#

Hi, i want to remove a group of a player (this group contain a prefix), when i, remove it, the prefix stay, in game but not in luckperm editor so why ?

nocturne elbow
#

hi, i created group (vip, admin ect...), but they dont show in the tab list, how can they show?

left geyser
nocturne elbow
#

oh ok

left geyser
frank driftBOT
#
Please ask your question!

Please ask the question you have. Don't ask to ask, or ask to DM someone. There are people here to help you, but we need to know what to help you with, so please just ask the question you want to in as much detail as possible!

Or, try here first:
Why shouldn't I ask to ask?
nocturne elbow
#

how to promote like member to vip? i did the tracks but idk the command

left geyser
nocturne elbow
#

what

#

so what does tracks do?

left geyser
nocturne elbow
#

mb i just discover how to promote

stark nimbus
#

Is there a way to tell how far through a track a player is or do I have to go through the collection of inherited groups and check which is the furthest through the track?

nocturne elbow
#

Hello, I try to code a nick plugin - I already got it to work with prefixes (that it shows the normal one) but how can I fix the sorting ?
I sort by priority - but then admins would be above normal players then everybody knows that they're nicked

#

any ideas?

main dagger
#

not really an api question, but why not just make them appear as default if they are nicked?

nocturne elbow
#

But the tab is sorted by prio so I would have to remove the group too (priority)

main dagger
#

use the default groups weight for nicked staff instead of their actual group? anyways, should move to #general

dark bridge
#

You can also download a plug-in like essentials and use their nick system

upbeat spire
#

Hello; I'm trying to use the LuckPerms API to listen for when nodes get added/removed from users/groups, which works great if the nodes are added/removed from the same server I'm checking them from. But, every one of the events that work for local changes doesn't work for changes from other servers. The PreSyncEvent and PostSyncEvent seem to work for changes to groups, but not for users; meanwhile the PreNetworkSyncEvent looks like it works for users, but there's no matching PostNetworkSyncEvent. That, and if I want to use those events, I have to make my plugin store a copy of all the permissions it wants to track, and whenever the sync event finishes, read all the permissions it cares about again and see what changed the hard way. https://luckperms.net/wiki/Developer-API-Usage#events explains how to use the events that work for local changes, but completely skips how to listen for events from other servers. All that, and I haven't even thought about if the web interface has some third set of events.

Is there some simple documentation for listening for when permission nodes change that I'm missing? And if not, why? And what events should I be listening for to tell when permission nodes change on a user/group? If I'm going to get events to listen for when permission nodes change, I would have expected them to work regardless of how they were changed. I'd really love to be proven wrong about needing to duplicate every bit of data I care about in order to check if it's been updated.

jaunty pecan
upbeat spire
#

I'm pretty sure I've got everything working except for detecting when a player gains/loses an inheritence node; I'm working on a guild plugin. If the player is on the same shard as the person who added them to/removed them from the group, it's detected just fine, but if they're on another server the player being added/removed doesn't receive an event to for further plugin code to work off of.

#

I'm also rather concerned at how much code I had to duplicate to watch for changes to nodes on the group itself. For instance, I've got a metanode within a guild group that acts as a lock on a guild to prevent changes through the guild plugin's interface until a moderator gets involved. I had to watch for a pre-sync event, get a list of all guild groups that were/weren't locked, watch for the post-sync event, and do it again to find the differences.

#

Further explaining on why I need to listen for the user's group changing, I need to update a chat plugin for what the player's current guild chat is, and it is properly permission locked, but making the guild chat command spit out an error when joining/leaving a guild isn't ideal.

cursive dagger
#

hello you have docs for api forge ? i dont see forge in documentation

jaunty pecan
cursive dagger
#

How to use the service manager ?? is on bukkit

jaunty pecan
cursive dagger
#

ok i use this ?

LuckPerms api = LuckPermsProvider.get();

jaunty pecan
#

the only way that 'events' are sent between different LP instances is via the messaging service, which is used for action logs and sync notifications

cursive dagger
upbeat spire
# jaunty pecan NodeAddEvent/NodeRemoveEvent?? I guess you are trying to synchronize state withi...

LP is the single source of truth. However, my plugin code isn't getting properly notified when that information has updated. The chat plugin in particular does check if you have permission to talk in a given chat channel on every message, but the shortcuts for various chat channels doesn't care what those shortcuts are set to, only that you have access to them. The other plugin that manages guilds assumes you're only in one guild at a time and is supposed to update that shortcut when you change guilds.

I'm only receiving the events that a user has changed permission groups if they're on the same server that their permission group was modified from. Say we've got two servers named Valley and Isles. If you're on Valley and a moderator on Valley adds you to a permission group, then the NodeAddEvent is received and the other plugin code can use that event to update the plugin code that depends on LP. If the moderator then adds a new permission node to the permission group, then the NodeAddEvent fires again for the permission group and the other plugin code can again be informed that the permissions have changed.

Trying that same experiment with the moderator on Isles, neither modification results in a NodeAddEvent, so the other plugin code has no idea that the permissions changed using that event. I had to use the PreSyncEvent to temporarily copy the list of relevant permissions and who's in which permission group, then compare that to the results after a PostSyncEvent to see what changed, which lets me see when the permission group gets a new permission node - but neither event fires when adding a player to the permission group. Instead, the PreNetworkSyncEvent fires for players being added to a group, with no event that I can find firing after the sync is finished, leaving me with no way to track when a player is added from another server. In theory I could use the PreNetworkSyncEvent to grab the player's permission groups before a sync event, then assume the sync has finished the next tick and compare what changed - but I would have expected to be able to skip this whole paragraph and just use the NodeAddEvent, or something similar.

But the issue is, the LuckPerms documentation only gives documentation for how to listen for the events that work on a single Minecraft server - not for changes to permissions from other servers over MySQL or whatever other network synced solution.

wild whale
#

Is there any reason you're caching permissions and not just checking them when needed?

#

This sounds like a lot of work to maintain what appears to be some cached permission states

upbeat spire
#

checking them when needed
That is the issue - I can't tell when I need to check them, otherwise I could look it up easily.

#

The goal with the shortcut for guild chat messages is that it doesn't care how guilds are implemented, and thus doesn't updated automatically. It's expecting another plugin to manage that for it.

wild whale
#

Ok now I'm even more confused. I'm getting increasing XY problem vibes - What is it you're actually trying to accomplish, and why do you not know when you'll need to check permissions?

upbeat spire
#

I suppose it doesn't help I'm trying to solve multiple problems at once, so starting with a simpler case:

I want to notify players when they've been invited to a guild, with invites tracked by a permission group specific to that guild's invites. If you invite a player that's on the same server as you, then the NodeAddEvent fires properly, and the plugin code can listen for it and inform the player they've been invited to the guild.

If the player is invited to the guild from another server, then the NodeAddEvent does not fire. I do not know which other event to listen for that would tell me that they've been added to the group. I also do not want to remind them that they were invited to other guilds, so if I were to only be informed that their permissions have been updated, I would need to make sure the plugin remembers which notifications they've already received, and not tell them about those.

jaunty pecan
#

I am not sure using luckperms makes sense for that, sounds very custom and would probably benefit from being in it's own database + use of a message broker for notifications

#

but if you really wanted to - I guess you could store the invite as metadata on the User who was invited

upbeat spire
#

I've already got the majority of the code completed using LuckPerms as the database/backend; an example invite group:

/lp group guild.aba.invite.member

I do have a message broker I can use if needed, though. It's just a matter of tracking when the permission groups update at this point.

jaunty pecan
upbeat spire
#

Out of curiosity, though - why is it that the NodeAddEvent only shows up if you're on the same server that it was created from? I would have thought that it would be possible to listen for it from other servers with the same database in some way, or that there would be an equivalent event somewhere.

upbeat spire
jaunty pecan
#

because the eventbus (the thing that delivers events) doesn't send events between servers

upbeat spire
#

Well that'd do it.

#

I'm guessing I'll need some way to make sure I don't receive the notification from my message broker before LuckPerms has received remote data?

jaunty pecan
#

there is a 'messaging service' concept in LP that allows it to communicate with other instances, but only for a few things: log broadcasts, and update "pings" (correspond to the sync events) which basically say 'hey this user has changed, refresh their data from the DB if they are connected'

wild whale
jaunty pecan
upbeat spire
#

Fair enough. Though if there's a way to tell when player data has finished syncing, then I can check re-check that easily enough - I only see the pre-sync event for player data right now, with no post-sync event.

jaunty pecan
#

UserLoadEvent will be fired

upbeat spire
#

Including for players who were already online? So it's not the UserDataRecalculateEvent?

jaunty pecan
#

that one works too

upbeat spire
#

Thanks, I should be able to handle it from here.

slender marsh
#

how do I see if a player has a certain group? I want to implement a 'minimum' group function that determines if a player has the lowest possible group in order to see something.

main dagger
#

well you should probably use a permission for that, but to just check if a player has or inherits a group, you can just do a permission check for group.<group name>

white obsidian
#

Is it better to instantiate LuckPerms luckperms = new LuckPerms(){}; everytime I use it or is it better for it to be somewhere where it can be accessed as static?

fast delta
#

yeah uh you are not meant to instantiate it yourself like that

#

!api

frank driftBOT
fast delta
#

the first link shows how to obtain the API instance

#

the luckperms plugin provides you with the api instance, you don't create it

white obsidian
#

thanks

#

first time using a different plugin's api, mb

exotic rover
#

Hello Dash, how can I add temp to a rank that has both rank and job?

silver sleet
#

How come Custom Storage implementation is not part of the API?

#

Is that on purpose? Seems like it should be there

fading kite
#
val luckpermsProvider = Bukkit.getServicesManager().getRegistration(LuckPerms::class.java)
if (luckpermsProvider != null) {
    luckpermsAPI = luckpermsProvider.provider
} else {
    // error message
    Bukkit.getLogger().log(Level.SEVERE, "[$name] LuckPerms์ด(๊ฐ€) ๊ฐ์ง€๋˜์ง€ ์•Š์•˜๊ฑฐ๋‚˜ ์˜ค๋ฅ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.")
    Bukkit.getLogger().log(Level.SEVERE, "[$name] ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค.")
    Bukkit.getPluginManager().disablePlugin(this)
    return
}

(Main.kt)

val luckpermsUserManager = Main.luckpermsAPI!!.userManager
val luckpermsUser = luckpermsUserManager.loadUser(UUID.fromString(uuid))
luckpermsUser.thenAcceptAsync {
    it.data().add(Node.builder("group.${Main.instance.config.getString("settings.vote_group")}")
        .expiry(Util.convertToUnixTimestamp(Util.getPermissionResetTime()))
        .build())
    luckpermsUserManager.saveUser(it).thenRunAsync {
        val messagingService = Main.luckpermsAPI!!.messagingService
        if (messagingService.isPresent) {
            messagingService.get().pushUserUpdate(it)
        }
    }
}

my code has problem? sometimes my code doesn't run.

turbid solar
#

i'd use editUser

lost oar
#

How can I send a group a message? e.g. admin

rancid condor
#

is there a generic "user changed" event? i need to listen to whenever a player's "rank" changes

night pier
#

nodeMutateEvent + a check if the change was on a user

rancid condor
#

ah tyty

#

if i wanted the rank's prefix, would it be the primary group's display name?

#

or how would i go about getting that

#

as a Component/Text(yarn), doing some hackery with a clientside optional mod for our network

fast delta
#

if you wanna get the player's final prefix, you'd do something like user.getCachedData().getMetaData().getPrefix()

rancid condor
#

i realistically need the color too

#

if possible

fast delta
#

the color is not something that exists in a string, it entirely depends on the format the prefix is in

#

it could be json, legacy, minimessage, etc

#

that depends on what is rendering it

rancid condor
#

yeah, hence why i said the Component/Text, like the final prefix

#

i geuss thats only compiled when needed

fast delta
#

the prefix is stored as a string

#

it can be in any format you want

#

then you deserialise it however you need

rancid condor
#

hm i see

fast delta
#

if it's in json format, you use some json serialiser, if it's in minimessage format, you use the minimessage serialiser etc

rancid condor
#

say its minimessage, how would the prefix look?

#

the final string

fast delta
#

or smth

rancid condor
#

so like

#

prefix.80.<gradient:white:red>[MOD]

fast delta
#

yeah

night pier
#

is <red> valid? I though it was dark and light

fast delta
#

red and dark_red

rancid condor
#

was just an example ig

fast delta
#

it's the vanilla color names

night pier
#

mm

fast delta
#

you can use hex if on 1.16+

rancid condor
#

where are lp perm nodes stored? for stuff like prefixes

#

like in configs ig

wild whale
#

Entirely dependent on the admin's chosen data storage type

rancid condor
#

ah

wild whale
#

!storage

frank driftBOT
wild whale
#

But none of that is exposed in the API, that's all implementation details you don't need to worry about

rancid condor
#

yeah no i just need to find the ones we use

#

i didnt set up our lp so idk em

wild whale
#

What is it you're trying to do?

rancid condor
#

figure out the formatting we use so i can manually pick apart the prefix strings

wild whale
#

That'll be entirely up to your display plugin(s) then, that's not something LP handles.
All LP does is expose the literal prefix string set by an admin, and lets other plugins handle formatting however they want

rancid condor
#

ah

rancid condor
#

how can i safely get the luckperms api on fabric?

#

i dont see much on the wiki about when

wild whale
#

The singleton works on every platform

rancid condor
#

yeah but when is safe to load it

#

i tried in SERVER_STARTED event but even thats apparently too early

fast delta
#

server_started is safe

#

make sure you aren't shading or JiJing the LP API in your mod

rancid condor
#

imnot

river ivy
#

uh from what it seems

#

both of these seem to return the same thing

#

do anyone know how to get user's case sensitive name

lunar ferry
#

I'm using luckperms api in my plugin, and it throws an error when I run the plugin
[11:10:06 ERROR]: Error occurred while enabling Plugin v1.0 (Is it up to date?)
net.luckperms.api.LuckPermsProvider$NotLoadedException: The LuckPerms API isn't loaded yet!
This could be because:
a) the LuckPerms plugin is not installed or it failed to enable
b) the plugin in the stacktrace does not declare a dependency on LuckPerms
c) the plugin in the stacktrace is retrieving the API before the plugin 'enable' phase
(call the #get method in onEnable, not the constructor!)

    at net.luckperms.api.LuckPermsProvider.get(LuckPermsProvider.java:53) ~[StartStream-1.0.jar:?]
    at me.osarikas.startstream.Plugin.onEnable(StartStream.java:19) ~[StartStream-1.0.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-196]
wild whale
#

It provides the potential causes in the error message

#

Most commonly it's forgetting b - registering the dependency

lunar ferry
#

I know that there are possible problems and solutions written there, but none of them helps

#

the dependency is registered in pom.xml

wild whale
#

You need to also register a dependency in your plugin (I forget how paper-plugin.ymls handles that) - otherwise paper doesn't know your plugin needs to load after LP, and it's a coin flip which happens first

lunar ferry
#

it seems to be present as well

wild whale
#

That's the Bukkit way, but according to that stacktrace, you're using a paper paper-plugin.yml instead of a bukkit plugin.yml and as such registering dependencies etc is different. Consult Paper's docs for how to correctly handle dependencies

#

(If you don't know the difference between a Paper plugin and a paper-compatible Bukkit plugin, I'd suggest sticking with the older bukkit-style plugin system, there's a lot more documentation about it out there)

lunar ferry
#

Thanks, I'll try it

lunar ferry
lunar ferry
#

I already figured it out, it helped me to re-write the dependencies The first time the project simply didnโ€™t see them

#

Everything works for me without paper-plugin.yml, only plugin.yml

river ivy
#

do anyone know how to get User's username

#

without lowercap

upper nacelle
#

Your other options are storing it some other way or doing some non-cached request to an external service

river ivy
nocturne elbow
#

Guys help me some hacker auto matic hack my server how

#

He got full access to luckprems

left geyser
slender marsh
#

Trying to award a player a rank after a certain amount of time. I checked out the cookbook and used this code. If usera is offline, it produces a nullpointer and does not give the player the rank. How do I give a rank to an offline player?

        LuckPerms luckPerms = LuckPermsProvider.get();
        User usera = luckPerms.getUserManager().getUser(UUID.fromString(playerUUID));

        Group group = luckPerms.getGroupManager().getGroup(permissionNode);

        // Group doesn't exist?
        if (group == null) {
            return;
        }

        luckPerms.getUserManager().modifyUser(UUID.fromString(playerUUID), (User user) -> {

            user.data().clear(NodeType.INHERITANCE::matches);
            Node node = InheritanceNode.builder(group).build();
            user.data().add(node);
        });

        luckPerms.getUserManager().saveUser(usera);
slender marsh
#

thanks, that worked

wet flint
#

there a way to get offline player displayname?

wild whale
#

No, displayname is runtime-only, and regardless LP would have zero reason to store it

wet flint
#

what about get prefix/suffix?

wild whale
#

yup all LP data can be accessed via the API

#

!api

frank driftBOT
wild whale
#

!cookbook should have examples for that particular use case

frank driftBOT
wet flint
#

thanks

crimson rose
#

How do I change the text color to a specific group?
For example: Admin group's text will be red (what they write).

left geyser
nocturne elbow
#

I cnat get %luckperms_prefix% to work

#

@wild whale maybe instead of troll reacting peoples posts you can actually help them

frank driftBOT
#

Hey blu1776! Please don't tag helpful/staff members directly.

night pier
#

instead of posting in multiple channels, this one being completely unrelated you can actually keep it to the correct channel.

nocturne elbow
#

Hey guys I am using velocity and currently making my velocity essentials plugin and am having trouble listening to the luckperms "UserDemoteEvent" i believe that I have followed the Wiki correctly but i just dont see what is wrong and why it's not working, can someone help me?

https://paste.md-5.net/ewewocekev.java

nocturne elbow
#

I come to find out that only the UserDemoteEvent is not working, I tried listening to 'UserDataRecalculateEvent' and that seems to work just fine.

#

But it still doesn't help me because I need to listen to UserDemoteEvent for what I am trying to do.

alpine blade
#

Hey all. Can someone explain to me how to change a player's suffix through the API? I got kinda lost in the documentation... ๐Ÿ˜…

main dagger
quaint haven
#

user#setPrimaryGroup doesn't work?

    luckPerms = LuckPermsProvider.get();
    
    public static void setPrimaryGroup(Player player, String group) {
        User user = luckPerms.getUserManager().getUser(player.getUniqueId());
        user.setPrimaryGroup(group);
        luckPerms.getUserManager().saveUser(user);
    }```
#

I am not recieving the group.

#

I have also tried this:

InheritanceNode node = InheritanceNode.builder(group).build();
user.data().add(node);```
cunning halo
#

heya, is there a way i can check what group a player is in on another server?

main dagger
#

a player doesnt have a single group

#

they can have multiple groups

#

regardless of contexts

main dagger
#

dont crosspost. your issue is not related to the topic of this channel

opal chasm
#

I've got some code here which adds a user to a group called "dead" upon death. It works completely fine without saving changes, yet the API says to always save changes. The expected behaviour was for this to not work. Are there some circumstances where you don't need to save changes?

#

nvm - just realised that the changes don't save across server restarts, unless i save my changes in the code

#

always save your changes guys :')

main dagger
#

theres a modifyuser method that handles that for you

proud mortar
#

Hey, does the #getLoadedGroups() already return all loaded groups, or are they null? And if they are null, how do I add all existing groups in the set of groups? Maybe iterate through all groups, but Idk how

#

Or maybe work with the User object

#

Perhaps something like this

fast delta
#

i'm not sure how to answer any of those questions

#

what is your goal?

proud mortar
#

Its fine, got it to work. Thanks tho

drowsy tapir
#

theres a version of luckperms for mc 1.12.2?

main dagger
#

dont crosspost

tawny cape
#

Hello, I need to know if (and how) I can remove a specific group from a user. In the api cookbook, they simply remove all inherited groups from the user // Remove all other inherited groups the user had before. user.data().clear(NodeType.INHERITANCE::matches);
however I don't want to remove all inherited groups, as the user might have purchased a donator group, or might be staff ect. So for this reason, I want to only remove one of these groups from the user private final static String[] prisonerGroups = {"c-fange", "b-fange", "a-fange"};. How can I do this? Thanks :)'

ocean anchor
#

Hello, do you have an event to know when to add/remove a permission to player?

opal chasm
#

Looking at this method, does the comment about "Unique" mean that the method will not return users who are just a member of the "default" group?

#

if yes, then how do I get every single user? i'm doing it on server startup so i don't care about blocking the main thread really

static jasper
tropic snow
#

Mods can you tell me when I do /lp user parent set owner to a pocket player it's says do /uuid why

opal chasm
#

i'm listening for NodeRemoveEvent to check when a player is removed from a specific group. it works fine for the most part, but it doesn't fire when the player's parent data is reset, i.e. when /lp user <user> parent set default is used, despite this also removing the user from the group. how would i also cover for this scenario?

fast delta
#

NodeClearEvent iirc, something like parent set is a clear + add process

opal chasm
#

listening for NodeRemoveEvent and NoveClearEvent should cover all possible ways in which a player can be removed from a group (that isn't default)?

fast delta
#

i mean it will still fire if you remove default to add something else

#

but yeah sounds right

opal chasm
#

nice

#

actually, looking at the docs, NodeClearEvent says it's called when a user/group has all/some their existing nodes removed. does this mean that i don't actually need to listen for NodeRemoveEvent, because the clear should cover it as well?

fast delta
#

no

#

basically, NodeRemove is when one individual node is removed (basically NodeMap#remove(Node)) whereas NodeClear is when a bunch are requested for removal (could be a bunch of one) NodeMap#clear() or #clear(Predicate)

opal chasm
#

got it, thank you!

fast delta
#

parent set foo will clear existing inheritance nodes and add foo, whereas something like permission unset cool.thing will remove that one permission

opal chasm
#

it looks like it doesn't... is there another way to catch that?

#

for context, i'm trying to keep track of all players who are a member of a certain group in a cache

main dagger
#

why do you need to cache it?

opal chasm
#

currently, as well as listening for NodeAddEvent and NodeRemoveEvent, i'm listening for NodeClearEvent and checking whether the set of nodes contains an InheritanceNode for the group, and removing them from the cache if so. but NodeClearEvent is called when doing /lp user <user> parent set <group>, and if the group is the specific group i'm targeting here, they are not added back to the cache, despite now having that group as their primary

opal chasm
main dagger
#

unless you need offline players too, iterating over online players and doing a permission check should be fine

opal chasm
#

it does include offline players

fast delta
opal chasm
#

๐Ÿค”

#

I'll have to check why it didn't behave as expected for me when I get back to my pc

fast delta
#

the only case when it doesn't fire is when you already have the node (parent), which is not gonna be the case after clearing them all with parent set

opal chasm
#

That might have been it tbh

opal chasm
#

nvm i'm not sure what it was, but it's working as expected now. ty for the help!

deft aurora
#

in the console do lp editor and then you get a link. Click it and follow the editor it will make it easier for you

main dagger
opal chasm
#

does LP store when a player was added to a group, and if so is it retrievable?

wild whale
#

LP has an internal audit log, I know you can listen to events as they fire, I don't remember if there's API equivelants of the /lp log commands though.
There's definitely no explicit "this node was added at Instant .." api though, that's not stored

fast delta
#

there is API for the action log yeah, but it's nothing specific to nodes, just "something happened at this time with this as cause with this as target and this description"

tawny cape
#

How do I properly promote a user along a track? Currently this is what I've got

        User user = luckPerms.getPlayerAdapter(Player.class).getUser(target);

        if (!isGuard(user)) {
            return new GuardPromotionResult(GuardPromotionResult.ResultStatus.FAILED, "spilleren er ikke vagt");
        }

        Track guardTrack = getGuardTrack();

        ImmutableContextSet contexts = ImmutableContextSet.of("world", WORLD_NAME);
        PromotionResult promotionResult = guardTrack.promote(user, contexts);

        luckPerms.getUserManager().saveUser(user);

        if (promotionResult.wasSuccessful()) {

            return new GuardPromotionResult(GuardPromotionResult.ResultStatus.SUCCESS, "");
        } else {
            return new GuardPromotionResult(GuardPromotionResult.ResultStatus.FAILED, "der skete en uventet fejl");
        }
    }```
but I don't want the contexts to be set per world, I want it to be global (like doing `/lp user <user> promote <track>`)
main dagger
#

just dont add a world context

tawny cape
# main dagger just dont add a world context

Well yes, I only added that becasue I didn't know what else to do, but what context should I add instead? The method needs to have a context, right? And I don't see any "global" contexts on the website. Am I misunderstandingsomething here?

tawny cape
#

Okay wow, I missed this method ImmutableContextSet.empty() in the javadocs, which is obviously what I need

queen current
#

Hello, is there a LuckPerms API event that is triggered when a user is assigned a new group?

queen current
#

Okay, thank you!

bleak lance
#

anyone know where to aquire these

night pier
#

what does this have to do with the api

ornate peak
#

hey so I have this code:

        EventBus eventBus = luckPerms.getEventBus();
        eventBus.subscribe(plugin, UserDataRecalculateEvent.class, this::onUserDataRecalculate);

^ above code is in constructor 

    private void onUserDataRecalculate(UserDataRecalculateEvent event) {
        Player player = Bukkit.getPlayer(event.getUser().getUniqueId());

        if (player == null) {
            return;
        }

        TextDisplay nameDisplay = nameDisplays.get(player.getUniqueId());

        if (nameDisplay == null) {
            return;
        }

        String serializedPrefix = LuckPermsUtil.getPrefix(player.getUniqueId()).join() + player.getName();
        Component prefix = LegacyComponentSerializer.legacyAmpersand().deserialize(serializedPrefix);

        if (nameDisplay.text().equals(prefix)) {
            return;
        }

        nameDisplay.text(prefix);
        Bukkit.getLogger().info("4");
    }

For some reason, onUserDataRecalculate gets spammed when I remove a user from a group or really do anything with it, and my luckperms seems to crash?

#

the code's purpose is that whenever my prefix changes, it should set the text display's text component to the new prefix

ornate peak
#

Ok I found out: for anyone who may get this problem, turns out actually getting the players prefix causes the event to fire for some reason lol, so it creates a infinite loop

fast delta
#

it isn't getting the prefix

#

I take for granted your getPrefix function is doing loadUser

#

that will, well, load the user from storage, causing it to recalculate the data

#

you are given the user in the event, should use that directly

eager trellis
#

any reason on why this is happening?

#

UserPromoteEvent seems to be unknown

fast delta
#

the package is net.luckperms.api.event.user.track, not net.luckperms.api.event.user

wooden vault
#

can you get metadata of an offline player?

#

that returns a NullPointerException

wild whale
#

You'll need to load the User if they're offline

wooden vault
#

explain

wild whale
#

!api

frank driftBOT
wooden vault
#

bro ik how to use the api just not this

#

thats what its doing

wild whale
#

Second link of the above embed explains how to get a User, including what to do if they may or may not be online

wooden vault
#

@wild whale

frank driftBOT
#

Hey maximus_yt! Please don't tag helpful/staff members directly.

wooden vault
#

wait

#

ok

#

i did this

#

will that work?

wild whale
#

No. I'd highly suggest reading a guide on CompletableFutures.
What kind of context is this running in, is it on the main thread or async on some other thread?

wild whale
#

Yeah, that also will not work, any variables external to a lambda are effectively final inside the lambda.
Again, I highly recommend reading a guide on CompleteableFutures, async programming isn't the easiest thing in the world to understand.

wooden vault
#

or is that the same thing above

#

can u just tell me what to put please?

main dagger
#

we arent going to write your plugin for you. like _11 said, you should read up on how futures work in java, as its clear that you dont understand them

wooden vault
#

ik how java works its just this is confusing

main dagger
#

you dont know how async tasks work, which is critical when working with offline player data. you dont want to do things that freeze the main thread as will cause lag

torn canyon
#

Hey, I'm currently experiencing some issues with the nametag color of some players. For reference I create a Team ("hidePlayer") that has the nametagvisibility disabled. To hide the nametag of a player i just add the player to the team. To show it again i remove him from the team. The problem that occurs now is that after showing the player the color of it's nametag is lost and only is reset after rejoining (prob. also when changing rank). Is there something i have to take care of like saving the old team? before adding the player to the other team.

left geyser
robust plank
#

Hey!

Would the following method from the docs return whether a player has a permission string or not?

How would this work with Brigadier's command tree, and does it query their group as well, or just the per user permissions?

public boolean hasPermission(User user, String permission) {
    return user.getCachedData().getPermissionData().checkPermission(permission).asBoolean();
}
main dagger
#

if you just want a simple permission check on an online player, just use your platforms permission check method (eg Player.hasPermission(permission) on bukkit). that way you dont lock your users into using luckperms instead of another permissions plugin if they wish

raw agate
#

because

#

in the bungee api

main dagger
#

dont reply to unrelated messages just to ping

#

every platform has a built-in way to do a basic permission check. look at bungeecord documentation if you dont know what it is

raw agate
#

but

#

not work

#

every return to false

main dagger
#

well then you dont have the permission you are checking for

main dagger
#

bungeecord has no concept of OP

#

since you are using luckperms, you must assign permissions inside of luckperms

raw agate
#

okay

raw agate
#

this private boolean is correct?

#
private boolean hasPermission(ProxiedPlayer player, String permissao) {
        if (Main.luckPerms != null && player != null) {
            User user = Main.luckPerms.getUserManager().getUser(player.getUniqueId());
            if (user != null) {
                Tristate result = user.getCachedData().getPermissionData(QueryOptions.defaultContextualOptions()).checkPermission(permissao);
                return true;
            }
        }
        return false;
    }```
wild whale
#

Yes, though theres Tristate#asBoolean() which can clean up the tristate stuff.
But also just to make sure you're aware, bungeecord has CommandSender#hasPermission(String) (which ProxiedPlayer extends), so you could just do that unless there's a specific reason you're querying directly from LuckPerms

raw agate
#

i using the bungeecord

#

but

#

every time return to false

#

but

#

i have the permission in the panel of luckperms

main dagger
#

have you actually given yourself the permission using luckperms?

raw agate
#

yes

main dagger
#

show /lp user <your name> permission check <the permission being checked>

wild whale
#

What's the output of /lp user <who> permission check <affected permission>?

#

dammit sniper frypan

main dagger
#

or rather, /lpb since bungee

raw agate
main dagger
#

is this from /lp or /lpb?

raw agate
main dagger
#

show it from /lpb

wild whale
#

Repeat it with /lpb

main dagger
wild whale
#

Ok I'm blaming my VPN making my ping shit ๐Ÿ˜ 

raw agate
#

oh

#

in the console get this

wild whale
#

That'll be why

raw agate
#

how to set the permission in the global?

wild whale
#

!network

frank driftBOT
wild whale
#

!switch
You'll probably also need to switch your storage methods since I'm betting you're still using the default h2 storage method

frank driftBOT
main dagger
#

or just set it using /lpb commands if you dont have a database

#

if its just a test server, i wouldnt bother setting up a database

wild whale
#

eh I'm one for setting up a test server in a similar environment to prod, but to each their own

raw agate
#

okay

#

thanks

robust plank
# main dagger if you just want a simple permission check on an online player, just use your pl...

Hey! I understand that I can utilize the platform's permission check, and this is generally the way I go to for Sponge, Bukkit and so fourth. In modern Forge however, the PermissionAPI they have is a bit meh, so I wanted to query LuckPerms directly and use that in Brigadier, instead of the built in hasPermission that checks for a level integer.

Another example is my server-side menus. It generally works to shows button components if the player has the permission level I assign to the check, but I'd like to check for an actual node instead.

Edit: Seems to work as intended hooking directly into LuckPerms to check for permission in a Brigadier command tree.

torn canyon
fast delta
#

"recolor the nametag" and "put the player "back" in the group" are two entirely unrelated events unless you link them in your plugin/mod

#

LuckPerms has nothing to do with name tags and Minecraft teams or scoreboards, it doesn't do anything with them or touch them in any way

#

That's entirely up to whatever other mod/plugin is hooking LuckPerms with tags

#

a luckperms group is a group of permissions, so when you give a player/user a group, they will inherit the grouped permissions

robust plank
#

Hey!

When using user.getCachedData().getPermissionData.checkPermission(node).asBoolean() in a Brigadier command, or my server-side menu I seemingly have to re-log after assigning / revoking the permission to actually use a command.

Example: I want to run /ban, and gave myself the permission to do so, I had to relog for the client to actually see the change. Is there a reason for this?

wild whale
#

I'm far from a Bridadier expert, but if memory serves, you have to explicitly resend the command list to players to refresh the clientside cache of valid commands

#

I'd suggest adding debug logging to ensure the aforementioned code snippet is returning the results you expect to rule out LP as a potential problem source

solid sable
#

I might be missing something, but why is method 1 not working, but method 2 is working?

String key = "group.rankName";
CompletableFuture<Map<UUID, Collection<Node>>> futureUsers = luckPerms.getUserManager().searchAll(NodeMatcher.key(key));
futureUsers.thenAcceptAsync(users -> {
  users.keySet().forEach(uuid -> {
    luckPerms.getUserManager().modifyUser(uuid, user -> {
      // Does not work
      user.getNodes().removeIf(node -> node.getKey().equals(key));

      // Does work
      user.getNodes().stream().filter(res -> res.getKey().equals(key)).findFirst().ifPresent(node -> user.data().remove(node));
    });
  });
});
wild whale
solid sable
main dagger
#

i mean, it has to iterate over it anyways

#

even if your first method worked, removeIf(func) seems like its just filter(!func())

tepid scroll
#

yo i have a question

#

and yes i tried the help/questions

main dagger
#

unless its a question regarding making a plugin or mod that integrates with luckperms, ask in #support-1 or #support-2 and wait for a response

white osprey
#

Does offline permission check include player's op state? It looks like it doesn't - result of online bukkit check is other than offline luckperms api check. Is there a way to have the result as normal, including op?

fervent valley
#

Hey, I'm creating a Velocity/Bungeecord plugin and need help with prefix/suffix things.

What order is the default ordering to getting a prefix? For example; let's say we have;

prefix.100.Owner - server:hub
prefix.100.Admin - No server context

If the player is in the "hub" server, is it default behaviour to show the Admin prefix first or the Owner prefix first?

Lastly, is there a way to do this built-in with the API, or do I have to filter it manually? Right now I'm just using the Stream API to filter it manually. I believe there's a way to do this via the Bukkit/Spigot version of the API, but with a proxy I think there's no built-in way. I could be wrong

wild whale
#

The behavior when a user inherits multiple prefixes of the same weight is undefined. This is why prefixes/suffixes have weights on them and not just using the group weight, since situations like this can easily arise. Use the prefix/suffix weight to be explicit as to which should be shown

#

Basically, a prefix weight should be globally unique, or at least set up in such a way that there's only one way for a user to inherit a prefix of a given weight (i.e. if you have 2 groups that users can choose from, having them share a prefix weight would be fine as long as the 2 groups are mutually exclusive)

fervent valley
main dagger
#

your question has nothing to do with the api. please direct general luckperms questions to #support-1 OR #support-2 (but not both!)

young fiber
#

hello, is it possible to make a plugin that will do something ex: send the message "1" when something involving luckperms happens (a log is created/sent)?

   @EventHandler
   public void onLogBroadcast(LogBroadcastEvent event) {
       Bukkit.broadcastMessage("test");
   }

I have tried this, but doesn't seem to work.

wild whale
#

Correct, LP doesn't use the Bukkit event system since that's not avaliable on other platforms, our API events have their own event bus

#

!api

frank driftBOT
trail minnow
#

why that add rank instead of set rank ?

left geyser
trail minnow
#

ok ^^

#

someone can help me plz ? ^^'

wild whale
#

Someone will respond when they can.

shy wadi
#

When is this the case? I'm trying very hard to get an instance that is not up to date but it always is

wild whale
#

uh why do you want an out of date User? This sounds like XY problem

shy wadi
#

so i don't do it on accident

rich oxide
#

why do I get nothing if the player has a prefix?
should be like: L [ะŸัƒั‚ะฝะธะบ] _MrTvist_ : msg

fast delta
#

don't do it like that

#

the prefix might be inherited from a parent group

#

it is also calculated, rather than just a single node

#

you should get the meta data cache from the user, and get the prefix from that

azure imp
#

Hellu, i have some weird problem with the Luckperms API and i am not able to reproduce myself on my own machine

#

I am getting this error

#

On my pterodactyl server but not on my macbook running the exact same version of purpur and luckperms while coding

#

And yes luckperms is installed xd

fast delta
#

would need to see the full server latest.log and your plugin.yml/paper-plugin.yml

azure imp
#

I am stripped our my permission fo the paper-plugin.yml

#
name: Keklist
version: '1.0.0'
main: de.hdg.keklist.Keklist
api-version: '1.20'
description: Custom made white and blacklist with many features!
authors: [ "hdgamer1404Jonas", "SageSphinx63920" ]
website: https://keklist.pages.dev
loader: de.hdg.keklist.KeklistLoader
contributors: [ "LPTP1" ]
default-perm: op

dependencies:
  server:
    floodgate:
      load: BEFORE
      required: false

    Plan:
      load: BEFORE
      required: false

    Luckperms:
      load: BEFORE
      required: false
      join-classpath: true

    PlaceholderAPI:
      required: false```
fast delta
#

LuckPerms

azure imp
#

.-.

#

But why is it working on local

fast delta
#

ยฏ_(ใƒ„)_/ยฏ

azure imp
#

<3

#

Ill try

fast delta
#

but the plugin name there is case sensitive

azure imp
#

Thats good to know

#

And its fixed

tawny geode
#

if im in my hub server and i want the scoreboard to display someones rank (group), where can I get a placeholder to do that?

river ivy
marble lichen
#

Hello, is it possible to test if a group exists (from its name) ? I saw GroupManager#getLoadedGroups but i don't know if the group i search will be loaded

#

Nevermind, just found GroupManager#getGroup which returns null if the group doesn't exist

trail minnow
#

nobody can help me ?

#

how i can set rank instead of add rank

zenith snow
#

ye like i dont even know where to start at? I want to get a permission check and now i need to learn the whole api???

#

what da hail a completeableFuture?

#

Why cant i load my offlienuser using the docs

wild whale
#

!api

frank driftBOT
zenith snow
#

giving me the api command and not answering a basic question will make the conveniert switch to vaults api even easier for me

wild whale
zenith snow
#

well i think i got it

#

unless

#

when there is a player that never joined this server it works perfectly, but when the player joined the server it says user is null

OfflinePlayer target = Bukkit.getServer().getOfflinePlayer(args[0]);
User targetUser = LuckPermsProvider.get().getUserManager().getUser(target.getUniqueId());

wild whale
#

Like I said in #support-1 and above, and as explained in the docs ^, you need to load the user if the player is offline

zenith snow
#

and what do i do with that future whatever thing

left geyser
wild whale
#

Indeed it is

zenith snow
#

i dont see sht

#

am i blind

left geyser
zenith snow
#

User targetUser = null;
        OfflinePlayer target = Bukkit.getServer().getOfflinePlayer(args[0]);
        if(!target.hasPlayedBefore()) {
            targetUser = LuckPermsProvider.get().getUserManager().getUser(target.getUniqueId());
        } else {
            CompletableFuture<User> futureUser  = LuckPermsProvider.get().getUserManager().loadUser(target.getUniqueId());

            Executor executor = runnable -> Bukkit.getScheduler().runTask(LaserStaff.getPlugin(LaserStaff.class), runnable);
          
            futureUser.whenCompleteAsync((targetUser1, exception) -> {
                if (exception != null) {
                    // There was some error whilst getting the log.
                    return ;
                }
                
            }, executor);
        }```

I've gotten this far. How do i get the user that i get from futureUser and save it as targetUser
zenith snow
#

im stuck on this and cant get further because your javadocs dont show shit, the response time is 10 hours and the docs dont show anything useful. HOW AM I SUPPOSED TO LEARN HOW TO GET A OFFLINE USER, which BTW. is a VERY BASIC THING A PERMISSIONS PLUGIN SHOULD DO, when the only thing ur plugin docs show, is how to get some Log shit

main dagger
#

you are not entitled to support. we are volunteers offering support in our free time. you have been linked to the page on the wiki that includes a section on how to losd users. if you dont understand something on the wiki, you need to say what part of it you dont understand, instead of baselessly claiming our documentation is useless.

zenith snow
left geyser
zenith snow
#

misinformation?

#

what part of my message includes misinformation?

#

~ silence ~

left geyser
#

It's quite evident you just came here to complain, instead of seeking for genuine support with your LuckPerms API questions. We won't continue this discussion further here. Any info you'll ever need when using the API can be found in the wiki, we've already linked to you numerous times, under the "Developer" section, as well as an example plugin (the api cookbook) demonstrating essential functions and usages of the LuckPerms API found here.

zenith snow
#

First of all, you are not to tell me when to speak or not. If you cannot take serious criticism then its not my problem.

Also, you are so sure you have

already linked to you numerous times, under the "Developer" section, as well as an example plugin (the api cookbook) demonstrating essential functions and usages of the LuckPerms API found here.

Either I am blind or i have not received any links except those included in !api, which do not include any cookbook or anything relevant even to the slightest about users and completeable futures

rugged hedge
hearty edge
#

I probably won't get much help here, but is there a way to read the prefix of a group using user.getCachedData().getMetaData().getMetaValue("some-key") with skript (and skript-reflect)?

main dagger
#

youd have to ask skript

#

also group prefixes arent normal meta

#

or prefixes in general

#

also why do you want a groups prefix and not just the users prefix?

hearty edge
main dagger
#

you mean tags?

hearty edge
hearty edge
# main dagger you mean tags?

let me rephrase it, i'm trying to make something similar to the nicking on hypixel where you can change how people see your rank, like you having youtube rank permissions but having a vip rank prefix

solemn saffron
#

I have a question, namely can you get all loaded users with the api. Is it possible that all users are always loaded, even if they are not on the server?

main dagger
#

"all loaded users" will usually just be "all online users"

solemn saffron
#

and is there anything to get all the players that have ever been registered?

wild whale
rancid hinge
#

could someone help me

#

how to import it

rancid hinge
#

does anyone know why this wont work


private fun addPlayerToLuckyPermsGroup(player: Player, groupName: String) {
        val user = luckPerms?.userManager?.getUser(player.uniqueId)
        if (user != null) {
            val group = luckPerms?.groupManager?.getGroup(groupName)
            if (group != null) {
                user.primaryGroup = group.name
                luckPerms?.userManager?.saveUser(user)
                player.sendMessage("${ChatColor.GREEN}You have been added to the ${ChatColor.LIGHT_PURPLE}$groupName ${ChatColor.GREEN}team.")
            } else {
                player.sendMessage("${ChatColor.RED}The group $groupName does not exist.")
            }
        } else {
            player.sendMessage("${ChatColor.RED}Unable to find user data.")
        }
    }```
main dagger
#

LuckyPermsGroup ๐Ÿ’€

#

setting a users primary group doesnt do anything

#

you need to add an inheritance node for the group

#

!cookbook

frank driftBOT
rancid hinge
# main dagger you need to add an inheritance node for the group

like this?

private fun addPlayerToLuckyPermsGroup(player: Player, groupName: String) {
        val user = luckPerms?.userManager?.getUser(player.uniqueId)
        if (user != null) {
            val group = luckPerms?.groupManager?.getGroup(groupName)
            if (group != null) {
                user.data().add(InheritanceNode.builder(group).build())
                luckPerms?.userManager?.saveUser(user)
                player.sendMessage("${ChatColor.GREEN}You have been added to the ${ChatColor.LIGHT_PURPLE}$groupName ${ChatColor.GREEN}team.")
            } else {
                player.sendMessage("${ChatColor.RED}The group $groupName does not exist.")
            }
        } else {
            player.sendMessage("${ChatColor.RED}Unable to find user data.")
        }
    }```
nocturne elbow
#

One message removed from a suspended account.

main dagger
#

groups do not store what players are in them. you would need to loop over players and filter the ones that are in the group

#

if your doing something like sending a message to only players in a certain group, you might be able to get away with just filtering players with the group.<group name> permission

solemn saffron
#

If I change something in the player role with a proxy plugin, will the event also be triggered on the spigot plugin?

upbeat tusk
#

if it's connected with a remote database then maybe because they use their own EventBus

solemn saffron
#

The two servers have the same localhost database but neither the UserDataRecalculateEvent nor the GroupDataRecalculateEvent is triggered for me, I previously had the command in the spigot plugin and it still worked.

upbeat tusk
#

I haven't went so deep in their API i just grab user data so not really sure personally

solemn saffron
#

hm okay

solemn saffron
#

I see thanks

#

I will try it

solemn saffron
#

Is there a way to get all known perms from all connectet Servers?

main dagger
#

no. luckperms only keeps the permissions it knows about from the current server. also xy, why do you need the list of permissions?

solemn saffron
#

I would like to make the permission command easier and suggest all permissions that exist

main dagger
#

luckperms already does that to the best of its ability

solemn saffron
#

Yes, but not from all servers

slim willow
#

how i can not shade it in gradle? for velocity?

slim willow
#

iam getting this bug

wild whale
frosty laurel
#

Hi all
For quite a long time I have been observing a problem with players losing permissions. This may have something to do with the Towny plugin.

When a player joins or leaves a town, he may lose permissions, including his privileges (group.<group_name>), this happens randomly and not all the time.

At first I thought that the problem was in Towny itself, but after talking with the developer he told me โ€œWhen a player leaves a town, and they are online, and they are in a towny world, Towny clears their permissions and assigns the nomad permission nodes. You 'd normally see LP re-assign permission nodes for their group quickly after this. The issue you have is on the LP side of things, or in whichever plugin is not re-assigning the permission nodes to your players".
Can anyone give me a hint to solve the problem? Maybe I can do some debug for this?

main dagger
#

luckperms doesnt "re-assign" permissions

#

something has to tell luckperms to do that, it doesnt just do it on its own

frosty laurel
main dagger
#

either running the appropriate permission/group commands as console or using the api

umbral anchor
#

Is it intended behavior that adding PermissionAttachments during a UserDataRecalculateEvent doesn't call another UserDataRecalculateEvent?

#

Not sure if adding PermissionAttachments is supposed to call that event at all.

umbral anchor
#

Works for my usecase ๐Ÿ˜

steady jay
#
[00:07:43 INFO]: 5ca251ab-589d-4f04-8f0c-28404d0686b0
[00:07:43 INFO]: [RankupMenu] [STDOUT] ForgotUrPassword
[00:07:43 INFO]: [RankupMenu] [STDOUT] rank15
[00:07:43 INFO]: [RankupMenu] [STDOUT] [Nomad, Admin, rank15]
[00:07:43 INFO]: me.lucko.luckperms.bukkit.vault.LuckPermsVaultPermission@26063384
[00:07:43 INFO]: false

Why is it when using vault#playerRemoeGroup, it returns false?

#
return (this.perms != null && this.perms.playerInGroup(null, p, group));
``` this returns true, they're 100% in the group
#

this returns false. I tried with world, no world. player name, etc.

#

it just won't take away the rank

north nest
#

Hi, i need help for make logs with DiscordSRV, does not detect the event.

    Channel: logs
    Embed:
      Color: "#ff1100"
      Author:
        ImageUrl: "{embedavatarurl}"
        Name: '{username} ha cambiado de grupo de permisos.'
      Description: "${Optional.getGroupFrom()} **->** ${Optional.getGroupTo()}```
wild whale
#

LP's events do not use the Bukkit event bus and as such are not compatible with DiscordSRV's alert system

umbral anchor
#

Can I control how long UserManager#loadUser loads the player for, or is it just kind of GC'd whenever?

fast delta
#

iirc api loads last for five minutes

wild whale
#

iirc the housekeeper cleans them up after 5 minutes, whether that's from first load or last access, I can't remember

fast delta
#

you can't decrease that (e.g. by unloading manually) but you can extend it by cancelling the unload user event

umbral anchor
#

Maybe I should just use the Vault API since all I need to do is check if an OfflinePlayer has a permission.

fast delta
#

xd

umbral anchor
#

Oh, I see. Since then, vault-unsafe-lookups has been added. Doesn't matter, I'll go ahead with the API.

#

Would a permission check for a permission that defaults to true in a plugin.yml return true or undefined (and therefore false) here? Just interested, my design does not depend on this.

fast delta
#

true

wild whale
#

assuming a default config anyways, admins can disable that behavior

umbral anchor
#

I know, I've disabled that myself lol

opaque sinew
#

Can I subscribe to events asynchronous or does it have to be synchronous?

wooden vault
#

can i edit luckperms messages in code?

fast delta
fast delta
main dagger
#

you could intercept outgoing message packets, but dont do that. its not worth it

desert fractal
#

Hey, I don't really know if this is the right channel, but here's my qustion: is it possible to add/set the parent group of a user using the LuckPerms REST API?

desert fractal
main dagger
#

errr

#

no thats setting the nodes in a group

#

post only adds 1 node, and patch can add multiple

#

if you want to emulate parent add, you can just do the last step

#

@desert fractal

forest crown
#

I was wondering how luck perms handle &#HEXCODE?
Since it supports both mini message and &#HEXCODE... but LPC doesn't support mini message I wanted to adapt plugin to handle &#..... too.

(PS: Sorry if its dumb question to ask about classic &#)

main dagger
#

wrong channel but luckperms doesnt handle color codes

#

!lpc for lpc

frank driftBOT
forest crown
main dagger
#

luckperms does not handle color codes

#

the only place it does any handling of color codes is in the preview when using certain /lp commands. it does not apply the formatting when another plugin display it in chat, the tablist, etc

#

but again

#

wrong channel

forest crown
#

Well in /lp group <groupaname> info? The prefix and suffix seems to be formatted.

forest crown
main dagger
#

well it has nothing to with the api

night pier
forest crown
#

Ok boss.

frozen pike
#

Hey guys

#

Could anyone please help me?

#

Im having troubles

#

So this is my code

#

Im making a Hover Plugin, where if a player hovers on top of a player username, he gets some info about his

#

Admin, Moderator, User etc

#

And it works perfectly fine

#

But when I put the plugin in my plugin folder

#

And I write a message in chat, even tho Iโ€™m in a LuckPerms group with prefixes, I dont see my prefixes

#

So I implemented the LuckPerms API

#

But I receive this, why is this.luckperms null?

upbeat tusk
frozen pike
#

And which value should I assign to this.luckperms?

#

And how do I assign it?

#

Iโ€™m new in this

upbeat tusk
frozen pike
upbeat tusk
#

That's one way to access the LuckPerms API, yeah

frozen pike
#

But I already have the LuckPerms API installed in my dependencies

#

Should I send u the screenshot of the error maybe?

#

In your DMs?

upbeat tusk
#

You see the LuckPerms field?
It's not initialized, basically you're not setting it to anything. The code won't magically initialize it for you behind the settings

upbeat tusk
upbeat tusk
#

You can also use the static getter LuckPermsProvider#get if you don't want to use the Bukkit services manager

frozen pike
#

But I would remove it if LuckPerms decides to work and get the prefixes

#

So if I understand correctly

upbeat tusk
#

Did you learn java before getting into spigot development?

frozen pike
#

Yes

upbeat tusk
#

smh

#

You should not hardcode the display name colors tho, that way you need to modify the code every time you make a new rank

frozen pike
#

I simply added the ChatListener bc LuckPerms prefixes didnโ€™t work

#

But by testing it, it also didnโ€™t work

upbeat tusk
#

You need to get the User object of the player who joined in order to access their prefix right?

frozen pike
#

A whole red block of errors show up

#

In the console

upbeat tusk
frozen pike
#

I guess so

upbeat tusk
#

you're using the UserManager to get the User

#

Okay, where does UserManager come from?
it comes from the LuckPerms class

#

You need an instance of the LuckPerms class in order to get data

upbeat tusk
frozen pike
#

Ok so Iโ€™ll add that to my code

upbeat tusk
#

Sure

frozen pike
#

Will this resolve my problem?

upbeat tusk
#

It's throwing an error because your LuckPerms field is not initialized at all, it doesn't have any value so it can't get UserManager from it because it doesn't exist. If you had an instance of LuckPerms then it wouldn't be null

#

You're just making a LuckPerms field, what are you assigning it to? nothing

#

oops wrong image

frozen pike
#

Ok I added it to my main class

#

Another question

upbeat tusk
frozen pike
#
        this.luckperms = plugin;
}```
upbeat tusk
#

That's close

#

You need your actual main class not JavaPlugin though. Also please follow java naming conventions, the paramter names should be camelCased, although you should not name it LuckPerms because that's your main class not LuckPerms

upbeat tusk
#

Why are you calling it luckPerms?

#

That's your JavaPlugin class not LuckPerms

upbeat tusk
#

._.

upbeat tusk
#

To get an instance of your main class using dependency injection, you make a field then initialize it to your constructor parameter

upbeat tusk
#

Read it carefully, you don't need to be on a hurry

frozen pike
#

Ok I understood

#
        this.luckperms = luckperms;
}```
#

Boom

#

Is this correct?

upbeat tusk
#

No

#

You need your JavaPlugin

frozen pike
#

My main class?

upbeat tusk
#

Which class of yours extends JavaPlugin -.-

frozen pike
#

Main class

upbeat tusk
#

Yeah then that's the one

frozen pike
#

But why is โ€œpublicโ€ an unexpected token

upbeat tusk
#

also don't name it luckPerms because it's not that, it's your JavaPlugin class

#

common practice is to name it plugin since it's your plugin class like you might've seen on the guide I sent

#

I doubt you actually read it ๐Ÿค”

frozen pike
#

Since its my JavaPlugin class

frozen pike
upbeat tusk
#

The getter will return the provider provided by the Services Manager

frozen pike
#

So it should be looking like this?

#

Iโ€™m not understanding

#
    this.HoverInfo = HoverInfo;
}```
#

Should it look like this?

upbeat tusk
#

This makes no sense, where's your main class field, how are you setting a non-existing HoverInfo field(breaking the conventions again) to a non-existing HoverInfo parameter?

frozen pike
#

U told me to substitute plugin with my JavaPlugin class

upbeat tusk
#

Here's an example:

public class MyListener implements Listener {
    
    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();

        // Set the join message to join-message value from config
        event.setJoinMessage(""); // Need the getConfig() method from the main class
    }
}```
Now I can use dependency injection to get my main class. So basically when I register my event in my main class I can pass in `this` as an instance of my main class:
```java
public class MyListener implements Listener {
    
    private final MyMainClass plugin;

    public MyListener(MyMainClass plugin) {
        this.plugin = plugin; // Setting the plugin field to the provided main class instance (This will get called before the PlayerJoinEvent so we will have a main class instance to access stuff from the main class)
    }
    
    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();

        // Set the join message to join-message value from config
        // Now we can use the plugin field to access the getConfig() method from JavaPlugin
        event.setJoinMessage(plugin.getConfig("join-message"));
    }
}```
So in your case you will need your main class instance to access a method that returns an instance of the LuckPerms class that allows you to access LuckPerms methods like `LuckPerms#getUserManager`. You will make that method get an instance of LuckPerms using Bukkit's ServicesManager
#

On the main class I could do this:

public class MyMainClass extends JavaPlugin {
    
    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new MyListener(this), this); // We're providing "this" for the MyListener class so it can set the field named "plugin" to this instance and thus we can access methods from here (we want to access the getConfig method)
    }
}
#

In your case you'll have a getLuckPerms method you want to access from the main class

#

If there's anything confusing you make sure to ask, you need to understand this perfectly :>

frozen pike
#

To

#

new MyListener(this) plugin

#

In my main class right?

upbeat tusk
#

No

#

You don't have a variable or field named plugin in your main class. Java's keyword this refers to the class you are in so you can just pass that as a reference to your main class that you are in

#

If you're in the class for example MyClass then this refers to that class (this is a Java keyword)

frozen pike
#

Oh ok

#

So, Iโ€™ll just need to leave my Main Class alone, I donโ€™t need to touch it for now

#

I now need to make the DI

upbeat tusk
#

Yeah

frozen pike
#

Thatโ€™s the part I get confused

upbeat tusk
#

Also you should be writing in your actual project not in discord

#

writing the code

frozen pike
#

Yea I know

#

Iโ€™m also writing there

#

But I only get a bunch of errors

upbeat tusk
#

Yeah because you're doing it wrong

frozen pike
#

But I need to understand it first

upbeat tusk
#

this this.plugin = plugin basically this.plugin refers to your plugin field and plugin refers to what was provided in the constructor when the class was initialized

#

the this keyword also refers to the fields inside the class

#

so this.plugin is referring to this

frozen pike
#

Oh

#

Wait I didnโ€™t write that private line

upbeat tusk
#

We're using the private access modifier for the field because we are never using it outside of this class

frozen pike
#

So do I need it?

upbeat tusk
#

Just put it there yeah

frozen pike
#

Yay done

#

^ MyListener Class

#

^MyMainClass, I added this inside the ()

upbeat tusk
#

Okay, now go to your main class and make a getter for LuckPerms that returns the provider from Bukkit's Services Manager. You can use the code you got from LuckPerms' wiki

frozen pike
#

We already added it

upbeat tusk
#

You added it into the onEnable but you're never using it

#

Make a LuckPerms interface field in your main class, and set it to your provider.getProvider(), then make a LuckPerms getter that returns your field

frozen pike
#

Uhm

#

I donโ€™t understand

upbeat tusk
#

What don't you understand exactly?

upbeat tusk
#

Do you know what fields are?

frozen pike
upbeat tusk
#
public class Example {
  
    private int exampleInteger; // <-- That's a field
}```
#

Now make a LuckPerms type field and set it to provider.getProvider() in your onEnable

upbeat tusk
#

And this one isn't initialized yet. You want to initialize yours on the onEnable and set it's value to provider.getProvider()

frozen pike
upbeat tusk
# frozen pike

Bro you already have a LuckPerms field in your ChatListener class. Just delete it and put it inside your main class instead, then assign it's value to provider.getProvider()

#

And make a method that returns your field

#

That's really basic java stuff

frozen pike
#

This?

upbeat tusk
#

Yeah that's an instance field

#

Just move it it to your main class

#

And do the steps I told you

frozen pike
#

I already have one in my main class

upbeat tusk
#

Where is it?

frozen pike
upbeat tusk
#

Now add back the code you got from LuckPerms' wiki, and instead of making a new LuckPerms variable and assigning it to provider.getProvider() assign your instance field

frozen pike
#

I know in my main class

upbeat tusk
frozen pike
#

So I should write this luckperms wiki code 2 times? One for bukkit Manager and 1 for the instance?

upbeat tusk
#

The same it was, but just set the provider to your LuckPerms field. I assume you know how to assign a variable, don't you?

upbeat tusk
frozen pike
#

I have already one luckperms code in the onEnable

#

Donโ€™t u remember we wrote it together?

#

It was for the provider

upbeat tusk
#

Can you send a new paste with your main class?

frozen pike
#

Sure

upbeat tusk
#

Instead of making a new variable called api and setting it to provider, just set your luckperms field to the provider instead

frozen pike
upbeat tusk
#

You need to set your luckPerms instance field to that instead of making a new one

fluid totem
upbeat tusk
fluid totem
#

ye

#

@frozen pike

#

you create a new variable in the main class

#

then initialize it in the onenable

frozen pike
#

Could u explain?

upbeat tusk
#

Do you know how we can reassign this variable to be 4.99?

frozen pike
#

Just change the 2.99 to 4.99

upbeat tusk
#

No, I mean reinitializing it

#
double price = 2.99;

// We feel like changing it to 4.99 here

System.out.println(price); // This should print 4.99 not 2.99
#

How would you do it?

#
price = 2.99
``` at this part of the code, we're initializing it to 2.99
#

How could we re-initialize it to 4.99 afterwards?

frozen pike
#

Idk

upbeat tusk
#

This is extremely basic and is covered in every single beginner java tutorial ._.

#

You should learn java before hopping into Spigot Development so that you can know what you're writing

sage smelt
#

Hey everyone, How to use the command /lp bulkupdate users delete "permission ~~ quests%" but I don't need to enter a confirmation code

#

what should I do? Is there any configuration to fix it or how to use the api to turn it off?

frozen pike
#

Ops

left geyser
#

That has nothing to do with the API. You've enabled a setting in your LuckPerms config allowing you to skip bulk edit confirmation.

Additionally, you shouldn't attempt to mass ping others when asking for support.

fluid totem
#

bro

sage smelt
left geyser
sage smelt
#

hmm, i use luckperm 5.4 but i don't see any char skip or bulk in config

left geyser
#

If you can't locate it, manually add it yourself. You can keep your config up-to-date, by comparing the one you currently use with the default one from GitHub.

For further non API questions, please use #support-1 or #support-2. bee_happy

frozen pike
#

this.luckPerms = provider.getProvider()

upbeat tusk
#

Exactly

#

Now use your plugin field to access the getLuckPerms method and get the player's prefix

frozen pike
#

I couldnโ€™t find that anywhere

upbeat tusk
#

._.

#

you're already doing that but using a field that's not initialized

frozen pike
#

I really have no clue

#

Could u tell me how to do it?

upbeat tusk
#

Replace this with your main class' getLuckPerms method

frozen pike
#

Like this?

upbeat tusk
#

bro what do you have the main class instance for?

frozen pike
#

Iโ€™m in my Listener Class now

#

Not in my main class

upbeat tusk
#

Yeah you have your HoverInfo field...

frozen pike
#

Yes

upbeat tusk
#

Yeah access your HoverInfo's getLuckPerms method using that

frozen pike
#

Using this? this.luckPerms = provider.getProvider();

upbeat tusk
#

Well yeah, your getLuckPerms method returns the provider

#

Just use your getLuckPerms method

#

You already have access to your main class

frozen pike
#

So for example like this

#

LuckPerms getLuckPerms = provider.getProvider();

#

No

#

Wait

#

Mmmmh

upbeat tusk
#

Why are you changing your ServicesManager code?

frozen pike
#

Iโ€™m not

#

Iโ€™m in my Listener Class

upbeat tusk
#

Okay, now use your plugin instance field to access the getLuckPerms method

frozen pike
#

How would u do that?

frozen pike
#

I should add this to my main class

upbeat tusk
#

._.

#

You already have this method smh

frozen pike
#

Where

upbeat tusk
#

I strongly encourage you to take a basic java course :>

#

It's really not good to start writing spigot plugins when you lack basic java knowledge

frozen pike
upbeat tusk
frozen pike
#

Itโ€™s not the same code

#

Bruh

upbeat tusk
#

I had already told you to make a getter for your luckPerms field a trillion times

main dagger
#

it is expected that you have a basic knowledge of how to program with java before writing a bukkit plugin, and by extension, using the luckperms api

wild whale
#

LP's API in particular uses several more advanced concepts like futures, so at least get comfortable with the bukkit API and java before attempting to use LP's API

#

Also, if you're just trying to get a player's prefix, the vault API might be easier, though it's less powerful

upbeat tusk
wild whale
#

Vault's get prefix thing is a single call, LP's API requires getting the user, then getting the prefix from their cached data. LP's API is far more powerful, but for the majority of users who just want to grab a prefix, I'd say vault is easier (plus compatible with other permission plugins)

upbeat tusk
frozen pike
#

and replace private LuckPerms luckPerms; with private LuckPerms luckPerms = plugin.getLuckPerms();

upbeat tusk
#

Since your plugin field is not initialized when this code runs it will throw an NPE or your IDE won't let you do that

frozen pike
#

Could u explain me then what u mean in ur step?

#

I donโ€™t understand what u mean

#

Iโ€™ve been stuck here since 3 days

main dagger
#

again, you should have a grasp on the fundamentals of java before diving into bukkit plugin development

upbeat tusk
#

Yeah and that's why I am continuously suggesting you to leave this project and learn java fundamentals then come back here

quartz pendant
#

Hi! I am confused on using luckperms on a fabric server. Trying to do basic commands to ranks and have prefix displays however after creating the group and adding as parent there is no display in chat

#

seems like the luckperms with all groups doesnt work on my fabric server

main dagger
sturdy quartz
#

Just curious, is it possible to have the fabric mod and include plugin perms when using Arclight? Or in any chance that you can combine the perms from plugins into fabric or vice versa

left geyser
nocturne elbow
#

One message removed from a suspended account.

#

One message removed from a suspended account.

fast delta
#

LuckPerms only stores the lowercase username for storage and lookup purposes

#

it isn't for displaying etc

#

you have the user uuid anyway so you can just get the OfflinePlayer by id and the name from that?

dusty fog
high solar
#

i have a paper plugin that adds/removes permission nodes (that are groups) from players
but for some reason, that information doesnt update on the proxy until i do /lpv user <> info
i havent had any issues with luckperms in general across the network up until coding this little thing, but its meaning that my velocity tab/chat plugins arent updating properly until its force updated

#

any ideas?

turbid solar
#

see pins

high solar
#

ahh okay that works, thankl you

wooden vault
#

how do i set the player's group

#

thru the api

main dagger
#

!cookbook

frank driftBOT
hoary grotto
#

Hello, Is it the right way to set a permission to true with the luckperms api ? Thanks

private void addPermission(String group){
        LuckPerms luckPerms = LuckPermsProvider.get();
        GroupManager groupManager = luckPerms.getGroupManager();
        groupManager.getGroup("group").getCachedData().getPermissionData().getPermissionMap().put("permission.x", true);
    }
#

Is it like that ?

PermissionNode permissionNode = PermissionNode.builder("permission.X").value(false).build();
        groupManager.getGroup(group).data().add(permissionNode);
upbeat tusk
# hoary grotto Is it like that ? ```java PermissionNode permissionNode = PermissionNode.builde...

Yeah but you got to save the group afterwards GroupManager#saveGroup, or you can use GroupManager#modifyGroup which handles it for you. Take a look here > https://luckperms.net/wiki/Developer-API-Usage#saving-changes

hoary grotto
#

yes i just saw that, thanks

main dagger
#

!cookbook

frank driftBOT
wooden vault
main dagger
#

youd have to share code

#

and if there were any errors, share them

wooden vault
#

no errors

#

just wont set

main dagger
#

does it do anything?

wooden vault
#

it wont set the persons rank

main dagger
#

do the messages send? does it clear the previous groups?

wooden vault
#

but it goes thru the code and sends the message

#

no

main dagger
#

dont reply just to ping

wooden vault
main dagger
#

...

#

dont reply just to ping

wooden vault
#

bro

#

its on by default

main dagger
#

ok then turn it off

wooden vault
#

so

#

anyways

#

i cant set ranks

fast delta
#

how are you verifying that?

wooden vault
fast delta
#

wat

#

i mean how are you verifying it is or isn't being set

wooden vault
#

i looked in the players parents

fast delta
#

how

wooden vault
#

/lp user (player) parent info

fast delta
#

and both of those messages are being sent?

wooden vault
#

yes

fast delta
#

do you have any LP event listeners that could be interfering? any other plugins running?

wooden vault
#

not that i know of

fast delta
#

well then, are you listening to any LP event? and what other plugins are running on the server?

wooden vault
fast delta
#

not that i don't wanna try but i know for a fact that that code is not flawed (apart from the Player cast, I'd use getPlayer instead) shrug

#

are you listening to any LP event?
or changing the groups anywhere else, in some bukkit event or whatever

wooden vault
#

thats only for sending the msg

#

and it works

fast delta
#

ยฏ_(ใƒ„)_/ยฏ

#

if you have a minimal reproducer with just lp and your plugin without other stuff potentially interfering (even from within your plugin) then that's worth investigating for sure, but that code you shared right there is WAI

#

just to be sure

#

!paste your LP config

frank driftBOT
#
Please use pastebin!

Seeing a paste of the problem makes everything so much easier! Use https://pastes.dev/ for easy pasting!

For console errors:

Pastebin any relevant segments of the console log. If it's a startup error, this includes the entire startup log!

Other errors:

Pastebin the entire LuckPerms config file (passwords removed) as well as any other relevant files!

wooden vault
#

havent even touched the config

#

how does it work in the lp code

fast delta
#

that's no easy answer, and there are many parts involved in that single snippet as well

wooden vault
#

oh

#

i just wanna look how it sets the group

fast delta
#

yeah it's not super straightforward, but it resolves the parent groups from the inheritance nodes

#

what about /lp user <user> permission info ?

wooden vault
#

hold on

fast delta
#

or better yet, /lp user <user> permission check group.whatever, screenshot that please

main dagger
#

setting primary group doesnt do anything by default

#

but you were asked to send a screenshot of a command output. please do that

fast delta
#

which version of the code does that correspond to ๐Ÿฅด

wooden vault
#

this one

fast delta
#

well, that snippet of code certainly works as it is, so it's something else somewhere (be that some setting in LP or something else in the plugin or some other plugin) that's messing around the wrong way

#

i can't see your entire setup, you could send your lp config and publish your project somewhere on github or similar, but other than that it's on you to debug why really, that's all i can say from just this info

agile fractal
#

Hello Guys ๐Ÿ‘‹๐Ÿฟ

Im trying to add a user a group if he buy it in the ingame rankshop

My Code:

Variables:
LuckPerms api = LuckPermsProvider.get();
User player = api.getUserManager().getUser(p.getUniqueId());

If he buy it:
p.closeInventory();
user.getEconomyAccount().withdraw(250000);
p.sendMessage(prefix + "ยงaDu hast den Kauf erfolgreich abgeschlossen!");
player.setPrimaryGroup("premium");
api.getGroupManager().saveGroup(api.getGroupManager().getGroup("premium"));
api.getUserManager().saveUser(player);
wild whale
#

setPrimaryGroup is no-op with the default config, you realistically shouldn't ever need to call that method.
See the cookbook for an example of how to set a player's group:

#

!cookbook

frank driftBOT
upbeat tusk
agile fractal
upbeat tusk
wooden vault
#

is there any way to access the luckperms common module?

wild whale
#

no, why?

wooden vault
#

because i need to access the files on my plugin load

wild whale
#

what files?

wooden vault
#

the config

#

i need to set a value

main dagger
#

dont change the config

#

if your plugin requires a certain thing to be in the luckperms config, note that somewhere in your plugins documentation or something

solar cedar
upbeat tusk
solar cedar
upbeat tusk
#

actually wait you're using velocity

#

You need to share your code, please paste it in a pastebin

fast delta
#

you need to get it in the proxyinitializeevent, not have it as an @injected field/constructor parameter

upbeat tusk
#

^^

solar cedar
upbeat tusk
#

Velocity's onEnable equivalent is the ProxyInitializeEvent so you should get LuckPerms inside that, idk why LuckPerms assumed you were using spigot in the last quote :p

main dagger
#

it probably says the same thing on every platform

agile fractal
#

!cookbook

frank driftBOT
wheat dew
#

Hi everyone. I'm writing my own server web cabinet and want to get current parent group of user.
I can get it from db, but maybe someone know more better way? Bcs in db table lp_user_permissions saved all player groups as permission

#

and it's hard to manage it

stray zenith
#

Hey there ๐Ÿ‘‹ wanted to ask if there was a chance that a User object can die while the player is still connected to the server?
Or if it may return null or smth at some point

upbeat tusk
stray zenith
#

Yeah that's what I assumed

fast delta
#

!rest

frank driftBOT
#

Sorry! I do not understand the command rest Did you mean latest?
Type !help for a list of commands

fast delta
fast delta
#

that's gonna run on a real LuckPerms instance and will be able to do all of the standard node resolution etc

#

it's pretty nifty

nocturne elbow
# fast delta that's gonna run on a real LuckPerms instance and will be able to do all of the ...

Hello, do you maybe know what loadUser() internally does?

provider = LuckPermsProvider.get().getUserManager();
if (provieder.isLoaded(uuid)) {
    group = provider.getUser(uuid).getPrimaryGroup();
} else {
    provider.loadUser(uuid).thenAccept(...);
}

What would happen if the user is already loaded and I would use loadUser() on it? Would it then just use the getUser() or somehow unload -> load it again?

nocturne elbow
#

Or is loadUser that check doing too?

fast delta
#

or if you don't have messaging set up you can load the user or trigger a full sync manually