#luckperms-api

1 messages · Page 24 of 1

uneven torrent
#

so they need to have vip and default permissions at the same time

unreal mantle
#

After you set the vip rank for 7 days and it runs out, if they don't have any other groups they just go back in default group anyway

uneven torrent
#

Yes, they back in default when the user disconnect and connect

rustic laurel
#

So what are you wanting to check?

unreal mantle
#

Or what are you trying to do exactly.

uneven torrent
steel edge
#

How can I get if player has permission with API of luckperms 5

rustic laurel
#

!api pretty sure it's on here @steel edge:

frank driftBOT
nocturne elbow
#

I need help

#

-help

crystal sonnet
#

Have you tried asking in the right channel? @nocturne elbow

frank driftBOT
nocturne elbow
#

Confused as to

#

How I'd remove a parent group from an offline player

crystal sonnet
#

Load the user and work with it like normal @nocturne elbow

nocturne elbow
#

Okie

#

Thanks

crystal sonnet
#

You're welcome

idle drum
#

Hello I use server.pro and the support says everything is set up but the prefixes don’t show up only [defualt] the prefix won’t change

#

@unreal mantle

frank driftBOT
#

Hey Lincoln! Please don't tag staff members.

rustic laurel
#

!faq @idle drum read this:

frank driftBOT
rustic laurel
#

Prefix part

surreal comet
#

How I can get a group prefix, and detect if the group have a prefix?

rustic laurel
#

!api @surreal comet pretty sure it's on the wiki, under usage

frank driftBOT
surreal comet
#

I found, but don't know what QyerryOption to use to get the right metaData to get the prefix

#

nvm

surreal comet
#

java.lang.ClassCastException: me.lucko.luckperms.common.api.implementation.ApiGroup cannot be cast to org.bukkit.entity.Player

            Group group = luckPerms.getGroupManager().getGroup(database.getLevel(player.getUniqueId()));
            assert group != null;

            QueryOptions queryOptions = luckPerms.getContextManager().getQueryOptions(group);

            CachedMetaData metaData = group.getCachedData().getMetaData(queryOptions);

            String groupName = metaData.getPrefix() == null ? group.getName() : metaData.getPrefix();
#

ping me

crystal sonnet
#

@surreal comet you can’t get query options for a group

#

Only for a player

#

Or the server

idle drum
#

Hello, i use luck perms and my prefixes arent showing still. I contacted support via server.pro and they said everything on my side was correct but, some issue with luck perms. My prefixes don't want to show up. Could someone help me?

surreal comet
#

I tried to use player, and same thing

#

oh

#

nvm

crystal sonnet
#

Btw it’s best to get the players prefix

rustic laurel
crystal sonnet
#

Not the group’s prefix

nocturne elbow
#

i cant seem to be able to give permissions to my friend through luck perms here

crystal sonnet
surreal comet
#

No. The plugin shows the group prefix
I want to show under player name on the gui what group he gets when he is staff
So the playr can not have the group, or can have it

crystal sonnet
#

I see

#

In that case just use the static contexts

#

Or query options

surreal comet
#

ok
Tanks
Tomorrow I'll take a better look

thorny tangle
#

@idle drum how did you fix prefixes?

idle drum
#

I fixed them using a different chat plugin

#

Instead of using essentials I use essentialsx chat @thorny tangle

thorny tangle
#

ok then it wont work for me :/

idle drum
#

Why

thorny tangle
#

cuz i use essentialsx

idle drum
#

Ok and your using the command /lp group (group) meta addprefix “(prefix)”

#

With the quotes

thorny tangle
#

yes that's what i use

idle drum
#

Ok then ask the admin they know everything

thorny tangle
#

who

#

no admins on rn

crystal sonnet
polar cargo
#

@azure latch i'm on forge :p

#

Hey guys lpapi.getUserManager().lookupUsername(UUID.fromString(uuid)).get() return the name without check the case of the name (example, Flashback083 become flashback083), any way to fix this ?

azure latch
#

Does forge have an equivalent class?

#

If LP doesn't work, you could try making a Mojang API call to get the username

polar cargo
#

i already does it

#

but if lp work i would like to get the good name :p

#

and if doesnt work then get the mojang call

dark dock
#

Hay, how can I interrogate the group?

rustic laurel
#

!api @nocturne elbow pretty sure it's here:

frank driftBOT
dark dock
#

How can I interrogate the group?

rustic laurel
#

@dark dock have you looked under 'Example Usages' on the api wiki?

dark dock
#

Yes ..

#

Can you send me the code?

rustic laurel
#

I can't cause idk enough to be of any value. When someone is available to, they will for sure

dark dock
#

No i only will Interrogate in which group the player is

dark dock
#

How can i directly check this?

#

