#luckperms-api

1 messages · Page 4 of 1

dark robin
#

is there a PermissionExpiredEvent I just can't see?

#

or is there a way of tracking a permission's expiry without running a task myself

turbid solar
#

don't belive there is one

#

can manually check NodeRemoveEvent

dark robin
#

oh

#

yea that works

#

thank you

wicked coral
#

Is there a way i can attach non-persistent permission to an user - meaning permission node that is thrown away the moment player logs off

fast delta
#

yes, you need to add the nodes to the transient NodeMap, I think the method is called transientData()? as opposed to data()?

wicked coral
wild whale
#

like synced cross-server?

wicked coral
#

no, like thread safety

wild whale
#

I'd assume so since LP is built with async in mind, but I don't know for sure, would need to look at the code

#

(iirc in the impl it's some impl of NodeMap stored on a PermissionHolder, but it's been a minute)

wicked coral
#

Im researching whenever it would be viable use lp to check for permission node every time PlayerInteractEvent (clicking on blocks, clicking on entities) is called.

#

or would this use result in too much of overhead.

wild whale
#

should be fine, LP withstands the paper anti-xray permission checks, and PlayerInteract should be less frequent than that check

wicked coral
wild whale
#

yes but iirc it's incredibly frequent even on a single thread

fast delta
#

protocol threads are an absolute no no when it comes to blocking them

nocturne elbow
#

do i just take the top one? or should i use a differnt version

turbid solar
#

use a build tool

wicked coral
#

Could i use the transient data to add a permission group to an user?

fast delta
#

yes

wicked coral
#

which Node type should i use?

fast delta
#

inheritance node

wicked coral
#

.. and its possible to create a transient group that will be exists only at runtime? Group interface seems to have no builder method.

turbid solar
#

no

#

you’d need to manually create & delete it

limber moon
#

So, is there a way for me to tell LP that a specific command can only be run on console?

fast delta
#

LP doesn't deal with commands, it deals with permissions, unknowing where they are coming from

#

So, not really, just, don't grant the permission to players and add a check in the command to prevent players from using it

limber moon
#

Hmm so then I suppose I need to check for console in the command itself?

#

ok

#

thanks

limber moon
#

Quick question, does luckperms store colors for groups? Like, maybe for the prefix or for the group display name or something?

#

or is it just part of the string content?

#

if it's part of the string content, is it using section symbols, or ampersands?

turbid solar
#

luckperms doesn’t parse then

#

your chat plugin does

limber moon
#

damn

#

so the prefix content is just a string and then it gets formatted by the chat plugin?

turbid solar
#

yes

limber moon
#

ok thanks

nocturne elbow
#

can someone send me a yt video on how to import lp api because i am to stuipid

turbid solar
#

!api

frank driftBOT
turbid solar
#

1st link

nocturne elbow
#

Thats what i tried to use but i dont quite understand it. Im new to Java, Bukkit and everything in this envrioment kinda

#

I figured i need to use manual becuase i dont use maven as far as i know

#

but not more

nocturne elbow
#

nvm got it now

vague lodge
#

!help

frank driftBOT
#
Available commands
‎

!advanced
!api
!argumentbased
!ask
!bedrock
!bulkupdate
!bungee
!bungeecheck
!cauldron
!colours
!commandequivalents
!commands
!config
!context
!cookbook
!default
!downloads
!editor
!editorsafety
!errors
!essentials
!extensions
!extracontexts
!faq
!forgepermissions
!formatting
!hack
!helpchat
!inheritance
!install
!libsdir

‎

!locale
!meta
!migration
!notworking
!nowildcard
!offline
!pasteit
!permissions
!placeholders
!reload
!selfhosting
!spongeseven
!stacking
!storage
!suggestions
!switchstorage
!sync
!testingperms
!tracks
!translationprogress
!translations
!tutorial
!upgrade
!usage
!userinfo
!velocitycheck
!verbose
!version
!weight
!whyluckperms
!wiki

vague lodge
#

!hack

frank driftBOT
#
Has LuckPerms been exploited/hacked?

Most certainly: no. In most cases a 'LuckPerms exploit' is a simple case of human error, which can be avoided easily. Look below for some tips to be on the safe side.

Don't give random people full ( * ) permissions / admin permissions

While this should be obvious, a lot of times a exploit can be traced back to faulty permission settings. You should always take your time with permissions and read the plugin documentations. In 99% of all cases the plugins have documentations explaining each permission, in the rare case that the plugin you are using does not have a documentation, you could still:
A: Ask the plugin developer for help
B: Use LuckPerms verbose functionality ( !verbose )
C: Select a different plugin with proper documentation.

Do not run your server/network in offline mode

If you are running your server or network in offline mode, hackers have it really easy to steal your, or any other admins identity. While the server is in offline mode, certain checks ( which exist to prevent exactly this ), are being skipped, and the server does not verify if the person joining actually is the person they claim to be. While there may be plugins which increase the security of offline mode servers by adding things such as admin codes, you should just switch it to online to prevent the issue in the first place.

Do not download plugins from shady websites / sent by friends

You should never put anything on your server which has not been downloaded by yourself from official sources. Plugins can be infected with malware which injects itself into all other plugins, and thus is hard to remove. While it may look like a plugin has been hacked, you most certainly downloaded a modified version of it and it is not the plugin authors fault. In case your server has been infected by such malware:

  1. Stop the server
  2. Delete all plugins in your plugins folder, and just to be safe also the server jar file
  3. Re-Download all plugins and server jar files from official websites such as SpigotMC or official plugin websites ( luckperms.net for example ).
  4. Check if there have been any modifications to the permission system and remove unknown users and wrong permissions.
    if you follow these steps you should have a clean server by the end, without exploits.
steel sand
#

!downloads

frank driftBOT
steel sand
#

!config

frank driftBOT
kindred kite
#

can you trigger an lp sync for a single player?

fast delta
#

yes, see the second latest pinned message

kindred kite
#

I don't know if this is the right place to ask cause the permissions are working, its just the brigadier command suggestions that isn't working. If i type the command out it works just fine. I'm using lucko's fabric-permission-api for managing permissions. I don't know if thats the way to solve this issue tho

fast delta
#

ah, uh, i thought the command tree was refreshed, hm

#

care to share /lp info?

kindred kite
#

this is on a local dev server, thats why theres just one user/group

fast delta
#

darkHmm yeah that should definitely have the command updating thing

#

does it update correctly if you give yourself the permission via console?

kindred kite
#

when i gave myself the permission that i already had it updated the command tree, the same thing happens with /lp sync

#

its working fine now but i can just relog and it'll stop working

fast delta
#

how are you granting the permission exactly?

#

like, in code

kindred kite
#

i'm checking for that permission with just this simple kotlin extension function
which calls Permissions.check from lucko's fabric permission api

fun ServerCommandSource.permission(s: String) : Boolean =
    Permissions.check(this, s)
#

and thats just passed to brigadiers' requires

#
 command("mudarSenha") {
   requires { it.permission("soberana.account.changepassword") }
#

it in that case is ServerCommandSource so that's pretty much code thats directly taken from the lib's examples

#

for granting the permission it is done manually now for testing, but they'll be inside of a group which will be granted later once i can fix this bug that happens with just myself testing

fast delta
#

ah i thought you were giving the permission in code

kindred kite
#

nope, thats just checking for it

fast delta
kindred kite
#

once the player joins, they aren't authenticated and as such the first check fails, but after the log in with their password the command tree isn't refreshed and they land at that state where they can execute the command but it isn't suggested

#

doing /lp sync fixed that, but i don't think its a good idea to resync the entire server every time someone logs in

turbid solar
#

idk how brig works but might need to put it in the same requires block?

#

isAuth && hasPerm

kindred kite
#

hm, i could try doing that, shouldn't take long

fast delta
#

if you're the one doing the authentication, it sounds like you should be the one triggering the update? There's PlayerManager::sendCommandTree (yarn mappings) which is what LP uses when you add/remove perms etc

kindred kite
#

yes i'm the one doing the authentication, thats what i needed, thanks

fast delta
#

cheers

north zephyr
#

Hello! I'm having a problem checking player perms on a specific server from the Bungee network. What's my mistake?

turbid solar
#

what is "s"

north zephyr
#

CommandSender

turbid solar
#

can you send your pom.xml

north zephyr
#

I use Eclipse to develop plugins

turbid solar
#

you need to use the api

#

not luckperms-bungee

north zephyr
turbid solar
#

QueryOptions.contextual(contextSet)

north zephyr
fast delta
#

you don't need to use the context manager

#

you already have the context set you want

#

the context manager is to retrieve the active contexts from a User/(platform player object)

north zephyr
#

Hurrah, it works! Thanks a lot powercas_gamer (Cas) and Emily

spark oyster
#

how to set user to group for a period?

wicked coral
#

How am i supposed to put user into a group.

            Group group1 = SpigotRpgPlugin.getLuckPerms().getGroupManager().getGroup(group);
            user.transientData().add(InheritanceNode.builder(group1).build());

the group exists and is not null,

after this assignment i check user groups via lp editor and only group that the user has is the default one

turbid solar
#

you need to save the user

#

and pretty sure transient data doesn't show anywhere

#

since it'll be deleted awhen the user leaves

#

use data() if you want it to persist

wicked coral
#

transient data are intended here

turbid solar
#

then just save the u ser

#

not sure if it'll show in the editor though

wicked coral
#

saving user even if i just want to modify transient data?

#

sounds weird

fast delta
#

no

#

it will not show up in the editor, that's intended

wicked coral
#

they wont. even with saving.

fast delta
#

yes, they won't show up

wicked coral
#

aaaa i missed the not lol

fast delta
#

you can properly check with /lp user .. permission check foo.bar

#

it won't say it's transient (it probably should), but it will say where it's coming from etc

#

that'd be a nice addition if it showed it was transient

wicked coral
#

im checking stuff via /lp group xxx listmembers, and getting 0 despite im sure the user should have it

fast delta
#

i think listmembers retrieves the data from storage, since it also checks for offline users

wicked coral
#

you were right, i have to check for desired permission. that info view seems to be only thing that is able to display transient group

dark robin
#
            User user = luckPerms.getUserManager().getUser(player.getUniqueId());
            PermissionNode node = PermissionNode.builder("somepermission").build();
            user.data().add(node);
            luckPerms.getUserManager().saveUser(user);
#

is there anything obviously wrong with this?

#

for some reason it sometimes does not give the permission to the player? couldn't reproduce but it 100% does happen

nocturne elbow
#

MC 1.12.2 Paper

Bukkit.getServicesManager().getRegistration(LuckPerms.class).getProvider();

is this always return null after reloaded?

wheat lake
#

!reload

frank driftBOT
#
Using `/reload` or plugman?

Using Bukkit's /reload command causes issues with many plugins, including LuckPerms. If you are adding or removing plugins, you should always fully restart your server.

What about plugman?

Plugman causes all of the same issues as /reload as it is fundamentally doing the same thing as /reload

nocturne elbow
#

how can i store some kind of data on a player

#

a name

#

in my case

#

or to be more precise a player

main dagger
#

meta

spice widget
#

Is there any way to check, how long a players temporary group was set for?

#

Like if they are in a temp group, check if it was set for 30 days, or for 60 days, etc. No matter what time is remaining

main dagger
#

no

spice widget
#

Okay

#

Thank you

main dagger
#

its possible to not specify a duration when adding the group

spice widget
#

Ah true

main dagger
#

also if you use the accumulate modifier, what would it do in that case?

spice widget
#

What is that?

main dagger
spice widget
#

Ah I see

#

That is very true didnt even know about that

#

Thank you

#

That also leads me to another quick clarification. If I only need to check if players are in a certain group or not, I dont even necessarily need the lukcperms API even. I can just use Bukkit's hasPermission right?

main dagger
#

yes

spice widget
#

Awesome thats what I thought

#

Thank you so much!

main dagger
#

groups are just a group.<group name> permission

spice widget
#

Yep 👍

#

Also temp groups and regular groups have the same permission node right? group.<group name>

fast delta
#

yes

feral canyon
#

Hey, is there any way to check the OfflinePlayer group by the UUID?

hoary grotto
#

Hello, how do I cast my player to user please ?

#
        at fr.idaamo.essentials.Listners.PlayerListener.getPrefix(PlayerListener.java:701) ~[?:?]
        at fr.idaamo.essentials.Listners.PlayerListener.enableScoreboard(PlayerListener.java:664) ~[?:?]
        at fr.idaamo.essentials.Listners.PlayerListener.onJoin(PlayerListener.java:55) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_312]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_312]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_312]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_312]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[server.jar:git-Spigot-21fe707-741a1bd]
        ... 14 more```
unreal mantle
hoary grotto
#

oups sorry

#

help pleae

#

please

#

even luckPerms doesn't work

unreal mantle
hoary grotto
#

thanks again

#

I already did it but I didn't use it bruhhh

#

I don't understand how to use it in playerlistener

#

oh good

#

solved

nocturne elbow
#

can someone tell me what im doing wrong

turbid solar
#

restart ur ide

gloomy remnant
#

!extracontexts

frank driftBOT
gloomy remnant
#

!bungeecheck

frank driftBOT
#
Running a network and getting UUID mismatches?

Please double check that:
1. BungeeCord config.yml has ip_forward and online_mode set to true
2. All backend servers' spigot.yml has bungeecord set to true
3. All backend servers' server.properties have online-mode set to false

gloomy remnant
#

!meta

frank driftBOT
gloomy remnant
#

!api

frank driftBOT
gloomy remnant
#

!advanced

frank driftBOT
fallow talon
#

I'm looking to use LuckPerms with Forge but was wondering if anyone had any examples of using it with the Forge PermissionAPI on 1.18.2. I am not quite sure what channel is best for this question so apologies if this is the wrong place.

wild whale
#

are you asking as a server admin or a mod developer? if a mod dev then this is probably the most appropiate channel, if server admin then #support-1 / -2 is usually better

fallow talon
#

I'm asking as a Mod Developer :)

nimble light
#

How can i add a temp rank via the api?

sharp summit
nimble light
#

Via the API

wheat lake
#

!cookbook

frank driftBOT
hoary grotto
#

Hello, I tested everything, I don't understand, I tried to get the group of a player, this player has this group, but the command doesn't work like it has to work. Here is the code:

#
if(!user.getPrimaryGroup().equals("group"))
steel sand
hoary grotto
steel sand
#

Hm

#

I solved my system this way, but you should be able to query it unless you didn't include the Luckperms getter correctly.

    public void addPermission(User user, String permission, long duration) {
        user.data().add(Node.builder(permission).expiry(duration, TimeUnit.DAYS).build(), TemporaryNodeMergeStrategy.ADD_NEW_DURATION_TO_EXISTING);
        luckPermsApi.getUserManager().saveUser(user);
    }```
hoary grotto
steel sand
#

No but so you can query which group he has

#

is also in the docs

fallow talon
smoky forum
#

Hey, does someone know if there's an event triggering when a player's rank expires?

limber moon
#

Can someone tell me if using track#promote will add the user to the first group in the track if they're not in any of the groups?

hoary grotto
steel sand
#

Are you German?

#

Can you speak german

#

?

steel sand
hoary grotto
#

Nah

sour rose
#

Ah can someone help me

#

I wanted to enable the essentials command /ec and just /ec not /enderchest or /endersee
When i add /ec then those two are also automatically added too

sharp echo
#

Please i need help

#

How can i get the expiry time from groups

#

and check them if it is a permanently group or not

smoky forum
#

and to check if it's permanent you can use Node#hasExpiry

smoky forum
#

why don't you just try it?

limber moon
#

Hey so I'm having some issues with the api;