if(getPlayerGroup("Admin") {
e.setFormat ..........

For example

plush laurel
#

Hey everyone! Im trying to get use of the LuckPerms api for my plugin . my plugin counts player online time and i want a cool chat prefix that displays at the begining of the chat mesasge like seen in the image attached, but one that isnt based off of a role, just set the user prefix and set their current playtime in hours in it, also have it display along with their staff rank, how would i acheve this? (Instead of saying noob it displays a number that is the users playtime on the server/ like a level)

#

is there a way i acn add meta and add a second prefix

#

right now im using the config to do prefix stacking, is there another way to achieve this?

#

i was told to just directly interact with my chat plugin of choice (chatex)

rustic laurel
#

@plush laurel I can't see how the LP API would be the best way to achieve this - I'd say try and find another plugin which counts playtime and is compatible with PlaceholderAPI or another API system, and just add a formatted chat prefix (which displays the hours played) directly into Chatex without using LP at all. Unless you want to assign LP groups based off of playtime?

plush laurel
#

yeah no i dont want that

#

whats PlaceholderAPI?

rustic laurel
#

It's a system for plugins to register placeholders that can be displayed in other, PAPI-supporting plugins

plush laurel
#

wait, so like i could register a placeholder for %level% and it could just be added to the chatex format, like %prefix% or %suffix%?

rustic laurel
#

yep

plush laurel
#

w o a h

rustic laurel
#

not sure exactly how, but it's possible

plush laurel
#

i think i got it

#

possibly

#

im testing rn

lusty grail
#

i have a big issue

#

there's the error i got

#

please help its so big

rustic laurel
#

#support-1 unless this has to do with the luckperms developer api

rustic laurel
#

!api Check out the example usages:

frank driftBOT
mint shard
#

Hello! I have programmed a CaseOpening plugin. I want to give a player a permission via the plugin.
I have implemented LuckPerms and now I want to distribute permissions to a player via the API.

thorn aurora
modern brook
#

Hello i have bungeecord luckperms and everything works great but the prefixes doesn't show :/ any idea why?

rustic laurel
#

!faq @modern brook read the prefix part 😄 [edit: sorry for the ping, just saw your other message in g1]

frank driftBOT
vernal sonnet
#

how would i get all the groups that exist and their names?

warm ember
#

Someone that haves a nice /shop plugin to my skyblock server?
tag me if you have
or recommends a /shop plugin

void bolt
#

ShopGuiPlus

#

hands down

#

@warm ember

warm ember
#

is it on spigot or bukkit? @void bolt

void bolt
#

spigot

pine mulch
#

so can i convert my permissionsex rankk to luckperms??

fluid orchid
#

Yes, with "/lp migration permissionsex"

broken lynx
#

Do I have to "commit" change to the user's data or something? user.data().add/remove

#

It doesn't seem to be adding or removing anything.

#

Nvm.

#

Apparently I can't read.

nocturne elbow
#

I need help with this?

crystal sonnet
#

Just ask your question

timber galleon
#

@cursive rain that worked btw. ty for the help

cursive rain
#

Not sure why you pinged me in here for help that isn't api related but glad you solved your issue.

timber galleon
#

jeeze dude. I thought I was in off topic. I suck

dire remnant
#

Could the api be updated to support getting placeholders for offline players?

crystal sonnet
#

@dire remnant the LP API supports offline players for ages

dire remnant
#

i just tried

#

papi parse me {offlineplayer} returns nothing

#

but for an online player it does

#

Yeah @crystal sonnet i just tried for an offline player then logged in and it suddenly worked

frank driftBOT
#

Hey Barnaby! Please don't tag staff members.

dire remnant
#

oops

dire remnant
#

yo mods

#

any of yall alive

rustic laurel
#

If you have a question that's hasn't been answered, it's probably because we don't know :P

#

But Brain probably does and will answer when he can

dire remnant
#

Alrighty

earnest zodiac
#

Hey,
I dev a Spigot Plugin, and i want to test permission with inherits or none (like with the commande /lp user <pseudo> permission check|checkinherits permission)?

dire remnant
#

You could use the placeholder?

#

%luckperms_has_permission_<permission>%
if it returns "yes" they have it

earnest zodiac
#

My plugin has a option, is a bool this bool limit if check only the specified rank or the rank and the rank that greater than this rank

#

How can i do ?

crystal sonnet
#

What?

#

!api btw

frank driftBOT
fluid orchid
#

Hey guys, I am trying to demote a player when they die, for a certain event we are having soon.
When this code runs, I get the error "NOT_ON_TRACK", as the DemotionResult.
I have however checked if the player is indeed on the track; and it is.
Is there any faults in my code here?

azure latch
#

Is the track called default?

fluid orchid
#

Yep

fluid orchid
dire remnant
#

papi parse me {offlineplayer} %luckperms_prefix% returns nothing

#

But it does for an online player

#

Can someone help because I was told it supports placeholders for offline players.

dire remnant
#

@crystal sonnet am i doing something wrong?

frank driftBOT
#

Hey Barnaby! Please don't tag staff members.

errant gyro
#

Hello, I have a problem with the prefixes that do not appear in the game I already have Essentials Chat as well as Vault
I'm using the bungeecord version

Edit : I Set add prefixes and suffixes true

azure latch
#

@dire remnant Your using PAPI placeholders, I really don't see how this is a question for LP tbh, or is suitable for the dev channel. Go ask PAPI support.

daring minnow
#

No, PAPI is working absolutely fine

#

Based on what Barnaby is saying this looks like either an issue with LP or a misconfiguration on Barnaby's side

dire remnant
#

It is a Luckperms issue

#

100%

#

They’ve written the expansion wrong

daring minnow
#

It returns an empty string for offline users

#

Definitely a LP problem

rustic laurel
#

iirc, LP can't keep all offline users loaded, so you need to load the player before you try that

dire remnant
#

Papi implemented a feature so that on their extensions you can get the placeholders off offline players.

#

@rustic laurel is that correct

frank driftBOT
#

Hey Barnaby! Please don't tag staff members.

earnest ferry
#

In the LuckPermsAPI (from bungeecord) what is the best way to check - if a player is offline, have they connected to the server before

dire remnant
#

Dude how many times is this feature going to be requested

earnest ferry
#

i don't want any offline player info, just a Boolean yes/no to see if they have a group assigned (which they would have if they joined right, and won't if not found)?

dire remnant
#

Wouldn’t be possible until they implement offline players placeholders

rustic laurel
#

!default @earnest ferry default group won't work like normal groups, all players that don't have a group will be in default when they join and then won't be when they leave

frank driftBOT
dire remnant
#

Which supposedly they already have

rustic laurel
#

@dire remnant open an issue on GitHub requesting it, see where it goes

dire remnant
#

Already done

rustic laurel
#

Then if luck hasn't replied yet, all you can do is wait

#

If he has, there's your answer

dire remnant
#

gracias

#

what is the average response time

rustic laurel
#

It fluctuates between 0 and infinity

#

About a week tops, usually less though @dire remnant

dire remnant
#

Cheers kek

daring minnow
#

tbh it probably won't happen

#

LuckPerms is clearly specifically designed to only load player data when the player is online

crystal sonnet
#

No. There’s even specific methods in the API to load offline player data

last sequoia
#

Is there a limit on the size meta tags can be

daring minnow
#

But that won't happen on demand with PAPI, LP would have to load offline player data in advanced of PAPI calls, to ensure no database queries are run on the main thread

#

Which would mean essentially keeping offline player data eternally loaded – not something that's happening

#

If the plugin which requires the placeholders requested them in advance through the LP API it could work, but then the plugin wouldn't be able to rely on PAPI alone

#

Correct me if I'm wrong, I don't know if there are any PAPI methods which return CompletableFutures or allow for any sort of concurrent processing

crystal sonnet
#

That's a different story

uneven torrent
#

hello

#

It is API have some like listeners

#

For example OnChangePermission

crystal sonnet
#

!api Have a look here

frank driftBOT
uneven torrent
#

Thanks

fluid orchid
#

Hey guys, I am trying to demote a player when they die, for a certain event we are having soon.
When this code runs, I get the error "NOT_ON_TRACK", as the DemotionResult.
I have however checked if the player is indeed on the track; and it is.
Is there any faults in my code here?

#

I have confirmed that the user in question is in fact on the 'default' track

rapid kite
#

Man I wish my codes looked like that. Wow

fluid orchid
#

Is that good or bad lmao

rapid kite
#

Good

fluid orchid
#

Well good looking code is useless if it doesn't work properly lmao

rapid kite
#

True true

crystal sonnet
#

I'd use the pattern of early termination

#

So instead of

if (condition1) {
  // Do stuff

  if (condition2) {
    // Do more stuff
  }
}

Use

if (!condition1) return;

// Do stuff 

if (!condition2) return;

// Do more stuff
fluid orchid
#

I see

crystal sonnet
#

Keeps the level of nestedness low

#

And does the exact same thing

fluid orchid
#

Yeah, fair point

#

I'm still confused on the actual problem though, the user is in fact on the track, but I get the NOT_ON_TRACK when the event fires

crystal sonnet
#

I know why

#

Because let me guess, you have assigned them ranks of the group without a context, right?

fluid orchid
#

Hmm, I actually only just migrated from PEX, after that I kinda just left it how it is

#

What context should I give it and where?

crystal sonnet
#

Use the default context

#

(Not to be confused with the static contexts)

fluid orchid
#

I've never really got the contexts much, I did take a look at the wiki, and ended up just doing this

#

Is that the static context you were talking about?

crystal sonnet
#

That's the current contexts the player has

fluid orchid
#

Right.. and they don't have to do with the track does it

crystal sonnet
#

And in short contexts are restrictions on where or under what conditions a permission/nodes (group assignmets are just nodes) apply

fluid orchid
#

I see

crystal sonnet
#

The thing is by default a group assignment on a track is in the global context

#

So if you pass any context the track looks for assignments of exactly the same context

#

Which there are of course none

fluid orchid
#

Hmm, makes sense

crystal sonnet
#

Because the assigned group is assigned globally

#

So use the default context

#

Which defaults to the global context

fluid orchid
#

I understand now, I'll give it a try and see if it works, thanks in advance!

crystal sonnet
#

You're welcome

fluid orchid
#

Yep, that works! Thanks

crystal sonnet
#

You’re welcome

pine mulch
#

hello

#

when i converted from permissionex to luckperms

#

all my prefixes are gone

crystal sonnet
#

Wrong channel

pine mulch
#

oh right

#

my bad

nocturne elbow
#

Can I use context (i.e. servername) with the API?

azure latch
#

what are you trying to do

nocturne elbow
#

Change tab name depending on meta tabprefix

#

But putting the context to i.e.

#

survival

#

Won't give me the new value if they're connected to survival

#

Cause the proxy =/= survival (the tab is handled on the proxy server)

#

Let me change my question

#

So

#

Can I pass a context (i.e. survival) to get the player meta from bungeecord

balmy coral
#

Hi

#

I am creating a Bungeecord plugin and I need to get the range prefix. Luckyperms IS NOT IN BUNGEECORD. It is connected via MYSQL. I understand that in order to obtain the prefix I have to connect my plugin to the luckyperms database. But in which table do I get the prefix of each range?

daring minnow
#

if you have phpMyAdmin, you can always take a look at the db yourself and infer some things

#

or check the LP source

#

i don't know if there's much documentation on this

crystal sonnet
#

@nocturne elbow of course you can

#

@balmy coral by installing LP on the bungee and using the API

nocturne elbow
#

@crystal sonnet could you provide me some kind of example/psudo example?

frank driftBOT
#

Hey Angery Nezuko! Please don't tag staff members.

nocturne elbow
#

Oh, I'm sorry for tagging

crystal sonnet
#

API usage is explained here:

#

!api

frank driftBOT
reef oasis
#

how do i get luck perms prefix for bungee cord as coding a staff chat plugin trying to show their rankbut cant figure how to add a variable for that or how to get ir

crystal sonnet
#

!api @reef oasis

frank driftBOT
delicate marsh
#

Hey there,

So I'm using LuckPerms on my BungeeCord network. We've set it up so that a user only has their in-game ranks in that specific server. Right now, I'm working with the LuckPerms API on a Bungeecord plugin. But, when checking for their group/groups (which are only assigned to eg. "skyblock") it doesn't return (because it's checking for bungee or global permissions).

Is there a way to check if a user inherits a group that is not assigned to this server?

Tried this, but it returns as false even if the user inherits the group. (But on server=skyblock)

        User user = api.getUserManager().getUser(player.getUniqueId());

        if(user == null) return false;

        return player.hasPermission("group." + rank);
    }```

I don't know if that's the right explanation but I'd like to explain it more if needed.
reef oasis
#

@crystal sonnet ive looked at that it doesnt show how to do so

frank driftBOT
#

Hey DevKieran! Please don't tag staff members.

crystal sonnet
#

Yes it does

#

Check the usage page

#

@delicate marsh perform permission checks on the user

reef oasis
#

ok

delicate marsh
#

@crystal sonnet how do i do that the best way?

frank driftBOT
#

Hey Gusuu! Please don't tag staff members.

delicate marsh
#

oh sorry

crystal sonnet
#

If I'm not mistaken there should be a few examples on the usage page

#

!api

frank driftBOT
delicate marsh
#

Allright, thanks

thorn aurora
#

is there a feature to set a role to someone who joined a specific world?

reef oasis
crystal sonnet
#

@reef oasis you’re compiling against API v4

#

Current version is v5

nocturne elbow
#

Hey, how can I add someone to a group? ;D

crystal sonnet
#

!api

frank driftBOT
warm ember
#

Does anyone know when bungeeNPC is going to update to 1.15.2? and do they have a discord

crystal sonnet
thorny echo
#

ENGLISH?

rustic laurel
#

@modest rivet Stop with the "SPANISH", please, we've already discussed this, and you're perfectly able to use a translator and not keep sending that.

rustic laurel
#

Stop, please

#

Last warning

frank driftBOT
#

Hey XxSr_DogexX! Please don't tag staff members.

grim flame
#

Hello there, have a question.
I'm trying to use the luckpermsapi, so far i have a registeredprovider instance of the plugin in my project. Was wondering how i would check if a certain offline player has a certain permission node?

crystal sonnet
#

!api

frank driftBOT
grim flame
#

thanks a lot for the response!

crystal sonnet
#

You’re welcome

spring grail
#

Hi guys, I have 2 plugins which the permissions aren`t found in editor , What i need to do or is something there?

neat jackal
#

The perms in the editor are just cached (meaning they have already been checked)

spring grail
#

cached per server or world wide

crystal sonnet
#

per server

#

That cache also doesn't persist between restarts

jovial breach
#

Hello, how can i set a user in a group for example for a week?

uncut onyx
#

Yes, with /lp user <user> parent addtemp <group> 1w

#

Hi, I read something about doing things with API with offline players. But I still get errors. Can it be because I am calling it in onDisable method? Make it some difference?

jovial breach
#

Yes but with the API

#

Not with a command

crystal sonnet
#

!api @jovial breach

frank driftBOT
crystal sonnet
#

You can set the expiry in the node builder

#

@uncut onyx What errors are you getting?

#

And why do I need to ask for them?

#

I mean it should be abundantly clear that I can't see your screen, so I have no idea what on earth you are doing

nocturne elbow
#

@crystal sonnet Is there any way to use luck perms on cracked server or online-mode=false

frank driftBOT
#

Hey Vodexsus! Please don't tag staff members.

crystal sonnet
uncut onyx
#

Sorry, my bad, my question was primary if I can use luckperms API during onDisable. Here is error with code where it happend.

crystal sonnet
#

@uncut onyx full error

#

Having half the error message cut off is not helping

#

But thanks for including line numbers

#

I'm impressed by how many don't think of that

uncut onyx
crystal sonnet
#

Yes the issue is that your plugin shuts down after LP

#

Make sure you have a softdepend on LP

#

(Or a dependency if LP is required)

#

Then LP should shut down after you

uncut onyx
#

Thats weird because I have already had it as dependency

#

But this is plugin on bungeecord side so I am not sure if it works the same as spigot does

crystal sonnet
#

@uncut onyx reach out to the bungee devs and ask them how you can make sure that your plugin shuts down before LP

uncut onyx
#

Ok, thanks for your time.

crystal sonnet
#

You're welcome

grim flame
#

if i create a method that returns one of the CompletableFuture<Boolean> from the plugin in a sync task, when someone runs a command

#

and i call a .get() on that method to wait for the result

#

will that block the whole server or only that command?

crystal sonnet
#

Depends on if the command runs sync or async

grim flame
#

running it sync is bad right?

crystal sonnet
#

Running it sync will cause the server to lock up until you have the result

#

So yes

#

That is bad

grim flame
#

hmm but if i put the whole command method in a bukkitrunnable, that makes it async i guess

#

but i can't send messages to players in an async task right?

#

if i remember

#

just general bukkit calls

crystal sonnet
#

Yes you can't run sync tasks in an async thread

#

But you can use the scheduler

jovial breach
#

This node with is new for me

#

How can i just add a player to a group which will then go away after a week again 🙂

grim flame
#

figured it out, thanks for the help!

crystal sonnet
#

@jovial breach I linked you two pages

#

One of them explains it in detail

#

@grim flame how'd you do it?

jovial breach
#

So INHERITANCE is used for groups?

crystal sonnet
#

Yes

grim flame
#

well i have an execute method for the command, i put the whole logic in a new async runnable and called the bukkit api in new sync tasks

crystal sonnet
#

Oh right

#

Lol. I mixed you up with someone else xD

grim flame
#

LOL

#

np :p

crystal sonnet
#

But that sounds about right

grim flame
#

yeah my head went boom but i figured it out 😄

crystal sonnet
#

👍🏼

nocturne elbow
#

Help please

crystal sonnet
nocturne elbow
#

Sorry I moved it after I realised

teal hill
#

How can I get a user's parent groups?

crystal sonnet
#

!api

frank driftBOT
teal hill
#

im looking at that pages over a hour

crystal sonnet
#

The first one should have the javadocs linked

#

They should help

teal hill
#

then already looked javadocs

#

I want to get list of player's parent group

#

not a check that player is in group.

crystal sonnet
#

Get the nodes active in their current context and filter for enabled parent nodes

grim flame
#

Stream api from java8 is the way to go

crystal sonnet
#

Yes

teal hill
#

so you say, loop every parent for one player's parent group?

crystal sonnet
#

No

#

get the user's nodes, search for enabled parent nodes, done

#

Streams are magic

teal hill
#

so is this okey? ```  StringBuilder sb = new StringBuilder();
for (Node node : user.getNodes()) {
Group group = luckPerms.getGroupManager().getGroup(node.getKey().replace("group.", ""));
if (group != null) {
String s = group.getDisplayName() + " ";
sb.append(s);
}
}

crystal sonnet
#

What?

#

Do you know how Java 8 streams work?

teal hill
#

yes?

#

its mid night 4 am here, sorry Im some dumy now

crystal sonnet
#

The use them

teal hill
#

im asking for is it correct

crystal sonnet
#

I can't tell

teal hill
#

here your lovely stream + collectors
user.getNodes().stream().map(node -> luckPerms.getGroupManager().getGroup(node.getKey().replace("group.", ""))).filter(Objects::nonNull).map(group -> group.getDisplayName() + " ").collect(Collectors.joining())

teal hill
#

got it

crystal sonnet
#

so stream().filter(NodeType.INHERITANCE::matches).map(NodeType.INHERITANCE::cast).map(InheritanceNode::getGroupName)

frank driftBOT
#

Hey kingOf0!! Please don't tag staff members.

crystal sonnet
#

You're welcome

harsh coral
#

thanks for the fast support is there a way someone can walk me through what he said though?

rustic laurel
#

!editor you add the node in the editor

frank driftBOT
harsh coral
#

ok thanks

#

@rustic laurel i am the stupidist 3 fingered kid in the planet (im really not 3 fingered) but it still doesnt work I added a higher priority and nothing still works could it be essentials chat?

frank driftBOT
#

Hey 3 Finger Kid! Please don't tag staff members.

rustic laurel
#

!faq make sure to check the prefix part out here:

frank driftBOT
obtuse jolt
#

thanks for the fast support is there a way someone can walk me through what he said though?
oh haha that was me

#

@harsh coral can you check /lp user <playername> info if the prefix is correct for this command's output?

harsh coral
#

thanks for the help guys IM SUCH AN IDIOT and realized i didnt have vault HAHAHA and you need that for it to work :((

serene haven
#

How do i learn what a node holds?

#

node.getKey just holds a string

#

but how do i find out what that string will hold

#

does it hold the permission name?

burnt summit
#

What method do I need to use to get a user's current group/place in track?

rustic laurel
#

!api I think it's on here somewhere

frank driftBOT
crystal sonnet
#

@serene haven yes that’s the permission

stoic bough
#

How can i obtain a api instance with velocity

#

Without singleton?

#

forget it

left heart
#

LuckPerms lp = new LuckPermsApiProvider(?);

#

What do i have to put at the question amrk ?

#

*mark

stoic sail
#

Hello so Im having a problem with this plugin, so i have the worldedit set as true, so it'll work for a rank but it doesnt work. Same with another command

rustic laurel
#

@stoic sail #support-1 unless this has to do with the API. The command you're running is not the right command, try lp group <group> permission set <permission>

stoic sail
#

Sorry I just joined and the discord is very confusing to me.

crystal sonnet
#

What's confusing about it? @stoic sail

stoic sail
#

I thought that general wasnt for helping cause of the chat name

crystal sonnet
#

That's why channels have a description

stoic sail
#

yeah but the name and categlory didnt help. It wouldnt be my first guess when I first join to go to general.

fallow blaze
#

I wrote this method to check for a user's permissions on bungee, it keeps coming up with false even though the user's group has the permission set as true:

    public CompletableFuture<Boolean> hasPermission(String permission) {
        return Main.getLuckPermsAPI().getUserManager().loadUser(uuid)
                .thenApplyAsync(user -> {
                    ContextManager contextManager = Main.getLuckPermsAPI().getContextManager();
                    ImmutableContextSet contextSet = contextManager.getContext(user).orElseGet(contextManager::getStaticContext);
                    CachedPermissionData permissionData = user.getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
                    System.out.println(permissionData.checkPermission(permission).asBoolean());
                    return permissionData.checkPermission(permission).asBoolean();
                });
    }
#

(ignore the sout, it's there for testing)

#

Can someone take a look at the logic for me please?

rustic laurel
#

As soon as someone with the right knowledge is available, they will 🙂 I'd check it but I don't really know what I'm doing haha

fallow blaze
#

haha, thanks dw

nocturne elbow
#

How can i get the possible groups?

surreal crown
#

Hello o/
Where's the difference between user.data().add(node) and user.getNodes().add(node) ?

Thanks in regards 🙂

nocturne elbow
#

Hi how can i get all permissions added to a group with the luckpermsAPi

icy patrol
#

Hello, I have a problem with inherited groups where I want only one permission to be resolved from each group. So at each group I have added a new permission and made the node inherited from the previous group set to 'false' but my plugin still resolves the node that is false. How can I override the inherited permission, and prevent my plugin from resolving it.

#

So my group "Platinum" inherits from "Gold" and has matsuque.default.platinum true and matsuque.default.gold false, but my plugin still resolves matsuque.default.gold for players in that group, using the method resolveInheritedNodes(QueryOptions.defaultContextualOptions()

#

How can I stop the plugin from resolving the inherited node when it is false

teal hill
#

vault's Permission class has method playerAddGroup(world, player, group)
what should I wrote there for global? -"GLOBAL" fixed.

#

@icy patrol filter false nodes

dusky wagon
#

how i add permission to a player, in a spectify world/server

icy patrol
#

How can I do that using that method?

hollow geyser
#

Hello my luckperms friends :)

Im using right now Nukkit (Bedrock Serversoftware) with Luckperms v5
And im developing on my plugin right now.

My Problem: I dont know how to give a temporary group to a user with the api. Already looked thru the wiki !
I just want to give a player a temporary group. Like... 3 Months. (Like this: /lp user NAME parent addtemp Premium 5mo)

My crap temp-solution: Do it via the cmd /lp user/group <user|group> parent addtemp <group> <duration> [temporary modifier] [context...]

icy coral
#

i need help

rustic laurel
spiral cedar
#

Is there a way to get the servers current context?

rustic laurel
#

With the API?

crystal sonnet
#

Check the ContextManager class

#

@spiral cedar

#

@hollow geyser node builds let you set an expiry

#

@icy patrol stream them and filter out the false ones

hollow geyser
#

Can you explain me that like for dummies

crystal sonnet
#

*node builders

#

The API has node builders

#

That is explained in detail on the wiki

#

!api

frank driftBOT
crystal sonnet
#

Not sure on which one of those two

#

But one of them has the explanation

hollow geyser
#

ok I will try

icy patrol
#

How can I filter the stream for negated nodes? I currently have ...stream().filter(NodeType.PERMISSION::matches)

icy patrol
#

Idea, thank you

serene haven
#
java.lang.NoClassDefFoundError: net/luckperms/api/LuckPerms
    at me.justugh.hopper.SCHoppers.onEnable(SCHoppers.java:36) ~[?:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched.jar:git-PaperSpigot-"4c7641d"]
#

How do i stop the noclassdef error?

#

I'm trying to use the luckperms API rather than importing luckperms itself

#

probs because im trying to use api v5 when im using v4 lp

#

a more simple question

#

how do i get all of the nodes active on a player

#

I'm looking at the API which shows getDistinctNodes which only looks at the nodes on the user itself

#

what about the list containing their group permissions and user permissions

#

does that exist?

crystal sonnet
#

@serene haven

because im trying to use api v5 when im using v4 lp
Correct

#

The API was completely reworked between v4 and v5

serene haven
#

is what im talking about resolveDistinctInheritedNotes?

serene haven
#

ah so i gotta iterate through both myself

crystal sonnet
#

@serene haven what do you mean?

delicate marsh
#

My plugin seems to be giving errors when trying to get permission data from users, it all worked fine before and I didn't update any plugins on the server. This is a bungeecord plugin fyi.

[22:21:28] [Netty Worker IO Thread #6/WARN]: Error dispatching event PermissionCheckEvent(sender=[removed username], permission=royalstaff.join, hasPermission=false) to listener me.lucko.luckperms.bungee.listeners.BungeePermissionCheckListener@58dea0a5
java.lang.IllegalStateException: No permissions data present for player: [removed username] - [removed uuid]
    at me.lucko.luckperms.bungee.listeners.BungeePermissionCheckListener.onPlayerPermissionCheck(BungeePermissionCheckListener.java:65) ~[?:?]
    at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
    at net.md_5.bungee.event.EventHandlerMethod.invoke(EventHandlerMethod.java:19) ~[FlameCord.jar:git:Travertine-Bootstrap:1.15-SNAPSHOT:9cdd70e:unknown]
    at net.md_5.bungee.event.EventBus.post(EventBus.java:46) ~[FlameCord.jar:git:Travertine-Bootstrap:1.15-SNAPSHOT:9cdd70e:unknown]
    at net.md_5.bungee.api.plugin.PluginManager.callEvent(PluginManager.java:384) ~[FlameCord.jar:git:Travertine-Bootstrap:1.15-SNAPSHOT:9cdd70e:unknown]
    at net.md_5.bungee.UserConnection.hasPermission(UserConnection.java:504) ~[FlameCord.jar:git:Travertine-Bootstrap:1.15-SNAPSHOT:9cdd70e:unknown]
    at space.guus.plugins.royalstaff.events.JoinEvent.onJoin(JoinEvent.java:25) ~[?:?]
#

Not using the API, but I don't think the other channels would be the correct ones. Just a player.hasPermission()

crystal sonnet
#

@delicate marsh check for previous errors (especially during startup). And this belongs in #support-1 (or 2)

tacit grove
#

Can I remove all the people who are in a certain group

#

?

rustic laurel
#

Using the dev api? Or just in general?

tacit grove
#

With luckperms

crystal sonnet
#

That didn't answer the question

tacit grove
#

Minecraft

#

Chat

crystal sonnet
tacit grove
#

?

crystal sonnet
#

This channel is for plugin devs working with the LuckPerms API

#

If you need help with using the plugin use one of the general channels

#

They are for LuckPerms support

dusky wagon
#

how i add permission to a player, in a spectify world/server

rustic laurel
#

!context @dusky wagon but #support-1 is the place to ask unless you mean with the dev api

frank driftBOT
jolly jewel
#

Hello, can somebody explaint me how I can get the prefix / suffix from the group? I tried it with "getGroupManager().getGroup(user.getPrimaryGroup());" but there is only the "getDisplayName" method. Anybody can help m,e?

uncut panther
#

why not change the api to the following:

String prefix = LuckPerms.getApi().getUser(Player.getUniqueId()).getPrefix();

Much handier 🙂

rustic laurel
#

Make a suggestion on the GitHub @uncut panther Luck might really appreciate it (also he loves PRs so if you're up to it and can do it yourself, and it makes the plugin better, he'd really appreciate it!)

jolly jewel
#

@uncut panther Doesnt work. I think you are not using the newest API?

azure latch
#

He's suggesting a change to the API...

jolly jewel
#

oh lol, now i see it

crystal sonnet
waxen yarrow
#

I am making a plugin that allows users to be promoted along track.
The following error occurred.
`[07:07:25 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'promote' in plugin RankManager v0.1
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]

(Omitted)

at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]