I've made a few wrapper classes for tracks users and groups, and also for user data that I can freely store in local storage; we are using luckperms integration to manage our ranks and permissions, but we are doing it so that we don't break the original functionality of the plugin (this plugin I'm working on has been around for 12 years), used to be true op and legacy hardcode ranks, but this update is trying to fix that with LuckPerms integration. My issue is that we are trying to add a user to the first group on a track, but the way we are doing it is not working.
I thought that simply adding the group Inheritance nodes to the user would be enough, but that doesn't seem to be the case. We are also trying to avoid using User#getPrimaryGroup and #setPrimaryGroup because the user may be on multiple tracks, and inheriting from multiple groups, and we need to get that data as well.
However we also need the users primary group to be of the rank that is the highest from each track they inherit. For example, we have three tracks, op, builder, and admin; op is the default track , with the default group and another group called "op". The admin track has admin and senior admin. If a user is in group op on the op track but also in group admin on the admin track, the admin rank should be their primary group. How could I do this?

#

@sour rose /ec is an alias. You can't enable the alias without also enabling the full command. If you want users to only use the /ec command, you can block usage of the other ones with some sort of command blocker.

sour rose
#

Oh ok but is there a command blocker feature on luckperms

main dagger
#

no

#

and in the future, use correct channels

sharp echo
sharp echo
hoary grotto
forest token
#

Good evening, I've been trying to use the API for a chat plugin; when I try to use the code written on the API Guide to get a user prefix and suffix the method getCachedData() is not recognized, same thing happens when I try to get the user variable with
User user = luckPerms.getPlayerAdapter(Player.class).getUser(player);
luckPerms is not recognized either.

mellow iron
#

hi, how can i get offline player's primary group?
return LuckPermsProvider.get().getUserManager().getUser(uuid).getPrimaryGroup() throws me Caused by: java.lang.NullPointerException: Cannot invoke "net.luckperms.api.model.user.User.getPrimaryGroup()" because the return value of "net.luckperms.api.model.user.UserManager.getUser(java.util.UUID)" is null
uuid is an UUID provided by getPlayer(args[0]).getUniqueId and this player has player before

wild whale
#

!api

frank driftBOT
wild whale
#

getUser only works if the User is loaded i.e. online. If the player is offline, you'll need to load the user instead

#

Note that loading a User is IO and as such should not be done on the main thread

mellow iron
#

got u sir

smoky forum
tacit umbra
#

Hi everyone!
I have the server on Bukkit 1.7.10, and want to use Luckperms api in my server side of modification
How can I use it?
When i try to get User primaryGroup in UserManager userManager = LuckPermsProvider.get().getUserManager().getUser(name).getPrimaryGroup(); i have a Java error:

java.lang.NoSuchMethodError: net.luckperms.api.query.meta.MetaValueSelector.selectValue(Ljava/lang/String;Ljava/util/List;)Ljava/lang/String;                                                                                                       
        at me.lucko.luckperms.common.cacheddata.type.SimpleMetaCache.<init>(SimpleMetaCache.java:88) ~[?:?]               
        at me.lucko.luckperms.common.cacheddata.type.MetaCache.<init>(MetaCache.java:60) ~[?:?]                           
        at me.lucko.luckperms.common.cacheddata.AbstractCachedDataManager.calculateMeta(AbstractCachedDataManager.java:166) ~[?:?]                                                                                                                  
        at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[?:1.8.0_292]             
        at me.lucko.luckperms.common.cache.LoadingMap.get(LoadingMap.java:67) ~[?:?]                                      
        at me.lucko.luckperms.common.cacheddata.AbstractCachedDataManager$AbstractContainer.get(AbstractCachedDataManager.java:202) ~[?:?]
        at me.lucko.luckperms.common.cacheddata.AbstractCachedDataManager.getMetaData(AbstractCachedDataManager.java:90) ~[?:?]
        at me.lucko.luckperms.common.api.implementation.ApiUser.getPrimaryGroup(ApiUser.java:74) ~[?:?]```


I am using LuckPerms api 5.4, could you help me?
#

I tried to use it in server side of my forge modification

turbid solar
#

screenshot /lp info

tacit umbra
turbid solar
#

!update

frank driftBOT
turbid solar
#

!latest

frank driftBOT
#
Latest version

5.4.71

tacit umbra
#

Ok, just a moment

#

It works, thanks!

turbid solar
#

show code

#

are you soft depending on LP

#

get the api in the constructor

night pier
#

Open your jar and see if it’s bundling LuckPerms with it

fast delta
#

when/where are you calling the CMD constructor? in onEnable? or where

night pier
#

don’t shade LP into your jar.

#

Are you using maven

#

I’ve been there unfortunately ;-; ||big thanks to @fast delta for that one||

fast delta
#

language !

main dagger
#

assuming your on bukkit, just do Player.hasPermission('group.<group name>')

hoary grotto
#

Doesn't work too

#

That's also what I don't understand

main dagger
#

what about it doesnt work

hoary grotto
main dagger
#

what is your code

hoary grotto
# main dagger what is your code
RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
                if (provider != null) {
                    LuckPerms api = provider.getProvider();
                    this.api = api;
                }
                Player player = (Player) sender;
                User user = api.getUserManager().getUser(player.getName());
                if(!user.getPrimaryGroup().equals("group"))
                {
                    player.sendMessage("§cErreur: Vous devez ĂȘtre au minimum §aPremium §cpour exĂ©cuter cette commande !");
                }else{
                    if(player.getGameMode().name().equalsIgnoreCase("creative"))
                    {
                        player.sendMessage("§cErreur: Vous ĂȘtes en mode crĂ©atif !");
                    }else {
                        if (isFlyingSet) {
                            player.setAllowFlight(false);
                            isFlyingSet = false;
                            player.sendMessage("§aVous avez désactivé le fly au lobby.");

                        } else {
                            player.setAllowFlight(true);
                            isFlyingSet = true;
                            player.sendMessage("§aVous avez activé le fly au lobby.");
                        }```
turbid solar
#

is their primary group "group"?

hoary grotto
turbid solar
#

screensbhot /lp user <user> info

hoary grotto
turbid solar
#

do /lp not /lpb

hoary grotto
turbid solar
#

that code is on bukkit

hoary grotto
#

so I have to type lp ?

turbid solar
#

yes

#

that's what i asked

hoary grotto
#

bruh

main dagger
#

why are you hiding your minecraft account details kekw

hoary grotto
main dagger
#

its still not sensitive info lol

hoary grotto
#

ik

limber salmon
#

Hello, I can't put luckPerms on bungeecord, I searched on several forums, but nothing, can someone please help me i can't do it...

turbid solar
#

!download ?

frank driftBOT
radiant spear
#

Is it possible to make a permission node expiry time go down only if a condition is met and otherwise stay the same?

hoary grotto
hoary grotto
young umbra
#

Hey ya'll I am trying to use the api I have added it to my pom depenedices then did the following and can't get the api to load. (Using Intellij)

young umbra
#

If someone could @ me that be great if they got an answer

hybrid panther
#

Does it give you option to import LuckPerms class when you hover it

young umbra
#

ooo im so silly

#

I thiught i reloaded i didnt

#

my bad yall

strange swallow
#

Guys can i ask how to make ranks

#

Idk how to make

turbid solar
#

with the api?

worldly pebble
#

Is there any possible way to get an offline player to use within a bungeecord plugin? I want to use it with the LuckPerms API in case a target player is offline, but the OfflinePlayer class is only available within Bukkit.

fast delta
#

you can get a User from their UUID via the UserManager

#

if the player is offline, you'll have to load it

worldly pebble
#

Is there a way to get the User from a username? I'm running an offline server

fast delta
#

you can lookup the uuid for a username in the UserManager too, then get the user from the uuid

#

lookupUniqueId I think?

worldly pebble
#

I'll have look, thank you.

coarse hawk
#

is there a listener when the group of a user changes?

unreal mantle
coarse hawk
#

Okay

#

Thanks

coarse hawk
sharp echo
#

Hello, anyone know how I get the Address from a Player that is offline?

#

or the last address with the user has connected?

#

I have these 2 methods but I need a method to get the Address

public final UUID getUserUUID(String userName) {

        UserManager userManager = api.getUserManager();
        return userManager.lookupUniqueId(userName).join();

    }

    public final String getUserName(UUID uuid) {

        UserManager userManager = api.getUserManager();
        return userManager.lookupUsername(uuid).join();

    }
sharp echo
#

User Address. IP-Address

#

I think i have the right method

#

but thank you

unreal mantle
#

You cannot get the users ip address with the LuckpermsAPI

sharp echo
#

no?

unreal mantle
#

No.. Luckperms does not care about IP addresses

sharp echo
#

oh

#

i need it for my ban system.. :c

#

i find another way to get the address

#

thank you

unreal mantle
#

YOu can use the normal SpigotAPI for it I am pretty sure.

sharp echo
#

no i use a database to save the address and get it back

unreal mantle
#

No, you can get the Players IP Address from the SpigotAPI

sharp echo
#

I need it in Bungeecord

unreal mantle
#

Then use the bungeecord api for it

sharp echo
#

And i have a /ip command for online player ip's. If i create a new database I can update the command

sharp echo
unreal mantle
#

Well this is not a Luckperms API issue

hoary grotto
#

Hello, my group wont set:

#

api.getUserManager().getUser(user.getUsername()).setPrimaryGroup(rank);

#

no error

#

and rank is good

unreal mantle
#

Are you saving the user?

hoary grotto
#

oh

#

no

#

bruh

unreal mantle
hoary grotto
#

still no

unreal mantle
#

That should be after you make any changes

hoary grotto
#

i'm still owner

unreal mantle
#

!paste the full code

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!

hoary grotto
#
                api.getUserManager().getUser(user.getUsername()).setPrimaryGroup(rank);
                api.getUserManager().saveUser(user);```
#

do you have an idea why this doesn't work ?

unreal mantle
#

Use some debug messages to see where the code stops executing or if the If statement is even executing at all

hoary grotto
#

the prefix changes so the code has passed the "setgroup"

#

so you have an idea?

hoary grotto
#

?

hoary grotto
#

hello, I have the same problem, but what do I put in the parentheses of equals ?

daring sandal
#

it is a string.

hoary grotto
#

what ?

#

yeah but what do I put ?

#

a group ? what ?

daring sandal
#

¯_(ツ)_/¯

#

I can't read minds

hoary grotto
daring sandal
#

I still can't read minds

hoary grotto
sharp echo
#

will this work for getting a offline user?

public final User getUser(UUID uuid) {

        UserManager manager = api.getUserManager();
        return manager.getUser(uuid);

    }
sharp echo
#

it does not work

#

how can I get a Offline User

#

in bungeecord

#

from luckperms

raven badge
#

how works CachedMetadata#getPrefixes()??
returns every prefix from every rank? or just specific ones based on a other specific configuration?

unreal mantle
raven badge
unreal mantle
#

By that it means, all prefixes that the group or user has access to

raven badge
#

I want to get all the prefixes of specific ranks.
something similar to prefix stacking but limited to certain ranks

unreal mantle
#
Group group = luckperms.getGroupManager.getGroup("owner");
StoredMap<Integer, String> groupPrefixes = group.getCachedData().getPrefixes();
#

That will make groupPrefixes be filled with all the prefixes that group has, along with their prefix weights

raven badge
#

thanks.

fast delta
#

what

left geyser
#

This is not #luckperms-api related.

Use one of the support channels instead and explain what you want to do.

ocean geyser
#

sorry

feral canyon
#

Hey, is there any way to get the Update Event from a Offline Player that have a temp group?

main dagger
#

no

#

at least i doubt it

#

expiry time is stored as "this permission expires on this day at this time" and not "this permission expires in this many seconds"

#

so it wont remove the node at least until the user is loaded

main dagger
#

for what...?

grizzled spruce
#

Can I change this block of code from group. to permission. to check for a specific permission? (IE: myplugin.mypermission)? I just need to check if a user has a specific permission before running a block of code in the PlayerJoinEvent.

public static boolean isPlayerInGroup(Player player, String group) { return player.hasPermission("group." + group); }

unreal mantle
#

If you want to do a simple permission check, just use player#hasPermission(<permission>)

grizzled spruce
#

Yep, I see. And to do a simple permission check, I technically don't need the LuckPerms API in my project, do I? Or do I need to include LuckPerms in my project in order for it to over-ride permission checks?

unreal mantle
#

You don't need the LP api if you just want basic permission checks as the Player class has the hasPermission()

swift cairn
#

halp

#
package club.crestmc.neptunecarbonbukkit.commands.ranks

import club.crestmc.neptunecarbonbukkit.NeptuneCarbonBukkit
import net.luckperms.api.context.DefaultContextKeys
import net.luckperms.api.model.group.Group
import net.luckperms.api.model.user.User
import net.luckperms.api.node.Node
import net.luckperms.api.node.NodeBuilder
import net.luckperms.api.node.NodeType
import net.luckperms.api.node.types.InheritanceNode
import org.bukkit.OfflinePlayer

class RankManager(val plugin: NeptuneCarbonBukkit) {
    fun setRank(name: String, player: OfflinePlayer, user: User): String {
        System.out.println("debug 1")
        val group: Group? = plugin.luckPermsAPI.groupManager.getGroup(name)
        if(group == null) {
            return "INVALID_RANK"
        }

        for (g: Group in user.getInheritedGroups(user.queryOptions)) {
            user.data().remove(Node.builder(g.name).build())
        }
        user.setPrimaryGroup(group.name)

        plugin.luckPermsAPI.userManager.saveUser(user)

        return "SUCCESS"
    }
}
``` why is this just adding the rank and not setting the parent to it
#

if i set parent to default with this

#

it just doesnt do anyhting

main dagger
#

setting the primary group doesnt add the group to the user

swift cairn
#

oh

#

ic

raven badge
#

I am doing something wrong?

I am trying to get the contexts using the cached data. The permission does give it to me but the contexts don't, even obtaining the list of all gives me the empty list
perm is readed. i can check if have the permission, access to the node, but all contexts are always empty

umbral bough
#

I'm looking through the API and trying to determine whether it works exclusively with "minecraft" users, or if something like LP standalone could be used for non-mc uuids. At first glance I don't see why I wouldn't be able to create users from my own uuids, but i'd just like to make sure.

#

Usecase is checking permission for users outside of the game, for example interacting through discord or on a website

#

okay... im realizing now that this would probably cause permission checks on the server to not work because the uuid doesnt match the minecraft account

fast delta
#

A User is just identified by a UUID, it isn't specifically restricted to Minecraft IDs only

umbral bough
#

thats also what i initially thought

fast delta
#

LP keeps a cache for Username → UUID, there are lookup methods in the UserManager to find username/id by a id/username

umbral bough
#

but doesn't LP check permissions against mojang uuids in game?

#

well

fast delta
#

LP doesn't care about a UUIDs integrity

#

it's just an object it uses to identify permission holders

umbral bough
#

okay, so lets say I have a "User" table, which isnt related to MC at first

#

i give the user a permission based on the pk of that table in LP

#

how would LP in game find out about the permission nodes set to the original user

fast delta
#

"LP in game" doesn't really mean anything, if you mean a Bukkit Player it will use their UUID as source, if you check a permission via the API you need to pass a UUID to get/load a LuckPerms User, etc

umbral bough
#

well im talking about other plugins

#

just general MC permission nodes

fast delta
#

right but against what is a permission being checked? LuckPerms can't guess an ID it can't source

#

Somewhere in the creation of a User, regardless of platform, regardless of source, a UUID is passed to LuckPerms

umbral bough
#

right

fast delta
#

There is no concept of "Mojang ID" either, see for example the UUIDs Geyser/Floodgate gives to bedrock players, those aren't "valid", but they'll work fine

umbral bough
#

Let me try to give some more context here

#

Trying to set up a unified user account/permission system across e.g. website, discord and mc

#

so lets say I have a Users table, and LP stores permissions for me

#

against the primary key (uuid) of that table

#

which is not related at all to a mojang uuid

#

now I give the user some permissions, and LP stores those permissions

#

after being registered already on the website, the user joins the mc server

#

and the accounts are linked

#

so now you have a global Users table and a GameUser table

#

GameUser keeps a reference to globalUserUUID

#

now, how does LP check in-game permissions against the original table?

#

an action is performed in-game which is attached to a mojang uuid. I now need to provide LP the UUID it knows (from my Users table) based on the in-game uuid

#

so that it can check the permission for the in-game action

fast delta
#

Inside the game, at login, LP will get the UUID from the game Player/ServerPlayer/ProxiedPlayer obect and load a User from the database from the table luckperms_user_permissions with that ID, that is the UUID that will be used if you have LuckPerms installed in a Minecraft server, and if you use the platform's own permission API, that's what will be used

LuckPerms won't reach out to some random table it doesn't know about to get some ID based on another ID, like I said before

Somewhere in the creation of a User, regardless of platform, regardless of source, a UUID is passed to LuckPerms
and, inside the game server, the player login process is the source of the UUID, if you use the API directly you are the source of the UUID, but different UUIDs are different Users

LP doesn't exclusively use "Mojang UUIDs", but if you want to perform some kind of cross-platform permission bridging and you want to also preserve the in-game "nature" of permission checks with that same bridging, you will need to keep your own table mapping from the other platform's ID to the UUID of their Minecraft player (which may or may not be provided by Mojang, see offline mode or Geyser/Floodgate UUIDs), and whenever you perform a check in the other platform, lookup the Minecraft UUID from the other platform's ID, get the User and check that

umbral bough
#

before i get into the details - thanks for spending that time helping :)