Caused by: java.lang.NullPointerException
at me.lucko.luckperms.common.model.Track.promote(Track.java:278) ~[?:?]
at me.lucko.luckperms.common.api.implementation.ApiTrack.promote(ApiTrack.java:94) ~[?:?]
at work.raru.spigot.rankmanager.commands.GroupUtils.promote(GroupUtils.java:27) ~[?:?]
at work.raru.spigot.rankmanager.commands.PromoteDemote.promote(PromoteDemote.java:78) ~[?:?]
at work.raru.spigot.rankmanager.commands.CommandManager.CommandExec(CommandManager.java:9) ~[?:?]
at work.raru.spigot.rankmanager.Main.onCommand(Main.java:71) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
... 15 moreHow can I solve this? The following is part of my source codeUser user = LPapi.getUserManager().getUser(UserUUID);
@Nullable
Track track = LPapi.getTrackManager().getTrack(trackName);
Main.logger.info(user.getUsername());
Main.logger.info(track.getName());

@NonNull PromotionResult result = track.promote(user, null); //row 27`
On the console, the track name and player name were correctly output

Use Google Translate

crystal sonnet
#

You obviously can't pass null for the context on line 27 @waxen yarrow

#

Use ContextManager#getDefaultContext

serene haven
#

For that code, it only checks for the nodes attached to the user correct?

#

So if I want to check the user and the group I'd have to check both?

#
public static boolean hasPermission(User user, String permission) {
        ContextManager contextManager = Main.getInstance().luckPerms.getContextManager();
        ImmutableContextSet contextSet = contextManager.getContext(user).orElseGet(contextManager::getStaticContext);

        CachedPermissionData userPermissionData = user.getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
        CachedPermissionData groupPermissionData = Objects.requireNonNull(Main.getInstance().luckPerms.getGroupManager().getGroup(user.getPrimaryGroup())).getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
        return userPermissionData.checkPermission(permission).asBoolean() || groupPermissionData.checkPermission(permission).asBoolean();
    }```
#

That's my fix for it to check both

crystal sonnet
#

@serene haven no. The resolved methods include inheritance

#

But to check permissions, use User#getCachedData and use the checkPermission methods there directly

#

They include inheritance

rustic laurel
#

!api @nocturne elbow look here

frank driftBOT
surreal comet
#

The api works with bungee LuckPerms too?
If so, How I set the services manager on bungee?
Same way as bukkit?

#

Wait what?

#

[Ping me]

crystal sonnet
#

@surreal comet just use the singleton

surreal comet
#

ok

#

tanks

lucid lodge
#

How to get the prefix of a group specifying the players goup name? using api?

crystal sonnet
#

I can't follow you

#

Do you want the player's prefix (which includes prefixes from groups they inherit) or do you want a group's prefix?

rustic laurel
#

group's prefix (check g1)

crystal sonnet
#

Are you sure you don't want the player's prefix?

#

99/100 cases when people ask for the group prefix they actually want the prefix the player has (including inherited ones)

lean crypt
#

to get the SERVER_KEY context of something, would I need LuckPerms API for this? Sponge API doesnt seem to offer SERVER_KEY

crystal sonnet
#

Can you elaborate?

lean crypt
#

Sorry

#

Some screens

#

I'm trying to add a permission to a Player. I'd like the context to be SERVER (the server they are currently on)

#

Sponge only offers these options under Context

#

Was wondering if I have to depend on LP to get/set a permission with a SERVER_KEY

crystal sonnet
#

If the Sponge API doesn't offer it, you need to use the LP API

#

But be aware that you need to use completely for that

#

Like there's no Context Keys you can suddenly use

lucid lodge
#

@crystal sonnet if my argument is for example "owner" I want it to return the prefix of he owner group

frank driftBOT
#

Hey TeAm6_AZLIK! Please don't tag staff members.

crystal sonnet
#

@lucid lodge Use the GroupManager to get the Group instance

#

And then get the prefix like normal

#

!api

frank driftBOT
crystal sonnet
#

Check the javadocs that are linked on the first page

lucid lodge
#
Use the GroupManager to get the Group instance``` that I have already done
#