#

the typing... message went on and off for like 20 minutes on my other monitor

fast delta
#

(it's been that long?)

umbral bough
#

almost 😅

#

you will need to keep your own table mapping from the other platform's ID to the UUID of their Minecraft player (which may or may not be provided by Mojang, see offline mode or Geyser/Floodgate UUIDs), and whenever you perform a check in the other platform, lookup the Minecraft UUID from the other platform's ID, get the User and check that

yes, this would also work but will require the user to log in with mc first basically

#

the whole thing would be based off the minecraft account essentially

#

which... I guess is possible

#

I wanted to keep it quite game agnostic actually which is why I was trying to avoid doing it that way

#

considering this

LuckPerms won't reach out to some random table it doesn't know about to get some ID based on another ID
the only way to really achieve this is to hijack the impl/platform and pass the login event to LP myself with the transformed UUID

#

which is very questionable at best

fast delta
#

at that point I'd recommend just forking luckperms lmao

umbral bough
#

I did think about that 😂 - had to end up doing that for brigadier

#

but thats much smaller

fast delta
#

as a silly graph calculator and storage system, LP is pretty platform agnostic but trying to cross-reference IDs from other platforms was certainly not in the design plans

umbral bough
#

i'll have a play around with the code to see if anything remotely PRable comes out of it

#

i want to avoid forcing people to use my custom fork

covert pasture
#

Is there a way I can set a rank to be applied when another one expires? Some players end up having no rank:
Join -> Rank expired -> no rank -> rejoin -> default

#
        return this.plugin.getLuckPerms().getUserManager().modifyUser(player.getUniqueId(), (User user) -> {
                    user.data().clear(NodeType.INHERITANCE::matches);
                    user.data().add(InheritanceNode.builder("titan")
                            .expiry(millis, TimeUnit.SECONDS)
                            .build());
                }).thenApply(unused -> new TitanRankResult(TitanRankResult.ResultType.RANK_ADDED))
                .exceptionally(t -> new TitanRankResult(TitanRankResult.ResultType.ERROR, t.getMessage()));
fast delta
# raven badge I am doing something wrong? I am trying to get the contexts using the cached da...

getPermissionData() will only contain permissions that "pass" the user's current active contexts, not all permissions (if the context doesn't match, it won't be included)

There is getPermissionData(QueryOptions), you can pass QueryOptions.nonContextual() to not apply said that kind of filtering, ...getPermissionData(QueryOptions.nonContextual()).query...; but keep in mind that queryPermission will only give you the "most matching" permission as per https://luckperms.net/wiki/Advanced-Setup#permission-calculation

But also, are you using contexts as data storage? Because that will affect when the permission is applied and such; context is used for filtering, not for storage; there are MetaNodes for arbitrary storage but they are their own permissions altogether

fast delta
covert pasture
#

btw does luckperms check for expiries every second or just when they join or are online during expiry?

fast delta
#

if the user is loaded (player is online or was loaded via api), it checks every 3 seconds i think

#

if it isn't it will be checked when it's loaded (login or api loadUser)

#

i guess some commands might trigger that too?

covert pasture
#

ic

#

thank you very much <3

fast delta
#

np

raven badge
#

And yes, I am using the context as a data store. More than anything because the nodes only return true or false and I really don't want to do weird things with RegExp :/

fast delta
#

Yeah you should be using MetaNodes instead, see the API Usage page on the wiki, the section about storing/retrieving custom metadata

#

Sounds like it's exactly what you need

raven badge
#

metanodes values can be editable in the editor?

raven badge
#

i'm still no get how to modify metanodes

unreal mantle
#

A meta pair, favourite-color = red would translate into the permission: meta.favourite-color.red

raven badge
#

oh, i see... thanks

#

do the metanodes have to be added to a registry or something? more than anything because they do not appear when i want to edit them

unreal mantle
#

You have to add them manually I am pretty sure. Then it's upto the other plugin to use the meta

raven badge
#

It makes it a bit annoying for the user, but it works. thanks!!

scarlet drum
#

Hi, how can I get an offline user by his name?

nocturne elbow
#

How can I get all groups that exist?
And how can I get the weight of the group?

vivid flower
nocturne elbow
#

over the API I mean

vivid flower
#

Oh, sorry. I thought it was the other channel

vivid flower
# nocturne elbow over the API I mean

You can use the GroupManager class and call the #searchAll method. It requires a NodeMatcher. You can filter all the groups with a weight set.

I'm on my phone rn so it's a little difficult for me to write the code

night pier
#

Why do you need to get an offline player for that?

#

there's no situation where a player will be offline, if they're running the command themselves.

vivid flower
#

I also don't think that's LP related. Use #general

nocturne elbow
#

How can I sort the Players in my Tablist with the weight of there group?

left geyser
nocturne elbow
rapid isle
#

Where is the salon with all the command ?

fast delta
#

tablist is sorted by the client, first, players in spectator mode always go last, then they are sorted by team name (lexicographically) and then by player name (also lexicographically)
so you'd assign teams to players after the group they're in, and the team would be named in such a way that the ordering would follow the group weight

nocturne elbow
fast delta
#

yes

nocturne elbow
#

Do you know how I can get this to work?

scarlet drum
weary plinth
#

Hi !
I need help with the LuckPerms API, in fact, I made a shopping plugin and I want to assign the player his rank when he has made his purchase but I don't know how...

nocturne elbow
winged lion
#

Hello there. I'm trying to search an user based on his username using the Luckperms REST API, but the result is always empty.
I'm using this params {"key": username, "type": "display_name"} while calling the /user/search route, using GET.
Does anyone have an working example?

#

please tag when replying, I have too many servers :p

fast delta
fast delta
winged lion
#

but also, you don't give it a json, you pass query params (and only one of them)
I took only a snippet from my actual code so that's why it seems to be a JSON, I'm passing this as an object to requests.get in py

#

so there's no way to search an user based on his username? :(

fast delta
#

i don't think there is, no

raven badge
#

Forge have a permission api and includes nodes with integer and string as values
that node values can be editable with luckperms (using web editor or comamnd editor)?

raven badge
weary plinth
#

Hi !
I need help with the LuckPerms API, in fact, I made a shopping plugin and I want to assign the player his rank when he has made his purchase but I don't know how...

unreal mantle
scenic shore
#
            p.sendMessage(Lavori.format("&cNon lavori in questa azienda."));
            return;
  }

  if(Groups.isPlayerInGroup(target, work)){
        p.sendMessage(Lavori.format("&cIl cittadino indicato fa giĂ  parte                della tua azienda."));
        return;
  }

  UUID uuid = target.getUniqueId();
  Groups.addPermission(uuid, work + ".dipendente");
  p.sendMessage(Lavori.format("&aHai assunto il cittadino &a" + target.getName() + " &anella tua azienda."));
  p.sendMessage(Lavori.format("&aSei stato assunto nell'azienda &e" + work + " &acome dipendente.\n" +
               "&eSe pensi che si tratti di un errore, usa il comando" +
                "&f&l/lavoro &7licenzia " + work));```
#

hi, i'm developing a work system, in the "assume" command i created the Groups class in the "utils" package, where i inserted the "isPlayerInGroup" method, but it returns the error message where it says "Groups.isPlayerInGroup(target, work)"

#

that is, that the indicated user is already part of the company indicated in the command

unreal mantle
#

Wait so what is it issue? It's not detecting the user in the group or?

scenic shore
#

i think it detected it, so the first condition checks it "!Groups.isPlayerInGroup(p, work)", after that it doesn't check it anymore "Groups.isPlayerInGroup(target, work)"

#

that is, even if he doesn't have the group, he still claims to be part of that company

unreal mantle
#

!paste the full class where the code is

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!

scenic shore
#

public static boolean isPlayerInGroup(Player player, String group) {
return player.hasPermission(group + ".direttore");
}

if it could help you

unreal mantle
#

I think that has permission is wrong. It should be hasPermission("group." + group)

#

As you pass the group name in as a group variable.

scenic shore
#

but on the LuckPerms wiki it tells me to do this

unreal mantle
#

Group permissions are always group.<group name>

#

hasPermission("group." + group) is the best way to check.

#
if(!Groups.isPlayerInGroup(p, work)){
            p.sendMessage(Lavori.format("&cNon lavori in questa azienda."));
            return;
  }

This will then check if the user has group.work which basically checks if they have the group work

scenic shore
#

i solved

#

they were 2 different groups, one had to check if it had the "manager" group, the other if it had the "employee" group, i was checking them in the same group

#

thanks

celest acorn
#

is there any existing way to run a standalone LuckPerms inside another java application?

#

so it would basically be a standalone luckperms api implementation, the startup process of which is initiated by other code, plus disabled console input

woeful pelican
#

Hello, I was wondering if anyone can see any reason why players might be keeping their previous group when ranking up in my plugin? I have yet to be able to reproduce the issue. I just know that sometimes when a player tries to rankup their money is taken but they are not given the next group in the track, and when I go to check their groups they have 2 or 3 groups in the same track

Here is my code that handles all of this: https://paste.insprill.net/MBXLm

scenic shore
#

hello, i created a track of groups, I'm creating the command "/job promote <job> <user>", but in the wiki i can't find anything that explains how to use the Tracks

#

can you help me?

scenic shore
#

:/

main dagger
#

when someone who knows how to help is available, they will answer

#

until then, you will just have to wait patiently

woeful pelican
scenic shore
#

ok ok i solved

#

so, i have a question

#

how do i check if the user has reached the maximum roles? the code used does not work

#

i'm talking about tracks

#

or this code

        List<String> trackGroups = track.getGroups();

        if(primaryGroup.equals(trackGroups.get(trackGroups.size() -1))){
            p.sendMessage(Lavori.format("&cIl lavoratore indicato ha giĂ  raggiunto il massimo dei ruoli registrati nell'azienda."));
            return;
        }```