but than I'm stuck

crystal sonnet
#

Get chached data and then get the prefix

crystal isle
#

Where in the LuckPerms's source code can I change the credit messages?

crystal sonnet
#

For what purpose?

crystal isle
crystal sonnet
#

That's not the credit message, but ok

crystal isle
#

but where can I change it cause I can't change in lang.yml

#

BrainStone possible to help?

crystal sonnet
#

I don't know where to change it

lucid lodge
#

Brain, do I need this? queryOptions

crystal sonnet
#

Yes

lucid lodge
#

I can't find how I need to use this getMetaData

#

Like what argument does it need to have

nocturne elbow
#

hey guys who can configure my lucky perms.. all i need is for it add the prefix to the chat. im willing to pay..

#

hey does anyone know how to work the prefixes

vestal rock
#

Hi. Any bukkit/spigot discord server where I can ask some questions? This was the closest I could find. Anything official?

neat jackal
vestal rock
#

Perfect. Thank you.

crystal sonnet
#

@nocturne elbow what do you mean with “work the prefixes”?

nocturne elbow
#

yeah @nocturne elbow i cant get my prefixes working

#

my prefixes are showing the name of the world and not the prefixes i set

rustic laurel
#

@nocturne elbow what chat formatting plugin are you using? Towny and Multiverse can both do that, what you need to do is pick a chat formatter and disable the chat formatting everywhere else, and use the correct placeholders to show prefixes. Also, please respond in #general since I don't think the prefix showing the world has anything to do with the Luckperms developer API. If it somehow does, feel free to correct me and carry on here

nocturne elbow
#

I need help

#

I have a mod that makes me be in op 2 use it

#

How do I make a role 2 change that

rustic laurel
#

!api follow these links and see what you can learn from em

frank driftBOT
umbral bough
#

is there a way to clear a user's group and set a new one? I see User#setPrimaryGroup(String) but i dont think this clears other groups

#

i have a group name that I want the user to have, and they should only have this one group

nocturne elbow
#

Sorry for the stupid question, but how can I add permission to a player? I know how to create nodes but not how to apply them to the player.

nocturne egret
#

nope nope this is the dev channel I can’t help here

surreal yacht
#

need we to add the luckperm.jar to the plugin or just a "import"

crystal sonnet
#

!api

frank driftBOT
crystal sonnet
#

@surreal yacht @nocturne elbow

#

@umbral bough add the new inheritance node and remove all others

scarlet juniper
#

Hello Guys! I just started to work with LuckPerms API. I've already read the documentation but I am having a hard time here understanding the node structure.
I know what a node means but I am not being able to create a perm group with a suffix ( for example )
I am creating a node with Node.builder().builder() but it only creates the node. I was looking for the SuffixNode but I didn't understand how to link it to the first node I created.
I know this is a noob question but I would like having some help to understand how to make it work 🙂

crystal sonnet
#

@scarlet juniper what do you mean "link it to the first node you created"?

#

You make a suffix node with SuffixNode.builder()

scarlet juniper
#

thank you for you answer.
I meant if I want to create a simple group and add a suffix and a prefix for it? the prefix/suffix nodes would be sub-nodes of the simple one, right?

crystal sonnet
#

What?

#

A node is a node

#

The type only deterimines the behavior

#

Not the usage

scarlet juniper
#

but can a node have nodes under it?

crystal sonnet
#

What?

#

I'm starting to doubt you understand the node structure

#

What would a sub node even look like?

scarlet juniper
#

for example, I would like to have a group in my server like VIPS
I have a node for the group VIPS ( I imagine this is a node )
and I would like this group have a prefix [VIP]. would this data (prefix) be another node?

crystal sonnet
#

Groups aren't nodes

#

They are groups

#

Group assignments are nodes

#

But that's different story

#

Prefixes and suffixes are nodes

scarlet juniper
#

ok, I am understanding my misunderstood. I thought groups were nodes as well.. That what I meant with "link it to the first node"

#

I was actually trying to add a node to a group

crystal sonnet
#

That's how it is being done

scarlet juniper
#

gotcha. let me try to read the documentation again having it in my mind. thank you very much!

crystal sonnet
#

You're welcome

meager moat
#

Is it possible to create my own migration for another plugin?

umbral bough
#

is this the right way to ensure that a user only has the group "rank" and none of the other groups in "configRanks"

meager moat
#

not sure if equals works

#

wait nvm

umbral bough
#

well its a string

meager moat
#

I thought you were using a rank object or smth

umbral bough
#

im more wondering about the add and remove

meager moat
#

It should

#

Best way to find out is to try

umbral bough
#

well it may work but idk if its the most efficient way

meager moat
#

honestly

#

it shouldn't make any difference

#

as its a simple for loop

#

unless you have thousands of "configRanks"

#

Also just a question, why are you adding "group."+rank permission to a user?

#

That seems kinda pointless as you can literally get the groups using the api

umbral bough
#

pretty sure thats how you add a group to a user

meager moat
#

idk

umbral bough
#

well not necessarily

#

its a time tracker plugin

meager moat
#

There should be a function for it

umbral bough
#

and i dont want to remove ranks that are not in the config to be tracked by time

meager moat
#

I mean this should do?

#

You're looping through the ranks you wanna check

#

If its not the one you want, remove it

umbral bough
#

yup

meager moat
#

In theory it should work

crystal sonnet
#

@meager moat sure. Why wouldn't that be possible

#

I doubt the API is enough though

#

You probably need to hook into the plugin itself

meager moat
#

for luckperms?

#

yeah how would I though

crystal sonnet
#

Take a look at how the other migrations are implemented

#

And then try to mirror that

meager moat
#

Are they automatically detected?

#

Or do I need to try and add them manually

crystal sonnet
#

You could either make your own extension plugin or make a PR

#

Are what automatically detected?

meager moat
#

migrations

#

or do I need to register it somewhere

#

also for now I'll have it in my servers plugin to migrate, after that if its working I can consider contributing it

#

Okay yeah looks like they're pre registered

#

I'd need to try and hack the migrations parent command and somehow insert it

#

Wait why am I trying to do it through luckperms itself

#

I can literally write a script to use both plugins apis

crystal sonnet
#

Well, I'm pretty sure you can register another migration later

#

No need to hack anything

#

Or fork LuckPerms as is to add the migration

meager moat
#

Why can't you straight up get the groups from a User object

#

You gotta loop through all nodes and check if its the group you want

#

I just loop through all groups and check if the player has it

#

Then add it to a list

crystal sonnet
meager moat
#

Nice

crystal sonnet
#

Just add your suggestion there

crisp aspen
#

guys
is there any way to make rankup with money on luckyperms

crystal sonnet
nocturne elbow
#

Is this not how you set a user's primary group to owner?

LuckPerms api = LuckPermsProvider.get();

...

api.getUserManager().getUser(p.getUniqueId()).setPrimaryGroup("owner");
azure latch
#

Make sure you save the changes

crystal sonnet
#

Setting the primary group selects which of the groups the player has is the primary one. It doesn’t assign any groups @nocturne elbow

#

Have a look here

#

!api

frank driftBOT
nocturne elbow
#

Oh I see, thanks

#

So to add a group to a user it would be

DataMutateResult result = user.data().add(Node.builder("group.owner").build());

?

crystal sonnet
#

@nocturne elbow use the inheritancenode builder

dim mirage
#

How do I retrieve '2' from the permission nucleus.home.set.limit.2 when I've got the PermissionData of a user?

#

Or do I need to use MetaData?

cold panther
#

Realistically, you need MetaData, yeah

dim mirage
#

So would I need to use getSuffix() after I get the MetaData?

#

or does that method return the player suffix?

crystal sonnet
#

It returns the player suffix

#

I’m pretty sure nucleus stores the permission data in meta directly

dim mirage
#

Oh wait I think I got how this works now, thx. Figured out what I needed.

nocturne elbow
#

I need help! How can i copy my Perms from PEX to LuckPerms?

surreal yacht
#

I use spigot 1.14.4

#

and there is a lot of error could you help me

fallow blaze
#

Is there an event for when a parent of a user is updated?

crude laurel
#

I'm having trouble with the events

#
eventBus.subscribe(NodeAddEvent.class, this::onNodeAdd);
eventBus.subscribe(NodeRemoveEvent.class, this::onNodeRemove);
#

the events dont fire

crude laurel
#

still needing help

crystal sonnet
#

@surreal yacht you can't have a method inside another method

#

I'd recommend you learn Java basics first

#

Minecraft plugins are not easy to make and go beyond what you can achieve with copy-paste

#

@crude laurel is the eventBus the LuckPerms even bus?

neat jackal
#

Hey, what does this have to do with the Developer API?

eternal remnant
#

Can someone help with how to give players permissions? I want to make a plugin that will give a specific player a permission when they do something
thanks

rustic laurel
#

!api probably has what you need

frank driftBOT
eternal remnant
#

nah

rustic laurel
#

Perhaps be more specific on what you need?

eternal remnant
#

I figured it out

#

anyway

wary kiln
#

Hi everyone. Is there a way to get the weight of a group? I'm currently looking for a way to get a group with highest weight so I can show normal player when their group is expired.

Currently. I have these group. rank and rankplus
The rank group have 1000 weight
The rankplus group have 800 weight.

Why the getPrimaryGroup() return the rankplus instead of rank?

rustic laurel
#

!api check out both of these links, they may help you

frank driftBOT
wary kiln
#

Thanks I already check but I cannot figure out how I can get weight of a group

surreal yacht
#

Hello, if someone does not know what to do and he wants to help me with the plugins he will be welcome

rustic laurel
#

@surreal yacht if this has to do with the Luckperms Developer API, be more specific. If not, but you need Luckperms help, use #support-1. If not Luckperms at all, use #general

surreal yacht
#

I would like a plugin to buy grades for virtual money (vault) I use spigot 1.14.4

rustic laurel
surreal yacht
#

Why its not off-topic It's with Luckperm api

rustic laurel
#

Luckperms API has nothing to do with finding another plugin that will provide grades (ranks?) for vault money. There is literally no conceivable relation.

pine mulch
#

is there a way to make it so a person only has access to a command in a certain world

surreal yacht
#

!api

frank driftBOT
charred shell
#
eventBus.subscribe(??, event -> {
    System.out.println("users parent got changed");
});

Is there any event to check if the users parent got changed? (lp user %user% parent set %group%)

#

Is there an event for when a parent of a user is updated?
@fallow blaze Did you find it?

fallow blaze
#

I did not in the end

#

I worked around with different logic instead for what I needed it for

#

If you do ever find it though, please let me know xD

charred shell
#

Just asked but I think it doesn't exist

#

@fallow blaze