#

oof 😩

fast delta
#

Pretty sure Track#promote returns some useful value you can use

scenic shore
#

yes i used the promote() method, but i can promote up to a certain point because there is a limit, the promotion works, i just have to make sure that if it has the maximum role but continues to "promote" then the must return an error

fast delta
#

Yes, and the return value of the promote method is useful for you to identify and send the error

slender pagoda
#

heyo, im trying to get the prefix of a user through the proxy on one of the connected servers, how could i go about doing this?

Edit: I got it getting the user’s prefix, now I need to get the user’s group prefix (the one that displays on the user when chatting) + parsing color codes

timid apex
#

Might be more like change &6 to <GOLD>

covert pasture
#

How do i save the data here ? I do not receive any User or Player or UUID object..

scenic shore
slender pagoda
#

Also, is there a way to get the highest weighted group of a user?

timid apex
#

@slender pagodaMy server has been setup for years and weights group prefix are good, just want to update the color codes in many of my meta tags and group prefix's

slender pagoda
#

???

rose turtle
#

Ola, is there a way to get players group without inherited ones? hasPermission obviously returns all groups below, i want to check only if player has that one specific group

low trout
#

This is what I have for getting the new group when I add it to a player, is there a way to get the primary group of that player before the new group applies? (the event needs to fire with /lp user userName parent add groupName )

low trout
#

I think it would be smart if I remove the new group, get the primary group, then add it back.

low trout
#

It might be bad, I don't know but that's how I made it work.

lyric minnow
#

Heya, using 'net.luckperms:api:5.4' on Fabric (1.19.2), and came to an issue I'm not used to on other platforms. Using LuckPermsProvider.get().getPlayerAdapter().getPermissionData(serverPlayerEntity).checkPermission(permission).asBoolean() (simplified) on a player for some.permission.child is true when some.permission is, even though some.permission.child is undefined, forcing users to negate the permission. Is there a way around this? (Other than changing some.permission to some.permission.base)

wooden vault
#

Does anyone know how to setWeight using the luckperms api?

nocturne elbow
nocturne elbow
#

help ‎

rancid condor
#

when is safe to call LuckPermsProvider.get()?

#

currently im calling it on mod init

lyric minnow
fast delta
# nocturne elbow

toInheritanceNode is not a method that exists, but you have a stream of InheritanceNodes already so that'd achieve nothing really

fast delta
lyric minnow
#

ah lmfao ty

nocturne elbow
young umbra
#

Hey ya'll I am trying to have luckperms load before my plugin and put it in the depend section of the spigot.yml do I just put [LuckPerms] or is it [luckperms] [lp] or what. Feel free to @ me

unreal mantle
#

depend: [Luckperms]

young umbra
#

Thank you!

young umbra
#

Okay that didnt work haha

#

LuckPerms did the trick

whole siren
#

hi how do i use the editor

vivid flower
wheat veldt
#

Is there ever a time where this would return blank? ```java
Group group = this.main.luckPerms.getGroupManager().getGroup("groupname");
return Utils.chat(group.getCachedData().getMetaData().getPrefix());

assuming the group does exist and has a prefix?
#

basically I am using this as a placeholder, and sometimes for some players, it is literally just returning blank lol

unreal mantle
#

For the people that it returns blank, does it return blank from other sources such as lp user <name> info?

wheat veldt
#

No, they have the group, and the prefix shows up in lp user <name> info aswell

#

actually

#

i know the problem sorry

#

stupid programming error

unreal mantle
#

Ah okay

wheat veldt
#
if (identifier.startsWith("donorprefix")) {
} else if (identifier.startsWith("donorprefix_forced")) {
#

see the problem here Facepalm

main dagger
#

pretty sure ive done that before

unreal mantle
#

Pretty sure we all have.

midnight anvil
#

i get this error when i try to build my Plugin

turbid solar
#

you're using outdated api

midnight anvil
#

i am using 5.4

fast delta
#

LuckPermsAPI does not exist anymore

#

See:

frank driftBOT
midnight anvil
fast delta
#

5.0

vivid flower
nocturne elbow
#

How can I get the Priority of a group for my tablist plugin?

turbid solar
#

d;lp Group#getWeight

slate deltaBOT
errant sigil
#

does the .setPrimaryGroup() function work?

if not is setting a group node the best way to go around this.

fast delta
#

it works but it doesn't do what you're wanting to do most likely, the primary group (by default) is calculated automatically by group weight (so configuring weights is how you determine the primary group), adding an InheritanceNode is adding a parent group

errant sigil
#

something like this?

InheritanceNode node = InheritanceNode.builder(groupname).build();
user.data().add(node);```
turbid solar
#

need to save the user but yes

errant sigil
#

okay thanks

#

that makes sense

muted acorn
#

can someone help me and tell me how can i get color of prefix that user has
luckpermsApi.getUserManager().getUser(player.getUniqueId()).getPrimaryGroup();
i got his primary group
but i need color of that group
yk
?

main dagger
#

groups and prefixes dont have colors

#

it may include special formats that are parsed by a chat plugin or tablist plugin, but neither the group or prefix has a color as far as luckperms is concerned

errant sigil
#

so im trying to promote a user along a track. firstly am i going about this right?

track.promote(user, ...);```
secondly, what is the ContextSet param?
im not sure i understand it
devout sapphire
night pier
#

okay? What does this have to do with the API

wheat veldt
#

Is there a way to check if a player is in a group but not an inherited group?

#

like

#

player could be in Rank6, but rank 6 inherits rank1 to rank5 right

#

what if I want to check if they are in rank3? I couldn't just check their groups right because wouldnt that be true even if they were in rank6 aswell?

#

Like if somebody was in Rank6. and Rank6 inherits Rank 1 to Rank5. user.getInheritedGroups() would return ranks 1 to 5 too right

wild whale
#

d;lp PermissionHolder#getInheritedGroups

slate deltaBOT
#
@Unmodifiable @NonNull
Collection<Group> getInheritedGroups(@NonNull QueryOptions queryOptions)```
Description:

Gets a collection of the Groups this holder inherits nodes from.

If Flag.RESOLVE_INHERITANCE is set, this will include holders inherited from both directly and indirectly (through directly inherited groups). It will effectively resolve the whole "inheritance tree".

If Flag.RESOLVE_INHERITANCE is not set, then the traversal will only go one level up the inheritance tree, and return only directly inherited groups.

The collection will be ordered according to the platforms inheritance rules. The groups which are inherited from first will appear earlier in the list.

The list will not contain the holder.

Since:

5.1

Returns:

a collection of the groups the holder inherits from

Parameters:

queryOptions - the query options

vestal cargo
#

Hello, I am trying to get the prefix of a group without a player. Is this possible?

vestal cargo
#

nvm, found a method