Nametagedit uses this, maby this works

  public HookLuckPerms(NametagHandler handler) {
    this.handler = handler;
    LuckPerms api = LuckPermsProvider.get();
    EventBus eventBus = api.getEventBus();
    eventBus.subscribe(UserDataRecalculateEvent.class, this::onUserDataRecalculateEvent);
  }
  
  private void onUserDataRecalculateEvent(UserDataRecalculateEvent event) {
    User user = event.getUser();
    Player player = Bukkit.getPlayer(user.getUniqueId());
    if (player != null)
      this.handler.applyTagToPlayer(player, false); 
  }
fallow blaze
#

I guess, this covers every time someone's data is changed

#

Rather than just when a parent is changed (as far as I know)

charred shell
#

Uhhg 😫

charred shell
#

@fallow blaze I did it 😄

#
eventBus.subscribe(LogNotifyEvent.class, event -> {
    if (event.getEntry().getDescription().startsWith("parent set")) {
        String username = event.getEntry().getTarget().getName();
        System.out.println("users parent got changed (" + username + ")");
    }
});
fallow blaze
#

Does it show the old and new parent?

#

Or just the new

charred shell
#

Just the new

#

But al least it works haha

crystal sonnet
#

@charred shell use the UserDataRecalculateEvent and filter it in the same way

wintry token
#