public String getGroupPrefix(String group) {
    Group groupT = api.getGroupManager().getGroup(group);
    return groupT.getCachedData().getMetaData().getPrefix();
}
main girder
fast delta
#

yep

jaunty valley
#

Hi! How can I create a group(!!) through code if luckPerms.getGroupManager().getGroup("Whatever") == null ?

#

Should I use GroupManager#createAndLoadGroup ?

#

or smth

turbid solar
#

yes

jaunty valley
#

thx

jaunty valley
#

How can I remove an entire group from player?

main dagger
#

remove the group node from the player

weary dust
#

hello how can i get a user in a join event

night pier
#

Do you know how to get the player from the join event?

weary dust
#

yes but i need the luckperms user

night pier
#

Yeah I’m fully aware.

weary dust
#

thx

#

intellij say Cannot resolve symbol 'luckPerms' what can i do

night pier
#

have you added LuckPerms to your project, and got an instance of the API?

weary dust
#

yes

night pier
#

send your full class, plus Main class in a pastebin

#

!paste

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!

weary dust
#

i have it fixt

viral lava
#

I got an issue with my server

#

When I gave my friend a role

#

It didnt let him perms to open chests and doors

#

anyone can help me out?

#

but I could do it since I got op

viral lava
#

oh I dont see it

#

Sorry

vivid plover
#

What's the difference between using CachedData to perform a permission check vs what bukkit calls (which I'm assuming doesn't call CachedData?)
LP docs say that it's very fast, but what makes it so fast?
And are there any downsides to using it?

fast delta
#

hello dkim one nine three seven five

vivid plover
#

hello Emily!

fast delta
#

What's the difference between using CachedData to perform a permission check vs what bukkit calls?
LP's bukkit Permissible uses the cached data behind the scenes
https://github.com/LuckPerms/LuckPerms/blob/84bd2ee52abbed9624e72435c37fe6fcc3439a8d/bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/permissible/LuckPermsPermissible.java#L166C1-L174
but the whole bukkit permission system is non-ideal and in some situations has some unavoidable overheads (namely, adding/removing/registering permissions via bukkit api)

but what makes it so fast?
not an easy question to answer :') but at the very most basic level, heavy caching and precalculation

And are there any downsides to using it?
not really

vivid plover
#

Although it says

If you're doing frequent data lookups, it is highly recommended that you use CachedData over the methods in User and Group.
so does User/Group fetch directly from the database?

I'm trying to make a prestiging system which is based off of permissions, but I'm not sure if having like 1000 permission checks for example is ideal, especially if there are PAPI placeholders being used
Should I just store the data myself instead of using permissions? And then the server owner can also add their own permission group if they want to do like a prestige-only thing

fast delta
#

what methods in User/Group? thonk

#

but to answer that question, no, the data is in-memory, it's just that the whole inheritance tree etc etc is pre-calculated in the CachedData

#

I guess that means "put the CachedData in a variable instead of recreating it every time"? idk lol

turbid solar
#

no

#

why

#

install luckperms to your local maven repo

turbid solar
#

add the maven publish to common module

#

there’s probably a better way to do all this though

long karma
#

Why is the user still null after 5 minutes on the network?
User user = api.getUserManager().getUser(playerName);
Also, new players are not displayed at /lp editor

turbid solar
#

where are you executing that code and where is the player

sturdy badger
#

I'm being a bit overwhelmed with the amount of features in the api.
I decided to depend on it because I needed a way to get permissions of offline players (which seems to be not viable via spigot api, but if you do know how, I would appreciate that too.)
So, I just have a player uuid and a string permission node such as "foo.bar".
What would be the appropriate way of checking if a player (who could be offline) has the permission.
I read the wiki on api usage and and ended up with code like this

CompletableFuture<User> userFuture = userManager.loadUser(UUID.fromString(playerUuid));
userFuture.thenAcceptAsync(user -> {
    Optional<Node> node = user.resolveInheritedNodes(QueryOptions.nonContextual()).stream().filter(n -> n.getKey().equals(permissionNode)).findFirst();
    if (node.isPresent() && node.get().getValue()) {

Which does seem to work fine.... most of the time....
Sometimes after the filter there are no nodes left and the check is falsy even though it should be truthy

fast delta
sturdy badger
#

welp, should have read further into the api usage i guess
that does indeed look simple and effective.

sturdy badger
#

even then the api seems to sometimes return the wrong value

#

I'm checking the permissions really often- like tens of times a second- could that affect anything

charred nest
#

Hello, I have a problem on my bungeecord plugin, I can't check the prefix of the player with the luckperms api, if someone could help me.

vivid flower
#

!ask

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?
vivid flower
#

What’s your current code?

#

@charred nest

charred nest
#

j'ai ça cdans mon pom.xml

#

un main class

#

and I don't know

turbid solar
#

use 5.4

#

!api

frank driftBOT
turbid solar
#

!cookbook

frank driftBOT
turbid solar
#

read the wiki

nocturne elbow
#

@everyone

foggy gull
#

think of your grammar.you german^

rapid delta
#

is there any way to see when plugins call the api? I am having an issue where some users are getting groups given to them, but its not showing in server logs nor the luckperms_action table. I was told that the only thing that wouldlt be logging anywhere is changed made via the api

fast delta
#

LP doesn't push API calls to audit log, but there is audit log API for plugins themselves to push entries to

#

however

#

There is the NodeAddEvent, events are called by API actions as well, but there is no "cause" system

rapid delta
#

darn

fast delta
#

well there is a cause system, just not exposed in the API lol, I think it's used in /lp verbose

rapid delta
fast delta
#

oh yeah I was more generally talking about the cause system

rapid delta
#

oh :/

stray swallow
#

Hello How can I get groupWeight in int pls

#

How can I get it to an int

turbid solar
#

look at the OptionalInt methods

jovial jacinth
#

Is it possible to "sort" through permissions? I have three permissions hollowrealms.race.elves hollowrealms.race.lizards and hollowrealms.race.demons. I need to find out if two players have different races, if they have a different word after race.. How would I do that?

turbid solar
#

best to use the meta system for that

jovial jacinth
#

Is there a link for this on the docs?

toxic torrent
#

How do I check if a player has the meta "test"

rocky shoal
#

Hi people Wave

I would like to detect when the player's role is changed by parent set, parent add and remove. But there is no event for this, any ideas?

wild whale
#

all those commands do is add, mutate, or remove inheritance nodes (group.GROUPNAME) on the user. Use the appropiate node add/mutate/remove events, and filter for inheritance nodes

rocky shoal
gritty wasp
#

ПроĐČДт ĐșŃ‚ĐŸ русĐșĐžĐč

turbid solar
#

!ask

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?
tawdry gorge
#

How can i check for a meta value like meta.clansize.20 without iterating over all inherited groups of a player

main dagger
tawdry gorge
#

it didnt include inherited values

#

i did

user.getNodes(NodeType.META).filter { it.metaKey == "clansize" }
fast delta
#

that only gets the user's own nodes

fast delta
#

and the other stuff around CachedMetaData

leaden dock
#

how i can check the duration of the rank of a player ?

turbid solar
#

get the inheritancenode and get the expiry

#

d;lp InheritanceNode#getExpiry

slate deltaBOT
#
@Nullable
Instant getExpiry()```
Description:

Gets the time when this node will expire.

Returns:

the Instant when this node will expire, or null if it doesn't have an expiry time

sturdy quartz
#

Hey there, i'm new to using the api and when trying to add the dependencies etc it does not work. It says that Luckperms is a unresolved reference. But when i refresh my dependencies or use ./gradlew it comes out as build succesful

    maven {
        url = uri("https://cursemaven.com")
        content {
            includeGroup("curse.maven")
        }
        mavenCentral()
    }
}

dependencies {
    minecraft("com.mojang:minecraft:${property("minecraft_version")}")
    mappings("net.fabricmc:yarn:${property("yarn_mappings")}")
    modImplementation("net.fabricmc:fabric-loader:${property("loader_version")}")

    modImplementation("net.fabricmc.fabric-api:fabric-api:${property("fabric_api_version")}")
    modImplementation("curse.maven:cobblemon-687131:${property("cobblemon_curse_file_id")}")
    compileOnly("net.luckperms:api:5.4")
    include("net.luckperms:luckperms-api:5.4")?.let { implementation(it) }
}```
nocturne elbow
#

but shows in other chats

sturdy quartz
nocturne elbow
sturdy quartz
#

Does someone know by any chance if i imported the api wrong?

fast delta
#

that include for luckperms-api doesn't look like it should be there at all, other than that it looks alright

sturdy quartz
dim steppe
#

HEy i keep getting this error - https://sourceb.in/2h1sAXDfPK
whenever i run the plugin in the server, no build errors or such
the dependency on pom.xml is

<dependency>
  <groupId>net.luckperms</groupId>
  <artifactId>api</artifactId>
  <version>5.4</version>
  <scope>provided</scope>
</dependency>```

and
im using the latest Bukkit version of luckperms in the server, v5.4.79
wild whale
wild whale
#

I believe so, yes

sturdy quartz
#

What imports do i need when having the dependency installed in my kotlin fabric mod?
For some reason Luckperms stays on unresolved

unreal mantle
sturdy quartz
tall sundial
#

Hey i got an error while trying to build a bungee plugin,
these are the strings that gives the error

        String prefix = user.getCachedData().getMetaData().getPrefix();
        String suffix = user.getCachedData().getMetaData().getSuffix();
#
method getMetaData in interface net.luckperms.api.cacheddata.CachedDataManager cannot be applied to given types;
#

and this is the error

#

can anyone help?

fast delta
#

what version of the api are you building against?

tall sundial
#

sorry?

#

oh

#

and i added these 2 jars to the library

fast delta
#

uh you shouldn't really add those jars directly there, using maven should be all of it
but, yeah, that method was introduced a bit later than 5.0, if you target 5.4 (which is the latest today) it should be fine 👍

tall sundial
#

so change the number to 5.4

#

?

#

iam not really into this plugin theme

fast delta
#

yeah

tall sundial
#

it says this

fast delta
#

yep, if you're using intellij there should be a "reload maven" button floating somewhere

tall sundial
#

cant find it

#

what if i restart intellij

fast delta
#

that would probably work too

tall sundial
#

oh yes

#

that did work

#

the plugin builded

#

thanks for the help

fast delta
#

np

unique sigil
#

Hey there
can I use this code to get the this meta attribute from a certain group? Because if I use it, I dont get a a color code back

private String getUserRankColor(Player player) {
  User user = plugin.getLuckPerms().getUserManager().getUser(player.getUniqueId());
  if(user != null)
    for(Node node : user.getNodes())
      switch(node.getKey()) {
        case "meta.rank-color.§4":
           return "§4";
        case "meta.rank-color.§b":
           return "§b";
        case "meta.rank-color.§c":
           return "§c";
        case "meta.rank-color.§1":
           return "§1";
        case "meta.rank-color.§6":
           return "§6";
        case "meta.rank-color.§d":
           return "§d";
        case "meta.rank-color.§a":
           return "§a";
      }
  return "";
}```
errant sigil
#

hi, so im working on a plugin that will have a permissions gui, a ingame menu to give/remove permissions,
i want to create an item for each permission, this isnt my issue, id like to know if there is an easy way to get all user permissions in an string array or list. any help is appreciated feel free to @ me if you can help

night pier
night pier
digital ore
#

Hey I'm currently getting this error
https://hastebin.com/share/mofatayuja.ruby

Code:


    private String getPrefix(Player p){
        CachedMetaData metaData = CraftValleyCore.luckPerms.getPlayerAdapter(Player.class).getMetaData(p);
        return metaData.getPrefix();
    }

    @EventHandler
    public void onChat(AsyncPlayerChatEvent e) {
        Player p = e.getPlayer();
        String prefix = getPrefix(p);
        if (prefix == null) {
            prefix = "";
        }
        e.setFormat(MessageUtil.Colorize(prefix + ChatColor.GRAY + "%s" + ": " + "%s"));
    }
#

I don't really know why
The screenshot is from the on enable method

dreamy haven
#

make sure that you have a dependency on luckperms in your plugin.yml so that your plugin loads after it, and if you use maven make sure you're not accidentally shading it in

dreamy haven
#

depends on whether you want your plugin to work without luckperms or not

#

if it's a regular depend and luckperms isn't present then your plugin won't enable

digital ore
#

Added it but I'm still getting the error

void flare
#

Yo, how do you add/set up groups to a player?

#

Trying to give x group to a user with the api and im confused

nocturne elbow
#

why this code gives me errors import net.luckperms.api.LuckPerms; import net.luckperms.api.LuckPermsProvider; import net.luckperms.api.group.Group; import net.luckperms.api.group.GroupManager; error='Cannot resolve symbol 'luckperms''

fast delta
#

do you have a variable/field called LuckPerms?

nocturne elbow
#

no

#

so want to do

fast delta
#

you need a variable of type LuckPerms, and assign it the instance obtained either from the services manager or from the static provider

nocturne elbow
#

can you show it? plz

fast delta
nocturne elbow
#

still Cannot resolve symbol 'luckperms' the code

`@Override
public void onEnable() {

    RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
    if (provider != null) {
        LuckPerms api = provider.getProvider();

    }
}`
jovial bay
#

Hey I'm really confused by some of the documentation, can anyone give an example of how I would get a player's prefix as a string?

crystal ridge
#

👋 Hello good people! I'm building an app that allows me to whitelist people by setting their group from an invite only Slack workspace. I'm attempting to set their primary group like this:

DataMutateResult res = user.setPrimaryGroup(group);

however the result fails every time. I'm able to see that the group I am trying to set exists with lp editor. I'm developing this as a paper plugin using gradle and the runServer plugin which starts a paper server with the plugin I'm working on.

#

Any idea what might be causing this to fail?

crystal ridge
#

This method from the cookbook seems to work:

    private CompletableFuture<Void> addUserToGroup(Player player, String group) {
        return luckPermsApi.getUserManager().modifyUser(player.getUniqueId(), (User user) -> {
            user.data().clear(NodeType.INHERITANCE::matches);
            Node node = InheritanceNode.builder(group).build();
            user.data().add(node);
        });
    }
main dagger
#

setting the primary group doesnt actually do anything

#

you need to add the group node to the player

#

the primary group only matters if you have certain config settings set, but with the default, its not used

#

and they would need to have that group anyways

ripe cedar
#

how do I set prefix for a group?

nocturne elbow
#

`import net.luckperms.api.LuckPerms;
import net.luckperms.api.LuckPermsProvider;
import net.luckperms.api.model.group.Group;
import net.luckperms.api.model.user.User;
import net.luckperms.api.node.Node;
import net.luckperms.api.node.NodeType;
import java.util.stream.Collectors;
LuckPerms luckPerms = LuckPermsProvider.get();
if (luckPerms != null) {
player.sendMessage("---- LuckPerms Groups ----");
luckPerms.getGroupManager().getLoadedGroups().forEach(group -> {
String groupInfo = "Group: §a" + group.getName() + "§7, Prefix: §a" + group.getCachedData().getMetaData().getPrefix() + "§7, Suffix: §a" + group.getCachedData().getMetaData().getSuffix();
player.sendMessage(groupInfo);

        String playersInGroup = luckPerms.getUserManager().getUsers().stream()
                .filter(user -> user.getCachedData().getPermissionData().checkPermission(NodeType.INHERITANCE, group.getName()).asBoolean())
                .map(User::getUsername)
                .collect(Collectors.joining(", "));
        player.sendMessage("  Players: §a" + playersInGroup);
    });
    player.sendMessage("-------------------------");
}

}
`so it dosen't work

proud crypt
#

Don't just post "it doesn't work" without any evidence of it not working... What error do you get?

nocturne elbow
#

Cannot resolve symbol 'luckperms'

#

on all only these imports import net.luckperms.api.LuckPerms; import net.luckperms.api.LuckPermsProvider; import net.luckperms.api.model.group.Group; import net.luckperms.api.model.user.User; import net.luckperms.api.node.Node; import net.luckperms.api.node.NodeType;

proud crypt
#

Share the full stack trace

nocturne elbow
#

idk want is that (but i am traing to make a minecraft plugin that takes all the groups and deletes (i am making a so if a player chages the luckperm permisions is will delete all groups and create all them again))

karmic shadow
#

If you don't even know what a stack trace is, then you should really reconsider making plugins.

tawdry grail
#

Hello? I want to use the LuckPerms API to do the following.
I noticed that the Prefix/Suffix of the Meta of LuckPerms has a priority number. And theoretically, the higher the number, the higher the priority.
So I can use this to implement fake Prefix/Suffix.
This is for example:

PrefixNode prefixNode = PrefixNode.builder(prefix, 77665).build().
user.data().add(prefixNode).  

But when I want to restore the original, i.e., I just need to delete the prefix with priority 77665.
But I don't seem to find this operation directly in the API provided by LuckPerms.
But the operation of deleting Meta directly by priority exists.
I.e. /lp user <name> meta removeprefix
Also, I think there are times when reading Prefix can skip this fake Prefix/Suffix.
But I found that when fetching Prefix/Suffix it seems to only fetch the currently displayed Prefix/Suffix.(i.e. the one with the largest priority number Meta) I want to skip the largest one and choose the second largest one. And how do I achieve this?
Perhaps the maximum priority number we can use is Integer.MAX_VALUE

tight minnow
#

hey

fallow seal
#
        val luckUser: User = LuckPermsProvider.get().getPlayerAdapter(Player::class.java).getUser(e.player)
        luckUser.data().add(Node.builder("worldguard.region.flag.regions.own.${chunkName}").build())

Can somebody tell me why isn't it giving the permission? Just won't work, no errors

night pier
#

you have to save the user

jagged ember
#

so getting cached meta from a user doesn't hold the expiry right?, was thinking of putting some buffs into the users meta data ex "exp-buff" 0.1 with expiry of 5 minutes and then fetch that whenever the user mines a block and also to display the current buffs as placeholders ex "exp buff: 10% 5 minutes left"
but I guess I have to use nodes if I want to get the expiry then or is there a better way to do it?

jagged ember
#

Yes not nodes?

raven oak
#

Hi I am trying to make use of the API with a plugin that allows me its name is ConditionalEvents this has a configuration that allows me to enter the package and shred it to save its variables in placeholder. But the issue is that I can't find a way to put it together. I need to listen to the event when a user loses permission to fly for whatever reason, because it has been added temporarily or not. If you allow me I pass you the link to the wiki of the plugin

blissful timber
#

Hello, is there something like a GroupChangeEvent? So I can see when a player changed their group and do something in that case.

blissful timber
#

Oh I think I see it now, thanks.

silk star
#

@main dagger that's a pity... I should know somehow when someone is added or removed from a group in the standalone app... 😩

frank driftBOT
#

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

remote wind
#

how can i get a permission (like permission.value and get the value as a text)

night pier
#

Do what

remote wind
turbid solar
#

use meta

remote wind
turbid solar
#

!meta

frank driftBOT
remote wind
remote wind
turbid solar
#

meta.key.value

remote wind
night pier
#

!cookbook this should have an example for you to look at.

frank driftBOT
narrow crystal
#

Im probably doing something very wrong, what is it?

#

the rank is the same as the id of the group Im pretty sure

#

my best bet is that the node key is not group.<rank id>

#

ping on reply please <3

#

actually seems like its this part

#

im dumbass it seems

#

yeah fixed

#

this is what happens when you dont read the docs properly kids

celest acorn
#

user.data() has add and remove methods, but how can I modify the node?

#

if I need the behavior similar to lp user <user> meta set <key> <value>, do I have to do remove and then add?

fast delta
#

yep

flat helm
#

Do someone now, how i can do this:

If someone adds a rank to a member, a dc bot will get the info from the api and add the info to the member in the dc (acc's are linked)

gray linden
#

hi

#

Is there an API that shows the number of people in that rank?

turbid solar
#

d;lp UserManager#serachAll

slate deltaBOT
#
@Unmodifiable @NonNull
<T extends Node> CompletableFuture< Map<UUID,​Collection<T>>> searchAll(@NonNull NodeMatcher matcher)```
Description:

Searches the normal node maps of all known Users for Node entries matching the given matcher.

Since:

5.1

Returns:

the entries which matched

Parameters:

matcher - the matcher

turbid solar
#

nice markdown broken again

shadow harbor
#

hello, how can I convert this number to days?

turbid solar
#

it's unix timestamp I believe

#

epoch

main dagger
#

its not a duration

turbid solar
#

but directly accessing the db isn't really supproted

shadow harbor
#

but I want to get an offline player's ranks and the expiry date, and with luckperms api I cant get informations of offline player. i thought the only way is database request.

turbid solar
#

yes you can

#

you need to load the player

shadow harbor
#

ah thank you, you saved me

shadow harbor
# turbid solar yes you can

Now it also shows the rank of all players who haven't even played on the server yet. Is there any way I can check if the player is in the luckperms database?

normal canyon
#

how can i set a users' primary group for an amount of time. like modifying a users' primary group for a week and then roll it back to default

normal canyon
#

no?

turbid solar
white osprey
#

I know we can get expiry date of node, but can we get date of when this node has been given or what total duration it had?

wild whale
#

I mean you can search for that in the LP logs (afaik that's exposed to API), but nodes themselves don't contain the time they were given.

minor hare
#

LuckPermsProvider.get().getUserManager().getUser(name).getCachedData().getMetaData().getPrefix()
whats wrong I get prefix group &4[&Member&4] &8

unreal mantle
minor hare
#

And how to get groups prefix

unreal mantle
#

Use the group manager and get group

#

Instead of user

crude wraith
#

How can i get all the users with a specific role, eaven offline ones. I tried getting all the offline users and loading them for after check their groups but it return player who had the group in the past to. Using luckPermsAPI.getUserManager().getUniqueUsers() return null for some reason

soft wigeon
#

How do I completely delete the user from luckperms using api? There is no userManager.removeUser method.

#

deletePlayerData/cleanupUser don't work as expected though cleanupUser tries to do something but fails in many cases.

#

user.data().clear() leaves out the default group thing

#

I find luckperms api very limited and complicated compared to permissionsex, in pex I could just user.remove but in luckperms no such thing

fast delta
#

a user without nodes (or just group.default) should automatically be deleted from the database; there is an open issue about that on GitHub so it isn't an unknown problem

soft wigeon
fast delta
#

a user without nodes should automatically be deleted

there is an open issue about that on GitHub so it isn't an unknown problem

soft wigeon
# fast delta a user without nodes **should** automatically be deleted > there is an open iss...

Most of them don't get deleted even after restarts. I'm developing a fakeplayers plugin and I want to make my plugin compatible with luckperms. Fakeplayers are "offline" and "uuids" in the luckperms, editor (because they are just uuids real players can't hack donate by logging on to the fake accounts). When I clear up the fake user and then save, he is still in the editor with the default group, though some of them get deleted. The debug logger keeps saying:
[luckperms-command-executor/INFO]: [LuckPerms] User Housekeeper: unloading user data for b53d8881-7efd-487c-bd3f-ca32c8cd2dad
[luckperms-command-executor/INFO]: [LuckPerms] User Housekeeper: unloading user data for 63dc8da6-76fc-4b2f-a10a-6113838edcfd
[luckperms-command-executor/INFO]: [LuckPerms] User Housekeeper: unloading user data for 338a31ff-b464-4949-bd9e-7591c5a3a950
[luckperms-command-executor/INFO]: [LuckPerms] User Housekeeper: unloading user data for 744e5e49-b79b-4071-977c-c8dc538d43e7
[luckperms-command-executor/INFO]: [LuckPerms] User Housekeeper: unloading user data for d8fa477c-52af-4445-8a1d-e8aa14258f96
[luckperms-command-executor/INFO]: [LuckPerms] User Housekeeper: unloading user data for 2522df05-5bb4-4e40-91d3-a6a4e406759f
[luckperms-command-executor/INFO]: [LuckPerms] User Housekeeper: unloading user data for 5bfb0350-cd78-44e2-9093-90d8f57adaee
[luckperms-command-executor/INFO]: [LuckPerms] User Housekeeper: unloading user data for 32d9385c-e49d-4819-ba7b-b4c47be2a543
But these unloads don't do anything, and they are still there:

fast delta
#

for the third time, it is a known issue

soft wigeon
#

if fake users don't get deleted, they will trash up the editor that's why it's so crucial

fast delta
#

but unloading has nothing to do with the data saving, that's in-memory
I don't know where the issue is, the proper solution is to fix it in LuckPerms, contributions are always welcomed, without that, manually deleting it from the db I suppose

soft wigeon
fast delta
#

it's not exposed directly in the API because there are many storage methods that need to be abstracted away, not just a sql database (you can even provide a custom storage method via extensions)

#

the logic for the deletion is there, but clearly there's something else going on

crude wraith
fast delta
#

could you share the stack trace?

soft wigeon
#

I found out the problem, will open pr soon

fast delta
crude wraith
past minnow
#

how do i give someone a certian group for a certain amount of time

unreal mantle
spiral echo
#

Can I post code here?

left geyser
#

Using a pastebin to keep the chat clean and tidy, yes.

#

!paste

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!

spiral echo
#

this is in my onEnable

left geyser
#

Try LuckPerms api = provider.getProvider(); instead.

spiral echo
#

inplace of luckPermsAPI = provider.getProvider();?

left geyser
#

Right.

spiral echo
#

alrighty let me see

#

Am I meant to use the getProvider() func in every class or the api variable set in the onEnable?

spiral echo
#

RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class); is just returning null even though LP is installed on the server

jovial bay
#

does luckperms provide an event that's called when player groups change? and if so whats it called?

night pier
#

Uhhh. I think NodeMutateEvent does? I’d have to double check that.

#

!api

frank driftBOT
night pier
#

That should work, not sure exactly what you’re doing.

normal canyon
#

is it possible to get the main node of player which contains it group and expiration date and change it? i red from docs that they cannot be changed but i really need to modify the expiration date

turbid solar
#

where’d you read that

#

yes

normal canyon
#

im not sure how can i get the node from player.data()

#

im sure there is only one node there

turbid solar
#

also check the reading one

normal canyon
#

ah thanks

#

what should i set the key name?

#

i cant get it by example

#

s that are on docs

#

like is this fine to use ?
"madcraft.rank.vip"

turbid solar
#

read the api guide again

#

you can’t use the bukkit event stuff for luckperms events

jovial bay
#

oh

#

alright cool I have the event, is there any way to get a player name or uuid to turn into a player object from the event?

night pier
#

getFriendlyName will give you their username iirc.

jovial bay
#

so something like this would work?

Bukkit.getPlayer(e.getTarget().getFriendlyName());
night pier
#

Doesn’t getPlayer look for a UUID?

jovial bay
#

well it has the option to look for a string

#

although that might just be a UUID in a string object

night pier
#

You are right, it can accept a username.

jovial bay
#

YES

#

oh my god

#

i just got the biggest win

turbid solar
#

iirc i het event also fires for groups

#

so you’d want to check what the e target is

normal canyon
turbid solar
#

need to save the player

normal canyon
#

oh right lemme

#

aight should now work thanks

#

is it possible to get the current node that User has?

minor hare
#

Hi something repair code fix rank string

          if (pl.isOnline()) {
             String name = pl.getName();
             new BukkitRunnable() {
                public void run() {
                   String rank = Main.api.get().getUserManager().getUser(name).getCachedData().getMetaData().getPrefix();
                   new BukkitRunnable() {
                      public void run() {
                         Player p = Bukkit.getPlayerExact(name);
                         if (p != null) {
                            LoginBar.sendHeaderAndFooter(p, String.format("§4✰§f✰§0✰§6✰§b✰§2✰§4§lPLAY§6§lZONE§2✰§b✰§6✰§0✰§f✰§4✰\n§f      §eJusu rank:§r %s\n§eJusu balansas: §c%s€\n§eJusu /xp: §c%s", rank, Main.es.getUser(p).getMoney().setScale(2, RoundingMode.DOWN), LoginBar.this.plugin.xpc.getXp(name)), "        §3§l§k|||§f §6§lwww.mc
§2- §cTau ir tavo draugams! §3§l§k|||§f\n§6Discord: www.discord");
                         }
                      }
                   }.runTask(LoginBar.plugin);
                }
             }.runTaskAsynchronously(plugin);
          }
       }```
#

and I get §eJusu rank:§r %s &4[&8Member&4]

frank driftBOT
#

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

magic apex
#

why is it not working? i tried everything

turbid solar
#

did you restart your intellij?

#

try using the terminel to build

magic apex
#

i fixed it, thanks for help

nocturne elbow
#

anyone know how to make a custom welcome message but with your prefix?

Broadcast "&b[&c+&b] then the lp prefix of the player"

please help me

turbid solar
#

are you using the api

nocturne elbow
turbid solar
#

!api

frank driftBOT
turbid solar
#

!cookbook

frank driftBOT
nocturne elbow
#

i used %luckperms_prefix% still dont work

turbid solar
#

are you making a plugin

nocturne elbow
#

im not making a plugin bro

#

only skript

turbid solar
#

ask skript

nocturne elbow
#

they asked me to go here bro

turbid solar
#

this is for the luckperms api

#

you're not using the api

#

We have no idea how Skript works, that is upto them

old wolf
#

Hi 👋 does somebody know how can I get a list of all permissions that player have on server=survival and contains cmi.? I've been looking (on wiki and here on discord) and trying it for a while now but I can't find the solution for this. 😅 It will be really helpful for me if somebody does know how to do it 😏

final root
#

Hi

#

Is it possible to get all the players in a group

#

If you know the answer please @ me

final root
#

?

nocturne elbow
#

so im making a code where if i right click on something i get a rank and im now stuck on how to give that player the rank please help me

left geyser
#

!api

frank driftBOT
left geyser
#

!cookbook