so I'm new to this...
is this somehting bad or just conflicting pluggins?
[13:34:34] [Server thread/WARN]: Legacy plugin NoCheatPlus v3.16.0-RC-sMD5NET-b1134 does not specify an api-version.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by me.lucko.luckperms.common.dependencies.classloader.ReflectionClassLoader (file:/Users/mac/Desktop/MineCraft_Server/minecraft/plugins/LuckPerms-Bukkit-5.0.72.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of me.lucko.luckperms.common.dependencies.classloader.ReflectionClassLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

rustic laurel
#

That's an error we know about, and you can safely ignore it if everything is working

wintry token
#

woot

crystal sonnet
#

Also this is the wrong channel

#

And even if not everything is working, you can ignore this

jovial breach
#

How can i obtain the prefix of a group/player?

rustic laurel
#

!api it's on here, pretty sure, take a look!

frank driftBOT
crude laurel
#

Does User#getDistinctNodes() return group nodes as well?

#

or how i can get a list of groups a player belongs to

crystal sonnet
#

Yes that includes them

velvet tangle
#

How can I get the player group prefix etc. ?

rustic laurel
#

!api it's on here

frank driftBOT
nocturne elbow
#

how can i create a context that checks if the player has enough money using lp and vault?

crystal sonnet
#

!api

frank driftBOT
nocturne elbow
#

ye i tried but i don't know java very well and my code ended up having a lot of errors

#

so i was wondering if someone could make that for me

obsidian helm
#

Can i use it with forge 1.12.2 mod?

#

i need to add permissions for commands from my mod

raw remnant
#

Hi, I am new to java development so please try to be patient.
I have added the dependecy for Maven in my pom.xml, how can I get the prefix of a user? I know I can use String prefix = metaData.getPrefix(); but where do I get the metadata from?

#

How would I get the user in the first place, and what are the "contexts"

crystal sonnet
#

@obsidian helm use the forge permission API

obsidian helm
#

ok

#

Thank you!

crystal sonnet
#

You’re welcome

tropic lily
#

Can I have some help with Prefixes?

#

It won't make them show up

nocturne elbow
#

I have the same problem, on bungeecord

vagrant cape
#

Hello, I am trying to understand your API, but I still cannot understand how I can get the prefix of some group.

rustic laurel
#

!api has good resources

frank driftBOT
rustic laurel
#

both links too

vagrant cape
#

I'm on that site, but I still don't understand, xd, I think I'm retarded.

rustic laurel
#

Well I'm not too knowledgeable on this side of the plugin, but if you ask a detailed question, I'm sure someone that knows will answer when they can

vagrant cape
#

I'll try, I don't speak English, I manage with the translator.

#

I want to know how to get the prefix of a range, to save it in a variable and use it later for other things.
since the prefix itself already has details it is better than obtaining the name of the rank that the player has.

vagrant cape
#

achieved xd, these things are hidden in the api, I had to experiment with the wiki and the code.

User user = plugin.getApi().getUserManager().getUser(player.getUniqueId());

String prefix = plugin.getApi().getGroupManager().getGroup(user.getPrimaryGroup()).getCachedData().getMetaData(QueryOptions.defaultContextualOptions()).getPrefix();

crystal sonnet
#
User user = plugin.getApi().getUserManager().getUser(player.getUniqueId());
ContextManager contextManager = plugin.getApi().getContextManager();

String prefix = user.getCachedData().getMetaData(contextManager .getQueryOptions(user).orElseGet(contextManager::getStaticQueryOptions)).getPrefix();
#

@vagrant cape

vagrant cape
#

oh

#

thx

#

.<

wanton sedge
#

I have a question

#

Do the placeholders from luckperms work in strings (Java)?

#

like if I do sender.sendmessage("%luckperms_prefix% Is you current prefix")

crystal sonnet
#

No

wanton sedge
#

So i have to create a variable?

crystal sonnet
#

Oh boy

#

I highly suggest you learn Java first

#

Else this will be nothing but a frustrating struggle for you and everyone you ask for help

wanton sedge
#

I started 2 months ago

#

I know Python and HTML

#

but I guess thats not something you could be proud of 😄

crystal sonnet
#

I started 2 months ago
Programming or Java?

wanton sedge
#

Java

#

Its a bit confusing, but I am starting understanding the whole thing

#

(But I am still stupid)

crystal sonnet
#

Placeholders are nothing built it

#

You need to call the right APIs to replace them with their content

wanton sedge
#

ok

#

So how do I access the players prefix?

#

(I dont speak English well so I have a bit trouble with the Github page)

real gulch
#

Quick question how do i check if a player have a certain permission

wanton sedge
#

if(player.haspermission("permission"))

#

I guess you use "sender" as "player"

#

I have a question too, how do you change the players parent

real gulch
#

I mean, obviously with LuckPerms...

wanton sedge
#

In java

#

Should be smthing like Luckperms.Changeparent ?

#

Btw can someone send me the download link of the dev api, I think I got the wrong one...

#

it is the file called api-5.0.jar , right?

#

and

crystal sonnet
#

@real gulch why? What's wrong with using the platform method?

#

!api @wanton sedge

frank driftBOT
wanton sedge
#

Quick question:

#

i want to make a random color system

#

ist this right:

#

int r1i = r.nextInt(17) + 1;
int r2i = r.nextInt(17) + 1;
Color c1 = Color.fromBGR(r1i);
Color c2 = Color.fromBGR(r2i);

#

ok got it

real gulch
#

What Is the platform method?

crystal sonnet
#

player.haspermission("permission")

#

@real gulch

real gulch
#

Does not work on bungee

#

Sometimes works, sometimes dont

hardy badge
#

How would I query a player's metadata? The API has a usage but is there something I'm missing because my IDE does not see MetaData as a valid variable type

thorny echo
#

@hardy badge Can't remember the exact specifics but there's a CachedMetadata involved somewhere, think you need to grab the metadata for a specific context set and it'll give you cached metadata

#

The wiki has a guide on it though

crystal sonnet
#

@real gulch what exactly are you doing?

#

And what do you mean with working

real gulch
#

Im iterating over every server and player inside them

#

And filtering ProxiedPlayers with certain permission

#

I did ProxiedPlayer#hasPermission

#

But didnt work for inherit permissions

crystal sonnet
#

Are the groups server specific?

real gulch
#

Im unsure about that

crystal sonnet
#

Verify that please

#

Because that’s relevant

real gulch
#

So if those are server specific may not work?

#

Needs to be global?

crystal sonnet
#

If they are server specific you need to apply them differently for it to work on the bungee too

real gulch
#

Oh i see

#

There is any way to check it with nodes so i dont rely on global perms?

#

Just in case

crystal sonnet
#

I mean the group assignment @real gulch

real gulch
#

Oh, groups

#

My bad

crystal sonnet
#

And you can check with /lpb user <user> info

real gulch
crystal sonnet
#

I see

#

Was that player online?

real gulch
#

No

crystal sonnet
#

Ok

#

Well I’m starting to get a stomach ache. I’ll be back later

real gulch
#

But im only iterating over online players

#

Ok, thanks for your time

oak badger
#

that sucks,. hope you feel better stone

crystal sonnet
#

Thank you

wanton sedge
#

Need help: I created an inventory shop GUI and it works good, for example if you click on the sword it'll remove 100.000$ from you and you'll get it. But if you do a shiftclick, it'll give you the sword twice if you have the money, and once even if you don't have the money.

Any Ideas?

crystal sonnet
#

You need to cancel inventory move events. Also this would belong in #general

wanton sedge
#

sorry

#

"You need to cancel inventory move events."

How do I do that???

#

OK ill just google it 😄

#

sorry for being stupid and annoying

earnest zodiac
#

Hey,
I want to get all group of a User with LuckPerms's API.

earnest zodiac
#

?

opal snow
#

how do you add/remove a user from a group in the api? Any example I'm finding are using the old api

crystal sonnet
#

!api @earnest zodiac @opal snow

frank driftBOT
opal snow
#

yeah i've searched those pages

crystal sonnet
#

Those are up to date

opal snow
#

but they don't answer my question

crystal sonnet
#

How to do it is explained pretty well

#

Just add the appropriate node

opal snow
#

but a group is a Group object, not a Node

crystal sonnet
#

But they are represented by nodes in the data

earnest zodiac
#

I want to get a list of the user groups

opal snow
#

so I have a User object and a Group object, I want to add User to Group. I don't see anything in the docs that tell me how to do that.

neat jackal
opal snow
#

How can I have dual prefixes through the API (basically setup a group that I create to be an additional prefix rather than replacement)

stray dock
#

Hello. It's going LuckPerms to support nukkit 2.0?

languid socket
#

Hey, are there javadocs for the V5 api yet?

neat jackal
#

!api Yes they are, a link should be on one of those pages:

frank driftBOT
stray dock
#

I maked a PR for 2.0 Nukkit

#

LuckPerms uses Gson ?

rustic laurel
#

not sure what you really mean. Best to ask luck through the GitHub issue

stray dock
#

Yes, it uses. I checked the code

raven dome
#

In the luck editor is there a way to check everything instead of going one by one?

golden tide
#

!rank

frank driftBOT
#

Sorry! I do not understand the command !rank
Type !help for a list of commands.

golden tide
#

!help

frank driftBOT
#
Available commands:
-

!advanced
!api
!argumentbased
!bulkupdate
!bungee
!cauldron
!colours
!commandequivalents
!commands
!config
!context
!default
!downloads
!editor
!errors
!essentials
!extensions
!faq
!helpchat
!install

-

!locale
!meta
!migration
!notworking
!nowildcard
!pasteit
!permissions
!placeholders
!selfhosting
!stacking
!storage
!switchstorage
!sync
!tracks
!upgrade
!usage
!userinfo
!verbose
!whyluckperms
!wiki

golden tide
#

!api

frank driftBOT
golden tide
#
plugin.getLuckPerms().getUserManager().getUser(target.getUniqueId()).setPrimaryGroup("admin");
#

Is not setting the player to administrator, am I doing something wrong?

#

No errors

golden tide
#
UserManager userManager = plugin.getLuckPerms().getUserManager();
                    CompletableFuture<User> userFuture = userManager.loadUser(target.getUniqueId());
                    userFuture.thenAcceptAsync(user -> {
                        user.setPrimaryGroup("vip");
                        userManager.saveUser(user);
                    });
#

Tried doing it that way, still no result.

cunning fractal
#

!api

frank driftBOT
cunning fractal
#

!permissions

frank driftBOT
rustic laurel
#

What are ya looking for my dude?

cunning fractal
#

I need a help for get permission

#

and set

rustic laurel
#

with the developer api?

cunning fractal
#

yes

rustic laurel
#

it's on one of the two api links you summoned

cunning fractal
#

I need to set a specified permission for a player and take the same player or player offline.

rustic laurel
#

or a bit from both haha

cunning fractal
#

i not found ; -;

rustic laurel
#

then say exactly what you need to do and someone who knows will help when they can

cunning fractal
#

In this same chat?

rustic laurel
#

yep

cunning fractal
languid socket
#

Import luckpermsapi

rich ferry
#

i have a question about making a plugin not with LuckPerms api in #general 😐 someone pls help 🙂

warped bear
#

how do i set it up to where i have spawn protection but people can still interact with things like chests

candid hawk
#

How can I give sombody a role in a plugin?

stray dock
#

@jaunty pecan Sorry for tag

frank driftBOT
#

Hey NycuRO! Please don't tag staff members.

stray dock
#

I just wanted you to know i created a PR for Nukkit-2.0

jaunty pecan
#

I saw it, thank you

#

I don't really want to merge it though until the 2.0 version becomes the main release

stray dock
#

Yeah, i was wondering about making a new file maybe with nukkit-2.0?

jaunty pecan
#

if we can do it without duplicating the whole nukkit source then sure 😉

modest haven
#

I'm trying to get the Luckperms placeholders to load on NukkitX although even with the PlaceholderAPI plugin it doesn't recognise LuckPerms placeholders.

rustic laurel
#

Did you download the Luckperms expansion? papi ecloud download luckperms and papi reload

modest haven
#

@rustic laurel papi shown as an unknown command.

frank driftBOT
#

Hey Hazard! Please don't tag staff members.

rustic laurel
#

Oops this is for #general channel, I'll tell you there

rich ferry
#

for myself

#

!api

frank driftBOT
obsidian helm
#

!api

frank driftBOT
severe plaza
#

I'm trying to give a user permissions using this bit of code

#
final LuckPerms lp = LuckPermsProvider.get();
NodeMap nm = lp.getUserManager().getUser(uuid).data();

nm.add(Node.builder("essentials.kits.PermKit").build());
#

but when I do nm.add(...).wasSuccessful(), the result is false

#

and the player in question does not have the permission

#

am I missing something?

crystal sonnet
#

@severe plaza you need to save changes to the player

severe plaza
#

thanks!

spring scroll
#

Hello I have a problem can you help me?

neat jackal
#

Maybe

spring scroll
#

I download and add to server Luck Perms

#

and that dont join me and that write

#

Permissions data foryour user was not loaded

#

Please help me

#

during pre login

#

do you know that problem?

crystal sonnet
#

@spring scroll

dusk sinew
#

Hello, I opted for LuckyPerms because Artenos support advised me to manage the permissions of / sethome so that people do not have op can also access it. How can I configure Luckyperms with aternos? Thank you for answering me.

rustic laurel
#

!usage follow this

frank driftBOT
crystal sonnet
#

Aternos is irrelevant btw

dusk sinew
#

What is BTW i'm french, i can't use LuckyPerms with alternos ?

rustic laurel
crystal sonnet
#

I mean it doesn't matter that you use Alternos

#

@dusk sinew

dusk sinew
#

Ok

nocturne elbow
#

Where i can request help ?

rustic laurel
jagged ember
#

How would I do the following

user.clearMatching(n -> n.isPrefix() && n.getPrefix().getKey() == weight);

On luckperms v5 api?
I wanna clear all prefixes with the same weight as the weight variable

jovial breach
#

Is there a option to obtain the api in a bungeecord server?

crystal sonnet
#

Yes. Use the singleton

#

!api

frank driftBOT
jovial breach
#

Actually saw it 😄

hollow geyser
#

I want to get the UUID from the username of an Offlineplayer.

This causes nullpointer

        return LuckPermsProvider.get().getUserManager().getUser(username).getUniqueId();
    }```
#

And I want to check the permission from an offline player

This causes nullpointer too

        LuckPerms lp = LuckPermsProvider.get();
        User user = lp.getUserManager().getUser(uuid);
        
        ContextManager contextManager = lp.getContextManager();
        ImmutableContextSet contextSet = contextManager.getContext(user).orElseGet(contextManager::getStaticContext);

        CachedPermissionData permissionData = user.getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
        return permissionData.checkPermission(permission).asBoolean();
    }```
crystal sonnet
#

@jagged ember check the javadocs NodeType. That should help

hollow geyser
#

Someone can help me ? xD
I need that fixed today

jagged ember
#

Thanks BrainStone, ended up installing the extension for now 👍