#luckperms-api

1 messages · Page 19 of 1

crystal sonnet
#

You can manipulate offline players with LP's commands too btw

maiden vault
#

yes but i can't check if player have new role for send title

crystal sonnet
#

That sentence doesn't make sense

maiden vault
#

I use an custom command because i send an title to the player when promoted to the VIP group for example. If player is not logged i send the title on next login

crystal sonnet
#

You can check if the player has the "new" rank before you start removing things

maiden vault
#

yes i have make that

paper oak
#

Yo I have a question. For some reason Luck Perms in GUI ain't loading on the server I'm on. Any soltuions?

neat jackal
#

Why are you asking this question here?

paper oak
#

Um wrong channel?

neat jackal
#

That, and we don't offically support LPGUI

paper oak
#

O sorry

neat jackal
#

Anyways, #general, might be able to help, if it's a "normal" issue (never used LPGUI but maybe someone else will see it there)

paper oak
#

Alrighty

#

Thanks!

rotund light
#

@crystal sonnet if it's user.unsetPermission(Node), I don't understand the Node part

frank driftBOT
#

Hey Zen! Please don't tag staff members.

uneven radish
#

Hello, if i load a potential offline user async with completable future and he is online, what will happen? DO i have to check first if he is online or is luckperms checking it?

sudden seal
#

Is there a way we can tap into a server's luckperms database for a discord webhook or bot?

silent bough
#

Hey I have some doubts about how something is behaving in specific. When I unset a group or permission on an offline player it's done instantly, but when setting it for an offline player it either doesn't set it or takes an unconfirmed amount of time.

crystal sonnet
#

@uneven radish then the loading will succeed instantly and the async code will be run

#

@rotund light the Node is the actual permission

#

@sudden seal Can you elaborate?

#

Especially on what kind of data you need

#

@silent bough you need to save changes

rotund light
#

Then what permission do I need to put there in order to remove those meta

crystal sonnet
#

The best way if you want to remove something from a player is by iterating over all the nodes they have and filtering for the one(s) you want gone and removing them

silent bough
#

It's not shown in that code but I already do it.

#

And it still happens

crystal sonnet
#

Can you show the code then?

crystal sonnet
#

Please don't do this

#

There's one cardinal sin of prgramming

#

And that's not programming in English (or whatever language the programming language is in)

silent bough
#

Wut?

#

You aren't joking?

#

Only non english words are messages sent to players or 1 or 2 words used internally in our server

crystal sonnet
#

Variable names aren’t English

#

The exception message isn’t English

silent bough
#

That's obvious, players wouldn't understand the message otherwise

#

And there are just a handful of variable names which are used by us

#

Which is what I said in my previous comment

#

If it's not an inconvenience I'd like some help instead of nitpicking some minor details, honestly it's kind of disrespectful

#

I understand you might argue if I'm not willing to code everything in english I shouldn't come here expecting help

#

In such case I'll go elsewhere

crystal sonnet
#

I find it rude having code not English given to me in the expectation for me to find issues in it. Before you complain, my native language isn't English either.

Now back to the topic. I honestly don't know what's going on. If I remember correctly the save method returns if it was successful or not. Try outputting that result

#

And btw, if players see raw expection messages, something is wrong.

lament pulsar
#

i need help

#

how do i make it where defaults can use /world

crystal sonnet
#

Are you trying to do this through your own (custom) plugin? Because that’s what the API is for @lament pulsar

#

If you’re just talking about using the plugin, ask in #support-1

lament pulsar
#

i found out

gloomy anvil
#

Why Am I getting null pointer exception when im trying to set someones primaryGroup??

uneven radish
#

do i have to set temp permissions in another way?

maiden vault
#

Hello, have make and command for promote/demote an user with send title but i don't know how i can reset the primary group to default when revoke user from group

obtuse pecan
#

When i want to change the content of a meta node from a user. i have to delete the old one and set the new one, is this correct?

crystal sonnet
#

Correct

uneven radish
#

Could you please help me?

crystal sonnet
#

If you ask your question @uneven radish

uneven radish
#

I did yesterday just 4 messages ago

crystal sonnet
#

I see

#

Not sure

#

You might want to try to save the changes

uneven radish
#

User user = Util.getPermUser(pi.getUUID());
user.setTransientPermission(perm);
MineconomyWorld.luckPermsApi.getUserManager().saveUser(user);

#

i save them?

#

@crystal sonnet Do you know someone which can help me?

frank driftBOT
#

Hey cerexus! Please don't tag staff members.

uneven radish
#

Sorrry Clippy

crystal sonnet
#

Luck

uneven radish
#

If he read this chat

uneven radish
#

Could you message him with my problem please?

crystal sonnet
#

@jaunty pecan you gotta check this channel more often 😜

nocturne elbow
#

@nocturne elbow are you sure that the person youre calling that on even has a prefix if its null then

#

they do. i tested it with /lp user zbk info

#

how did you get your userContext

#

getContextForUser

#

i think you should be using the context manager

#

ContextManager#getApplicableContexts(player) or ContextManager#lookupApplicableContexts(lpUser)

#

oh its spitting out a IllegalStateException

#

for what

#

ApiUser not being assignable from ProxiedPlayer

#

I know LP has a User object, haven't seen an ApiUser object...

#

me.lucko.luckperms.common.api.implementation.ApiUser

#

interesting

#

oh i was using get instead of lookup

#

still null though

#

is the player online

#

yup

#

Maybe someone in here knows then thonkeyes

nocturne elbow
#

How would I be able to set a users group through the api?

teal tartan
#

!wiki

frank driftBOT
teal tartan
#

Developer section

nocturne elbow
#

I looked through there and I didn't find anything on how to set a users group

teal tartan
#

You load user and set him group.groupName permission then save him

nocturne elbow
#

why is luckPermsApi.getUserManager().getUser(p.getUniqueId()).getPrimaryGroup() returning default when the users primary group is not actually default

teal tartan
#

Are you sure it's not default?

nocturne elbow
#

pretty sure

nocturne elbow
#
Node memberranknode = DiscordLink.getPlugin().getLuckPermsApi().getNodeFactory().newBuilder("group.member").build();
            DiscordLink.getPlugin().getLuckPermsApi().getUserManager().getUser(event.getPlayer().getName()).setPermission(memberranknode);```
So um... is this supposed to work?
uneven radish
#

you have to save

#

public static void addPermission(Player p, String permission) {
LuckPermsApi api = MineconomyWorld.luckPermsApi;
User user = api.getUser(p.getUniqueId());
Node node = api.getNodeFactory().newBuilder(permission).build();
user.setPermission(node);
api.getUserManager().saveUser(user);
}

#

thats working for me

nocturne elbow
#

not for me

#

this is how I use it

LuckPerms.removePermission((Player) Bukkit.getOfflinePlayer(args[0]), "group." + args[1].toLowerCase());
LuckPerms.removePermission((Player) Bukkit.getOfflinePlayer(args[0]), "group." + rank.getName().toLowerCase());```
#

oh wait

#

hold on imma try something

#

It keeps coming up with NullPointerException when I do this: User user = api.getUserManager().getUser(p.getName());

jaunty pecan
#

maybe api is null?

nocturne elbow
#

should metaData.getPrefix() return the value shown in this screenshot?

#

or is that separate from metadata

jaunty pecan
#

yep

#

it should

#

so long as you're using the same contexts

nocturne elbow
#

hmm

#

i just used allowAll

#

interesting

nocturne elbow
#

Api isn’t null, it’s LuckPermsApi api = DiscordLink.getPlugin().getLuckPermsApi()

buoyant bear
#

that doesn't mean it's not null?

lost galleon
#

Yeah its just re-instancing lol

candid flume
#

How do I register a luckperms event?

lost galleon
uneven radish
#

@jaunty pecan Could you please help me with my issue some messages above? (3 days ago at 12:30 pm with a pastebin link)

frank driftBOT
#

Hey cerexus! Please don't tag staff members.

uneven radish
#

Btw. Sorry for marking you

nocturne elbow
#

does getApplicableContexts work with a ProxiedPlayer instead of a regular player

nocturne elbow
#

Nevermind

plain zephyr
#

how do i get the color of a specific rank?

spring reef
#

Is it possible to get all players in a group using the API?

#

Something like api.getGroup("name").getMembers() perhaps?

#

(something which includes offline players)

#

Actually, kind of like the ingame command lp group name listmembers, but using the API

jaunty pecan
#

yep, this method

#

use group.admin as the permission to get members of the "admin" group

spring reef
#

Ah I missed that one, thanks!

jaunty pecan
#

@uneven radish are you getting any errors when running the code, or just not working?

#

sorry for the slow replies in this channel, I've been super super busy :((

uneven radish
#

Hey its okay, thought you oversaw me ^^

#

Thanks for that great plugin btw. it works so nice, this is the only problem with it

#

no errors

#

For me the code looks not false, but maybe i did something wrong

#

permanent permission giving is working with the code some messages above. but the temp permissions not

nocturne elbow
#

so if i understand correctly you should not use CompletableFutures on a sync method?

uneven radish
#

i run tehm in an async task

#

if i would run them sync it should just lag a bit

#

but it should work

nocturne elbow
#

So thenAcceptAsync doesn't run off the main thread?

nocturne elbow
#

if im inside of a async task should i use thenAcceptAsync() or just thenAccept()

uneven radish
#

If you already inside an async task you can use thenAccept

nocturne elbow
#

does the LuckPerms api work with BungeeCord?

tired sequoia
#

Yo. I got a questions

#

How do I setup the setPermission

#

part

#

where is the function

#

I see addPermission

#

public void addPermission(User user, String permission) {
// TODO add the permission

// Now we need to save changes.
luckPermsApi.getUserManager().saveUser(user);

}

nocturne elbow
#
Node permnode = LuckPermsApiThing.getNodeFactory().newBuilder("perm.permission").build();
LuckPermsApiThing.getUserManager().getUser(userstuff).setPermission(permnode);```
tired sequoia
#

then what is this

public void addPermission(User user, String permission) {
    // TODO add the permission
    
    // Now we need to save changes.
    luckPermsApi.getUserManager().saveUser(user);
}
nocturne elbow
#

Oh yeah, you gotta save it too using that

#

I'm just gonna guess the api works with Bungeecord

crystal sonnet
#

Yes it does

nocturne elbow
#

Ok thanks :)

#

RegisteredServiceProvider<LuckPermsApi> provider = Bukkit.getServicesManager().getRegistration(LuckPermsApi.class); how would I be able to do this with BungeeCord?

crystal sonnet
#

The LP API class has a getter

#

And I'm pretty sure it's docmented on the wiki

nocturne elbow
#

LuckPermsApi api = LuckPerms.getApi(); you mean this?

crystal sonnet
#

Yup

nocturne elbow
#

Thanks 👍

signal geyser
#

I don't understand this plugin lmao

glacial aspen
#

hi i am new to luckperms can anybody help me to add players to my groups?

#

it would really help

azure latch
#

You are using the developer API right?

#

@glacial aspen

marsh matrix
#

I don’t think he is lol

#

He just needs basic commands

azure latch
#

That's why i asked

proud crypt
#

wrong channel @glacial aspen

azure latch
glacial aspen
#

ok, thank you

uneven radish
#

@jaunty pecan i know you are super busy at the moment, but it would be super nice if you could help me with that problem :/

frank driftBOT
#

Hey cerexus! Please don't tag staff members.

nocturne elbow
#

Does luckperms work in any way with brigadier for dynamic colored tab completions?

crystal sonnet
#

Yes it does

nocturne elbow
#

can you tell me the section that has the colored tab completion code on github?

#

I've been looking thru it.

uneven radish
#

Are there more devs or is it just Luck?

nocturne elbow
#

just Luck

serene minnow
#

Why isn't there prefixes in tab?

#

How do you put the prefixes above a player's name or tab?

nocturne elbow
#

you need an external plugin to do that. Try looking up a tablist plugin

atomic iris
#

my luck perms is read when i do /plugins and a folder wont create for it can anyone help me

frank driftBOT
#

Hey Blizzard! Please don't tag staff members.

old relic
#

@Blizzard#3696 Restart and see if it creates the folder/has an error in console

uneven radish
#

Hmm :/ hopefully hes back soon

crystal sonnet
#

nah. And wrong channel anyways

agile pine
#

I'm attempting to use LuckPerms api in my Velocity plugin. But for some reason the LuckPerms.getApi() method keeps throwing the IllegalArgumentException in my ProxyInitializeEvent. I have put luckperms as a dependency, is there anything else I missed?

crystal sonnet
#

When are you accessing it?

agile pine
#
 @Subscribe
    public void onProxyInitialization(ProxyInitializeEvent event) {
}
#

so this fires when the proxy initalizes

crystal sonnet
#

That seems right

#

And are you sure it's an IllegalArgumentException and not an IllegalStateException?

agile pine
#

umm let me check

#

oh yes, illegalstateexception: API is not loaded

#

my bad

#

is my gradle wrong?

#

I used this (kotlin DSL): implementation("me.lucko.luckperms:luckperms-api:4.4")

crystal sonnet
#

No

#

That looks right

#

Are you shading the API in?

agile pine
#

I'm not very experienced yet and I'm not 100% sure what that means

#

if you could point me in the right direction that would be great

#

I had the plugin working using a file based system, tried to add luckperms support

#

I have a shadow jar when building if that is what you mean

crystal sonnet
#

Yes

#

Exactly

#

Don't put the LP API in your jar

#

Or any other plugin API

agile pine
#

aha I see, so I should exclude it from my shadow jar?

crystal sonnet
#

Yeah

agile pine
#

okay, great, thanks a lot

crystal sonnet
#

I mean what are you shading in in the first place?

agile pine
#

As I said, not very experienced. I looked at the neutron source code and saw the following lines

#

id("com.github.johnrengelman.shadow") version "4.0.4"

#

and then just execute the shadowJar task to build my jar

#

not quite sure what it does (which I know is not very smart)

crystal sonnet
#

Don't do stuff you don't know

agile pine
#

I mean, i know what it does, just didn't know I couldn't add stuff

crystal sonnet
#

You can't add stuff that's added by other stuff

#

In simple terms

agile pine
#

yes, that makes sense

#

I appreciate the help

crystal sonnet
#

So unless you need a library in your jar because Velocity doesn't provide it, don't use shading at all

agile pine
#

okay, I'll remember that

crystal sonnet
#

And then only shade those libraries is

zenith linden
#
for (char value = 'A'; value <= 'Z'; value++){
                    p.chat("/lp creategroup " + value);
                    p.chat("/lp group " + value + " setdisplayname " + value);
                    p.chat("/lp group " + value + " meta setprefix 1 &8[&a" + value + "&8]&f");
                    p.chat("/lp track prison append " + value);
                    p.chat("/lp group " + value + " parent set A");
                }
                for (int i = 1; i <= 20; i++) {
                    p.chat("/lp creategroup " + i);
                    p.chat("/lp track prestige append " + i);
                    p.chat("/lp group " + i + " meta setprefix 1 &7[&6" + i + "&7]&f");
                    p.chat("/lp group " + i + " parent set A");
                    p.chat("/lp group " + i + " permission set some.shopmultiplier.p" + i);
                }```
Can someone show me how to use luckperms api? The wiki doesn't help me very much in cases like this
uneven radish
#

Nop bc no one knows it here

nocturne elbow
#

I do but I’m too lazy to tell you

uneven radish
#

For sure

zenith linden
#

😦

#

i guess i'll keep looking at the api till i figure it out

#

!wiki

frank driftBOT
zenith linden
#

wait a minute

#

is it this:

#

// build a simple permission node
Node node = api.getNodeFactory().newBuilder(permission).build();

// build a group node
Node node = api.getNodeFactory().makeGroupNode(group).build();

// build a prefix node
Node node = api.getNodeFactory().makePrefixNode(100, "[Some Prefix]").build();

// build a suffix node
Node node = api.getNodeFactory().makeSuffixNode(150, "[Some Suffix]").build();

// build a metadata node
Node node = api.getNodeFactory().makeMetaNode("some-key", "some-value").build();

proud crypt
#

Try it and see what happens

nocturne elbow
#

how do i git help frum @frank drift

#

/clippy

#

!help

#

/help

#

/help

#

.help

#

oof

#

Whoops wrong chat sorry

azure latch
#

@zenith linden yeah, make a node with the permission you want to give, add it to the player, and save it. It's all on the wiki

#

Save the player*

zenith linden
#

i don't think it's all on the wiki

#

p.chat("/lp track prestige append " + i);
p.chat("/lp group " + i + " parent set A");

i can't find these things

#

and this:

#

p.chat("/lp group " + value + " setdisplayname " + value);

drowsy moon
#

How do i get the parent with the highest weight of a user?

old relic
drowsy moon
#

Does that work in a custom plugin?

old relic
#

Do you have PAPI installed?

drowsy moon
#

Isn't that just a placeholder for when you're using PAPI

#

No i don't.

old relic
#

And have you imported the LuckPerms part

drowsy moon
#

I have.

old relic
#

To use the placeholder you need

  1. papi
  2. Imported the luckperms placeholders
drowsy moon
#

Isn't there a way to do it without papi?

old relic
#

No papi is the thing with the placeholders

drowsy moon
#

There has to be a way to do it without papi.

old relic
#
  1. Install papi
  2. /papi ecloud download LuckPerms
    /papi reload
#

Not that I’m aware of, you need the api to communicate between luckperms and your custom plugin

azure latch
#

@zenith linden if you really can't find it on the wiki (it's on there) then you could use getServer() or Bukkit.dispatchCommand(whatever you want to run);

zenith linden
#

that's the thing i didn't want a command to run other commands

magic notch
#

Is there any documentation on how to use the sql messaging table manually? I am trying to write a user admin panel that includes permissions and I need to be able to send updates to luckperms with changes to user roles or permissions

#

Maybe I'm going about this all wrong, hoping someone can point me in the right direction

fallow dagger
#

how to transfer this code so it works with luckperms?


        List<String> groups = user.getParentIdentifiers();```

(from pex)
#

and this (almost the same as the last one)

PermissionUser user = PermissionsEx.getUser(p);

#

???

ebon ether
#

Did you take a look at the javadocs of Luckperms ?

#

Here is your answer

fallow dagger
#

luckPermsApi cannot be resolved

azure latch
#

Add LuckPerms to your build path and import it @fallow dagger

fallow dagger
#

already done

crystal sonnet
#

How to get the instance of the API is explained earlier

uneven radish
#

@jaunty pecan
Are u still alive?

proud crypt
#

He's a very busy guy

uncut onyx
#

Hi, I wrote something like user.setPermission(node) node is in this case new meta node. I have problem if that node already exists, because it will create a new meta instead of rewrite the value of the old. How can I solve this?

crystal sonnet
#

@uncut onyx remove the other node first

uncut onyx
#

and how to remove? something with unsetPermission()? I havent got the old node as instance.

heady prism
#

Good day, I'm using LuckPerms API and I'm trying to get User instance of offline player. I'm using LuckPermsApi#getUser(playerName);
Problem is that it returns null User everytime. It works for online players though.

crystal sonnet
#

YOu can iterate over the player's nodes and filter for the one(s) you want and remove them. @uncut onyx

#

@heady prism check the wiki. There's a section fot the API. And you need to load offline players

uncut onyx
#

@crystal sonnet thanks a lot. I am quite a beginer in this.

frank driftBOT
#

Hey asty! Please don't tag staff members.

heady prism
#

Thank you, final solution was
LuckPermsApi#getUserManager().loadUser(Bukkit.getOfflinePlayer(playerName).getUniqueId()).join();

wraith sapphire
#

Hey, so I am VERY new to the bungeecord thing and was told that Luckperms has some Bungeecord integration.

#

Its just im new to all this and dont really know how the stuff works. Do I put the luckperms in one of my servers or in the Bungee Server?

#

How do I set up the MySQL

#

and all that stuff

#

Is there anyone willing to attempt to walk me through any of this stuff?

#

and because I dont thing BungeeCord has a discord

proud crypt
#

please use #support-1 for general LuckPerms questions, this channel is for developers using the API.

wraith sapphire
#

whats the api?

proud crypt
#

if you need to ask that question this is obviously not the place for you :P

wraith sapphire
#

and sorry

#

I posted there now

graceful carbon
#

there is an event when a player's rank expires?

graceful carbon
#

because I do not see it in the API or the doc of the API

left parcel
#

Hello. I am trying to make a player whenever they right click on an item to be given a rank. Any possible ways of doing that?

strong thistle
#

Hi. I am going to define some permissions in my plugin and i am really new to this. What should i use for this purpose: vault api, luckperms api or i can use permissions from bukkit?
UPD: So I implemented Vault API and it works fine for now. But I still hope to hear advices from you <3.

left parcel
#

Any helpers that could help me?

old relic
#

@left parcel You will need another plugin for that, something like “Vouchers” works really well but it is payed there are other plugins that do similar things at no cost

left parcel
#

Thanks man

nocturne elbow
#

Is it possible somehow using h2 database to bridge permissions from Spigot server to Bungee? Using Bungee only temproary to protect from bot attacks

raw vortex
#

I think I saw this answered some where else... but the answer is no. Secondly, this should be asked in #support-1

fierce nebula
#

Hi, I am trying to use PGInterval Class from the PostgreSQL driver. But when I use it this i get this error. Is this a problem from LP ?

#

This is the line 159 PGInterval pgInterval = (PGInterval) resultSet.getObject(2);

ashen walrus
#

Looks like you're trying to use a relocated PGInterval?

fierce nebula
#

I'am trying to use PGInterval from the postgres driver. I have to use another one ?

rain barn
#

what's the equivalent of setting a permission to false but using the api?

#

/lp user User permission set activecolor.blue false something like this but using the api

neat jackal
#

Node.Builder#setValue?

rain barn
#

ah, thanks.

ivory obsidian
#

Is there a good way of getting the highest ranked people in a certain track?

#

or any way of getting all the players in a group?

turbid solar
#

no

#

@thorny echo

frank driftBOT
#

Hey powercas_gamer! Please don't tag staff members.

whole spoke
#

How can i get the prefix of a group?

fierce nebula
#
GroupData groupData = group.getCachedData();
        Contexts contexts = luckPermsApi.getContextManager().getStaticContexts();
        MetaData meta = groupData.getMetaData(contexts);
        String prefix = meta.getPrefix();```
whole spoke
#

thanks

graceful perch
#

One message removed from a suspended account.

#

One message removed from a suspended account.

whole spoke
#

How do I get all online users which have a specific permission?

neat jackal
#
for (Player p : Bukkit.getOnlinePlayers()) {
if (p.hasPermission("a.permission") {
}
}

Something like this maybe?

graceful perch
#

One message removed from a suspended account.

whole spoke
#

Tobi, @graceful perch whats about the performance of this?

graceful perch
#

One message removed from a suspended account.

whole spoke
#

Finnaly I used: java Bukkit.getOnlinePlayers().stream().filter(p -> p.hasPermission(permission)).forEach(p -> { //code });

graceful perch
#

One message removed from a suspended account.

#

One message removed from a suspended account.

neat jackal
#

Are you saving the user?

graceful perch
#

One message removed from a suspended account.

neat jackal
#

Try api.saveUser(commandSender.getName()) not quite sure about this as I use a User (and UserManager) object

graceful perch
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

graceful perch
#

One message removed from a suspended account.

frank driftBOT
#

Hey Pitaya4! Please don't tag staff members.

graceful perch
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

nocturne elbow
#

what event is fired when a user gets their parent changed?

#

nevermind, i learned how to read

graceful perch
#

One message removed from a suspended account.

nocturne elbow
#

eventBus.subscribe(NodeAddEvent.class, this::onUserRoleChange); this should call onUserRoleChange whenever /lp user zbk parent add is ran correct?

#

ah i see the problem

#

its only being called when /lpb is used

flat rapids
#
        final String rank = ChatColor.translateAlternateColorCodes('&', "&e" + LuckPerms.getUser(player).getPrefix()).replace("_", " ");
        String displayName = player.getDisplayName();
        displayName = rank + displayName;```
#

i need help

flat rapids
#

@here

proud crypt
#

^ those pings don't work, btw

#

imagine pinging 1000 people for something probably only 50 could help with, lol

flat rapids
#

@proud crypt

frank driftBOT
#

Hey Lean_! Please don't tag staff members.

flat rapids
proud crypt
#

and don't ping me

  1. i literally am already here
  2. i don't know anything about java
  3. #rules, as Clippy just told you
flat rapids
#

sorry

#

luck perms not support to java ?

neat jackal
#

No, LuckPerms itself is written in Java, the api too. But Turbo doesn't knows anything about it.

flat rapids
#

tobi

#

can u help me ?

neat jackal
#

If you read the developer usage page(s) you should be fine, also don't forgot to check the javadocs

fierce dew
#

is this right when checking if a player has a group ?

                   !online.hasPermission("group.admin") && !online.hasPermission("group.vip")) {
                
            }```
#

i dont want to mess up with the api

neat jackal
#

Looks right to me

hazy girder
#

How do I set op with the plugin because I've tried to set up and it won't let me get full op

tired pond
#

How do I show a set prefix with the api?

prime siren
#

hello all so i'm struggling to figure this out at the moment, I'm completely new to luckperms ben using pex ever since day one pretty much all dem years ago....but now that I am using bungeecord, pex doesn't seem to work very well with crossserver support so I'm switching to luckperms as its apparently the best thing out there at the moment however I'm struggling to figure out how to perform some basic tasks using the API , such as adding a player to a group? i've got the checking of permission strings/nodes done and I think I could handle groups also , but not sure how to add a user and remove a user from a group?

proud crypt
#

API docs on the wiki should help

prime siren
#

yeah I've been reading those and trying to understand the group/user modification bit but its confusing ><

#

am I right in that I would be using unsetPermission(node) and setPermission(Node)?

#

I always thought nodes were 'some.permission.node' ?

#

OOOOOooo but I suppose group.GroupName' would also be a node?

crystal sonnet
#

Yes and yes

#

Though group names are always lowercase

prime siren
#

i see

iron wagon
#

Context.SERVER_KEY

#

how i use it? I mean i need to get the prefix of a group in a specific context

fierce nebula
#

When I try to use the PostgreSQL driver in my code it uses the one from me.lucko.luckperms.lib and it creates conflicts. How can I avoid that ? It's very inconvenient :/

chrome echo
#

@fierce nebula you can run ipconfig and copy ipv4 and it will say your adress to mugfin the bisectur of the binary config yml

graceful perch
#

One message removed from a suspended account.

halcyon panther
#

Hey, how do i make this work : getUser(event.getUniqueId()).hasPermission("perm.here");

#

i made a LocalizedNode but i have no clue how to use it

crystal sonnet
#

If you just want to check permissions, use the platform’s permission checks

halcyon panther
#

I can't do that

#

as i want to check the perm of an offline player

#

and Bukkit does not allow to check perms of an offline player since bukkit perms are only set when the player fully joins

#

so does anyone know how to make a LocalizedNode?

crystal sonnet
#

I’ve never heard that in the context of LP

#

So I can’t help with that

#

And btw you need to load the player data of offline players first before you check permissions on them

#

You also need to pass an appropriate context

halcyon panther
#

i figured it out

#

@crystal sonnet what do you mean i would need to load the player data?

frank driftBOT
#

Hey Cobiy! Please don't tag staff members.

halcyon panther
#

Sorry

#

i did not know he was staff lol

#

anyway it seems to be working straight away so yeah 🙂

crystal sonnet
#

👍🏼

halcyon panther
#

actually its not working

#

im using

        ContextManager contextManager = plugin.api.getContextManager();
        Contexts contexts = contextManager.lookupApplicableContexts(user).orElseGet(contextManager::getStaticContexts);

        PermissionData permissionData = user.getCachedData().getPermissionData(contexts);
        return permissionData.getPermissionValue(permission).asBoolean();
    }```
#

which is on the wiki and it does not seem to be able to tell me

crystal sonnet
#

Because it's for online players

halcyon panther
#

how would i check offline players?

crystal sonnet
#

As I've said you need to load playerdata for offline players

halcyon panther
#

how does?

crystal sonnet
#

And then it works the same way

#

Pretty sure the wiki shows how to do so

halcyon panther
#

ill check

fierce nebula
#

I just done that for my conflict problem and now It's working 😄

     <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <shadedArtifactAttached>false</shadedArtifactAttached>
                    <artifactSet>
                        <includes>
                            <include>*:*</include>
                        </includes>
                    </artifactSet>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                    <relocations combine.children="append">
                        <relocation>
                            <pattern>org.postgresql</pattern>
                            <shadedPattern>
                                me.lucko.luckperms.lib.postgresql
                            </shadedPattern>
                            <includes>
                                <include>org.postgresql.**</include>
                            </includes>
                        </relocation>
                    </relocations>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>```
halcyon panther
#

Anyone can help me with this issue i still yet to have found a solution
so i am trying to get the perms of an offline player on the wiki it says to use this

    return luckPermsApi.getUserManager().loadUser(who)
            .thenApplyAsync(user -> user.inheritsGroup("admin"));
}

public void informIfAdmin(CommandSender sender, UUID who) {
    isAdmin(who).thenAcceptAsync(result -> {
        if (result) {
            sender.sendMessage("Yes! That player is an admin!");
        } else {
            sender.sendMessage("No, that player isn't an admin.");
        }
    });
}```
but this seems to be outdated as inheritsGroup ask for a node now not a string and even if i give it a node its has yet to work
graceful perch
#

One message removed from a suspended account.

celest patio
#

How can I give out a group to a player for a certain period using API?

wispy steeple
graceful perch
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wispy steeple
#

its only when luck perms is installed. not luck perms though?

graceful perch
#

One message removed from a suspended account.

wispy steeple
#

lol okay prick

celest patio
#

Hello, how can I set a group for a player using the API plug-in? I tried to create a new node and add it to the player, but that didn't work. And still it is necessary to establish this group for a while.

prime glacier
#

How I can edit the Prefix of a player with Luckperms API?

celest patio
#

Node

prime glacier
#

???

celest patio
prime glacier
#

How i can add the node to a player?

#

ya

celest patio
prime glacier
#

and how i add the node to a player?

celest patio
#

user.setPermission

#

Create new instance

#

User user = api.getUser(player.getUUID);

prime glacier
#

Must I do luckPermsApi.getUserManager().saveUser(user);?

#

@celest patio ?

celest patio
#

probably probably

crystal sonnet
#

Yes

brazen spire
#

Hello, I want to change data on bungeecord and sync these changes to spigot. is there a simple way for something like that? I use already api.getUserManager().saveUser(..) but that doesn't sync the changes to spigot

crystal sonnet
#

You have to trigger a network sync

graceful perch
#

One message removed from a suspended account.

broken lynx
#

Hello.

I'm currently trying to create a plugin that allows users to have a custom prefix, however, I'm not sure how I would go about removing it and reverting to their primary group's prefix afterwards.
Will the user only have one prefix node? I suppose I could keep a store of nodes mapped to players, but I'd like to know if there's anything I can use that's a part of the API.

broken lynx
#

Anyone? ._.

broken lynx
#

Nvm, I can just get the prefix with the highest priority.

bright gulch
#

plz help 😦

#

It not warking 😦

proud crypt
#

you are supposed to check your console for errors if that happens

#

so do that maybe

#

also, wrong channel

prime glacier
#

How I can remove a Prefix from a player using the weight?

bright gulch
#

@proud crypt I change defult but it is not warking .... 🙂

frank driftBOT
#

Hey 둑두둑이! Please don't tag staff members.

bright gulch
#

@proud crypt I change defult but it is not warking .... 🙂

frank driftBOT
#

Hey 둑두둑이! Please don't tag staff members.

bright gulch
#

I change defult but it is not warking .... 🙂

old relic
#

You can say it once...

prime glacier
#
            UserData cachedData = user.getCachedData();
            Contexts contexts = Contexts.global();

            PermissionData permissionData = cachedData.getPermissionData(contexts);
            MetaData metaData = cachedData.getMetaData(contexts);
            String prefix = metaData.getPrefix().replaceAll("&", "§");
            String suffix = metaData.getSuffix().replaceAll("&", "§");
            e.getPlayer().setPlayerListName(prefix + e.getPlayer().getName() + suffix);
            e.getPlayer().setDisplayName(prefix + e.getPlayer().getName());``` what's wrong with it?
idle seal
#

How can i get the name of the group from a player?

modern pilot
#

LuckPerms.getApi().getUser(<player name string or uuid object>).getPrimaryGroup()

graceful perch
#

One message removed from a suspended account.

#

One message removed from a suspended account.

prime glacier
#

its for a tab plugin

modern pilot
#

i mean

graceful perch
#

One message removed from a suspended account.

modern pilot
#

doesn't bukkit have a built-in colour formatting thingy

graceful perch
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

modern pilot
#

ChatColor.translateAlternateColorCodes('&', metadata.getPrefix())

graceful perch
#

One message removed from a suspended account.

#

One message removed from a suspended account.

prime glacier
#

oh

prime siren
#

userManager().loaduser only accepts UUID, is there a way to provide the players name instead? and have luckperm checks its own database for the players UUID ?

graceful perch
#

One message removed from a suspended account.

#

One message removed from a suspended account.

idle seal
#

how can i set the rang from a user?

prime glacier
#

is error

#

public void onSneak(PlayerToggleSneakEvent e) {
if(e.getPlayer().isSneaking()) {

    }else {
        User user = LuckPerms.getApi().getUser(e.getPlayer().getName());
        UserData cachedData = user.getCachedData();
        Contexts contexts = Contexts.global();

        PermissionData permissionData = cachedData.getPermissionData(contexts);
        MetaData metaData = cachedData.getMetaData(contexts);
        String prefix = ChatColor.translateAlternateColorCodes('&', metaData.getPrefix());
        String suffix = ChatColor.translateAlternateColorCodes('&', metaData.getSuffix());
        e.getPlayer().setPlayerListName(prefix + e.getPlayer().getName() + suffix);
        e.getPlayer().setDisplayName(prefix + e.getPlayer().getName());
    }
}
#

code

#

what's wrong

turbid solar
#

Whats on line 50

prime glacier
#

String suffix = ChatColor.translateAlternateColorCodes('&', metaData.getSuffix());

idle seal
#

how can i set the rang from a user?

prime glacier
#

LuckPerms.getApi().getUser(<player name string or uuid object>).getPrimaryGroup()

turbid solar
#

Thats getting it

idle seal
#

no not the name of the group

prime glacier
#

oh set

idle seal
#

yes

neat jackal
#

You mean adding a group

#

That should be possible trough the NodeFactory

prime glacier
#

@turbid solar

prime glacier
#

??????

nocturne elbow
#

@random cloak

random cloak
#

?

astral loom
#

(kind of offtopic but luckperms dev surly had this issues)

Anyone experienced with mysql? I have a small problem..

Lets say I have 1 mysql connection.. It works pretty well, I HAVE to make sure to always close connection, statement and result before using again.. Main problem is I cant run 2 mysql queries at the same time which is pretty limiting as I am experienced NodeJS develoepr where running 10 queries at once with 10 connections is basic.

That means I need pool of connections.. With basic hiraki pool there is problem - when you run out of connection, your server freezes.. waits for new connection to open.. but it wont ever open because its frozen and it wont know old connection is finished..

SO... I had to make my own query queue manager and every tick check if there is connection available, if yes, take oldest query in queue and run it..

That.. is awesome.. But now I have yet another problem - I cant run sync queries (for example, when player join server, I need his tag from database.. I run query, it gets into queue, it will run next tick.. but message in chant is already shown with default tag as I dont have player data yet).

I came up with idea of having 1 idle connection for sync methods - sync method wont need 2 queries.. never..
BUT.. I also have sqlite support for my small lib.. Problem is sqlite supports one connection only so if I want to keep one connection for sync methods, async wont ever trigger as they wont ever get second idle connection.

Any tips? 😄

brazen spire
#

I use https://github.com/exlll/databaselib
You can take a look at the db stuff from aikar. Sounds a little bit complicated with your queue stuff. Sqlite is weird.

crystal sonnet
#

@astral loom first of all:
never ever run database actions synchroniously!

#

At least not synchroniously on the main thread

#

The way to do it is to use the async join event

astral loom
#

well, in some cases you just have to.. I have 2 examples:

I use CMI.. CMI send message when player connect.. I have tag plugin, I use placeholder to show his tag when he join.. so.. player join, CMI want to send join message, it parse placeholder to get tag.. my plugin has placeholder registered, it recieves request.. it check storage but player is not there, it returns default tag.. Why default tag? Because I load it from mysql but its not sync.. its async and placeholder has to return value immidietelly, it cant wait for my callback..

Same problem with onDisable... lets say I stop my server BUT my plugin has some data stored in variables. When server stops, I want to put it all into mysql.. I run queries, but they are async, server stops before these queries gets executed (some may be nested, these wont get run for sure)
these are 2 cases I found I just have to run queries sync

crystal sonnet
#

And block there until you have all data you need

#

And for stopping you can run the "synchroniously"

#

In MC plugins running "synchroniously" typically means running on the main server thread.

#

But in any case, yes you need a connection pool. But the way you work with it is that you close the connections, queries and results as soon as you can

#

This is very important

#

(Hikari caches the real connections. So you closing a connection from hikari only ever frees it in the pool)

#

@astral loom

#

And the way LP does it, is by following those guidelines

#

(And NodeJS also does pooling btw if you can run multiple queries in parallel)

astral loom
#

okay, what about my problem with onDisable for example? if I run stuff async, server will stop sooner than my coe s finishet, wont it?

crystal sonnet
#

That’s not on the main server thread

#

Or the game loop to be precise @astral loom

#

So it’s ok to do it sync

#

As it is ok to do sync when you’re async to the main server thread/game loop

limber heath
#

How can I get the instance of LuckPermsApi on BungeeCord without reflection?

#

When LPBungeePlugin#registerApiOnPlatform is called, it does nothing with the given LuckPermsApi reference, so is my only my of getting this through reflecation?

#

If the only option is reflection, is there a maven dependency for the bungee implementation of luckperms?

crystal sonnet
#

There is the LP API on maven

#

And it has a static getter in the LuckPerms class @limber heath

limber heath
#

Thanks! Not sure how i missed that

crystal sonnet
#

Me neither XD

limber heath
#

Is it suggested to use that to get the API instance even on Bukkit, instead of using their ServicesManager?

crystal sonnet
#

No

#

It is not

limber heath
#

Alright thanks

crystal sonnet
#

You’re welcome

vapid terrace
#

do i still miss something with
plugin.getLuckpermsAPI().getUser(player.getUniqueId()).setPrimaryGroup("some-group");
?
the group isn't applied

turbid solar
#

save the user

vapid terrace
#

how?

turbid solar
#

LuckPermsApi.getUserManager().saveUser(user) says on wiki

vapid terrace
#

just found it, thanks .. sorry, did not read the full docs, only that part of how to modify things .. thanks again! 🙂

vapid terrace
#

unfortunately that does not work

#

try {
User user = plugin.getLuckpermsAPI().getUser(player.getUniqueId());
user.setPrimaryGroup(config.getPlayerGroup());
plugin.getLuckpermsAPI().getUserManager().saveUser(user);
plugin.log(Level.INFO, "setting group " + config.getPlayerGroup());

        } catch (NoSuchPluginException e) {
            e.printStackTrace();
        }
crystal sonnet
#

@vapid terrace setting the primary group only tells LP which of the current groups is the most important

#

You need to give the group to the player

vapid terrace
#

but the user doesnt even have the "bewohner" group assigned, the only one is the default

crystal sonnet
#

And by default even setting that won't do anything, because the actual primary group is calculated

#

That's the idea

vapid terrace
#

okay oO

crystal sonnet
#

Give them that group

vapid terrace
#

sounds a bit weird ^^

#

so the primary group is calculated by weight?

crystal sonnet
#

Yes

vapid terrace
#

alright thanks

crystal sonnet
#

From the groups the player has

vapid terrace
#

can i promote a user by api?

#

because the default group is in a track already

crystal sonnet
#

If you want to set the group the player has, first remove all the group nodes, then add a group node of the respective group to the player

#

And not quite

#

You need to a fair bit of manual work

vapid terrace
#

do you have a snippet for adding groups to a player?

crystal sonnet
#

The wiki has

vapid terrace
#

it's not, or i'm too dumb to find it

#

however, i now let spigot execute a promote command, since this api is not really userfriendly

crystal sonnet
#

You need to create group node object and set it on the user

limber heath
#

I'm writing a bit of code to copy the prefix and suffix nodes of a group to a user.
It all works on the bungeecord instance of LuckPerms, but the updates to the user arent being sent to the other bukkit servers.

both of the configs have these values set

server: global
storage-method: MySQL
sync-minutes: -1
watch-files: false
messaging-service: pluginmsg
auto-push-updates: true
include-global: true

(also the mysql servers are the same)

What might I be doing wrong?

#

I'm using User#TransientPermission and then UserManager#saveUser

#

both complete successfully, but the other servers dont get the updates

crystal sonnet
#

@limber heath transient permission are not what you want

#

They are a "magic" hidden layer of permissions. They are never saved (lost on server restart or simply running /lp sync), don't show up with any of the commands and another few weird things

limber heath
#

Hmm the documentation said they were temporary permissions, that are removed when I player leaves a server. Should I just use normal Nodes and remove them manually when I player leaves?

#

I need the permissions that I set to be on all servers, but they need to be removed when the player leaves the network. So I'm guessing I have to remove them manually

crystal sonnet
#

Yes. They are removed when the player leaves. But they also are never synchronized. If you need them synchronized you need to either use normal nodes or perform your logic on the backend servers too

limber heath
#

Alright thanks

vapid terrace
#

hello again.... i'm still trying to add a group to a user, but I still don't get it

#

Can someone help with some piece of code please?`

neat jackal
#

Create a group node object using the NodeFactory

vapid terrace
#

and then user.setPermission(node)?

vapid terrace
#

assuming a track for regular players (name it player-track), containing the default group (for guests) and a player group - what is more effective/better to find out if a player is a guest - querying his nodes and filtering for not being in the player group - or querying the primary group since the player group has a higher weight?

idle seal
#

Is an event triggered when a user changes the rank?

idle seal
#

ok thanks

idle seal
#

this event will not work

vapid terrace
#

assuming a track for regular players (name it player-track), containing the default group (for guests) and a player group - what is more effective/better to find out if a player is a guest - querying his nodes and filtering for not being in the player group - or querying the primary group since the player group has a higher weight?

crystal sonnet
#

That looks like it belongs in #general @nocturne elbow

astral loom
#

BrainStone, you answered my queston about mysql few days ago, you told me to never run sync mysql queries. I have 2 cases where I think I dont have async solution.

  1. I have join message, where I need player name and player tag.. tag is from placeholder.. this is my placeholder.. when I recieve request to get a tag, I do:
  2. check if I have data already.. if yes, return data..
  3. if not, run mysql query, await result, add it into data and return

but placeholder is sync, I need to return value immidietelly.. Player just joined so I dont have his data yet..

Second problem, lets say I need to store data into mysql when server goes offline - in onDisable.. I cant run async there - I cant schedule new tasks there. also I dont want to risk that server stops earlier than my plugin finishes queries

crystal sonnet
#

As I said back then, load your data in the async player join event

#

That's what it is for

#

And I've also told you that sync means synchronous on the main server thread/game loop

#

Startup and shutdown logic is not run on the main loop

#

And running queries sync to your current thread is ok too when your already async (aka not running on the main server thread/loop)

#

@astral loom

#

I've said this the 5th time already

#

I won't say it again

vapid terrace
#

Hi again... What is the safest/best way to determine if a user is in the default group (first group in a track)?

#

i want to know if the user is still a guest to be able to promote him

#

is promoting also available via the api?

vapid terrace
#

hello? someone there? please? >.<

broken lynx
#
DataMutateResult result = user.setPermission(node);```
This node goes away when the user logs out or the server restarts, even though it isn't a transient permission? I'm confused.
limber heath
#

Make sure you use UserManager#saveUser()

broken lynx
#

Ah, thanks.

vapid terrace
#

Good morning. Still trying (#3): How can I promote a user via the api?

wet veldt
#

Just looked at the documentation and there seems to be no direct way to achieve this. You could inspect the user's track, then manually promote them on that track, by setting their group to the next group from their current on that track.

vapid terrace
#

that's the way I do it right now, but i don't need the API for this - or, the API should do that by itself (hence the word API).

#

I think the plugin command does this in a similar way, but then I would not use the API but make the server execute a promote command (which is easier)

wet veldt
#

Right - so the API is lacking features - but you're achieving it anyway so what's the issue?

#

Obviously it would be nice as a feature so you could always make a pull request on Github for it

vapid terrace
#

the issue is, that the API is lacking features. Don't get me wrong, this seems to be the most promising plugin (of all plugins ever). it has a wide community, acceptance, usage and it is actively developed

#

but the API simply does not make any sense

#

I try to discuss that since 3 days, but you're the first one talking with me for more than one minute.

#

That's why I permanently repeat this issue and why I opened a github ticket

#

A pull request would be an option, but honestly I don't have the time to work myself into the plugin code, and the developers should have enough overview and knowledge of their plugin/api to decide if this is suitable or not

#

But I even don't get a statement on that

#

So things are starting to become frustrating

wet veldt
#

Fair enough, it's quite a large plugin from what I've seen so I'm sure their focuses are in other places asides from adding a small API method which can be achieved by a small subroutine.
Getting frustrated that they're not implementing features by your command in this discord channel is pretty silly though. If you cared so much you'd make a PR.

#

No point arguing about it though because you've implemented it yourself now, and learned that the API's lacking features I suppose

vapid terrace
#

It's not only the promote thing, the API has more problems (from my [silly] point of view). For example, you can retrieve a Group object from the api, but parent groups can only be assigned through a constructed string permission. This does not make any sense

wet veldt
#

But I'm not sure why you think the API should directly reflect the in-game commands.

#

There's a reason wrapper libraries and extension libraries exist for APIs, they usually serve the minimum operations required, then further features are provided in extension libraries.

#

Instead of making a PR you could always make your own extension library for the API to ease these issues from future users of the API?

vapid terrace
#

I could create my own extension for the API

#

But the plugin command handlers did that already - honestly I don't have a clue how they work together with the API - and if I have learned something over my years in developing software, then it is - API first. everything is in the API, then comes the application layer.

#

Developing software with that in mind, it is always much easier to (inter)connect the API to other tools and software

proud crypt
#

Have you checked out v5?

vapid terrace
#

not yet. I guess you are the one who answered my ticket?

proud crypt
#

Yes. I don't do Java but I know Luck has been working on some big changes to the API for v5

vapid terrace
#

I had a short look into the v5 branch, but to know what's going on I would need a week

#

But however, the only one who could answer that question is Luck

proud crypt
#

Yeah, most likely. Sadly he is busy a lot of the time.

vapid terrace
#

Aren't we all busy 😉

wet veldt
#

in v5 it seems he's adding a promote method :)

vapid terrace
#

Faith in plugin restored ^^

nocturne elbow
#

Why lucko no online

gaunt pine
#

Hi!
I'm trying set/unset a permission in my bungee plugin and check for it in my spigot plugin. However, the permission on the client servers only get updated once i use /lp sync. I have the storage set to mysql on both servers and the messaging method set to pluginmsg. Any idea what could cause the issue?

crystal sonnet
#

YOu need to trigger the network sync on the bungee manually @gaunt pine

gaunt pine
#

can i do that using the api?

crystal sonnet
#

Of course

gaunt pine
#

Got it to work, thanks!

novel citrus
#

I have a problem with the prefix. somehow the entered prefix is not shown in the chat.

crystal sonnet
mellow hinge
#

hello

nocturne elbow
pseudo meteor
#

Is there an Event in the API that is called when a player doesnt have permission to use a command, so that I can handle that myself with sending them a message or doing something custom, etc?

crystal sonnet
#

No there is not

sly hearth
#

i need a bit of help with this

                Node node = api.getNodeFactory().newBuilder("node.node").build();
                
                if(!api.getUser(uuid).hasPermission(node).asBoolean()){
                    api.getUser(uuid).setPermission(node);
                }

not sure why its not working and wont set the node

#

any idea what i am doing wrong?

azure latch
#

You have to save the user

#

@sly hearth

#

Its in the docs somewhere how to save it

sly hearth
#

oh ok

azure latch
#

I believe its api#saveUser(User)

sly hearth
#

even for perm check i have to save it?

#

cause my if its not working either

azure latch
#

No

#

You save to save after you assign the permission to them

gaunt pine
#

Does the network sync trigger the NodeAdded event on the client servers?

gaunt pine
#

Basically I'm modifying the permissions of a User on my bungee server then saving and starting the sync. The sync does happen, on the spigot server the User will have the new permission but the event does not seem to fire.

fresh violet
#

are you using a MySQL for storage ? And if yes are you using the same Database ??

gaunt pine
#

yes, yes. As i said, the sync does happen, checking the permission on the spigot server shows the new value

fresh violet
#

Ohh sorry

gaunt pine
#

It's okay, I'm expecting it to be something trivial like this on my side 😄

long wyvern
#

Hey, is there's any way to access LuckPerms config? (LuckPermsConfiguration)

#

I've digging through several classes but the variable seems to be dependency injected via params..

cold panther
long wyvern
#

Hmmmm ookay

#

how can I get the instance of it?

cold panther
#

I'll load up my pc and then type it out xD shouldn't be long

#

I didn't see this before, but the LuckPermsAPI instance should have a method called getConfiguration. So I'm not particularly sure that you need to get an instance of the config interface itself

gaunt pine
#

Could you guys look at my code please? I'm still having the same issue.
Here is the code where I add the permission (using the addPermission method): https://pastebin.com/KEeHd6Ag
Here is the class where I register the event in the spigot plugin: https://pastebin.com/ZvsgjvsQ
LuckPerms config on BungeeCord: https://pastebin.com/8NPDHEAj
LuckPerms config on Spigot server: https://pastebin.com/8dMcj5mr

Basically when calling the addPermission method in the bungee plugin, the onNodeAdd function in the spigot plugin does not get called. The permission sync does happen, checking it on the spigot server shows the changed value. If I change a permission with the /lp user etc. command, the onNodeAdd function does get called. Do Nodes added this way not trigger the event or am I missing something?

cold panther
#

The spigot plugin wouldn't be able to capture the NodeAdd event, no, the only events luckperms-spigot would really know of in this instance are the sync event and the user data recalculation event

gaunt pine
#

So if I wanted to listen to a specific permission change I would need to listen to the UserDataRecalculateEvent and store the previous permissions of the user to see what changed?

cold panther
#

Yep, that sounds right to me

gaunt pine
#

I was hoping there was a simpler way to do it 😦 Thanks for the help!

cold panther
#

You could use event.getdata which returns a UserData object. That should contain the permissions involved in the event

gaunt pine
#

Oh, it only contains the changes? Thats neat

cold panther
#

I'm honestly not too sure 😂 it's either the changed data or the UserData for that specific user. But since there is also a getUser method, I'm hoping it's the changes

gaunt pine
#

gonna test it 😄

#

ty for the help

cold panther
#

No problem :)

gaunt pine
#

Seems to contain everything :c

cold panther
#

Ooooo, not fun then :/

gaunt pine
#

yep :/ gonna send a pluginmsg with the changes myself

#

i will!

gaunt pine
#

Random question for the same code: Any idea why the NodeAdded event would trigger twice on the bungee server after using the addPermission method?

azure latch
#

Would it be because you sync the addPermission method so its called once for the server and once for Bungee?

#

especially the java Group group = api.getGroupManager().getGroup(user.getPrimaryGroup()); for (Node node : group.getOwnNodes()) { String prefix = node.getPrefix().getValue(); Node toSet = api.getNodeFactory().makePrefixNode(100, prefix).build(); user.setPermission(toSet); save(user); part to get the users highest group's prefix

gaunt pine
#

i only call the one on bungee

humble dragon
#

Hello I did not know or post but here since this morning I have a problem with but permission pixelextras.command.ivs all but permission of Pixelextras no longer works on Luckperms since this morning

azure latch
wet veldt
#

can I listen for prefix changes in the API?

ancient bay
#

Hi, got a question, i try to get someone's rank name like ("getRank(player.getName()") <-- it actually don't work like that xD
But does someone have any ideas ? can't find it in the API ..

azure latch
#
User user = api.getUserManager().getUser(A Player Object.getUniqueId());
String groupName = User.getPrimaryGroup();```
#

@iYordiiiDev#6062

#

Welp

#

He left

nocturne elbow
#

Random people have * perms on my server

#

How can I remove all the * perms from users with out resetting the ranks

#

@azure latch

azure latch
#

^ bulk editing. Should do what you want

nocturne elbow
#

Ummm

#

I’m confused

azure latch
#

Why?

nocturne elbow
#

What command should I type

#

Xdd

azure latch
#

That's literally the first thing that link tells you

#

So read it

nocturne elbow
#

Ummmm

#

I don’t speak English

#

Xd

#

Wanna help me out

#

My friend

#

No idea

#

Xdd

azure latch
#

Well, do you want to remove the permission from groups or users? That's <dataType>

#

Action is self explanatory

nocturne elbow
#

Users

azure latch
#

Ok, so what command do you think you'd have to run?

nocturne elbow
#

Idk but I’m trying my best

#

Can you help me out pls @azure latch

#

Ummmm

#

Pls?

azure latch
#

1, this Should be in #support-1, and 2) we've been over this. You don't type dataType, you type users, then go to the next argument. Do you want to update or delete the permission? Type whichever. Then type your permission that you want to remove. It's really not that hard

nocturne elbow
#

Did I did it wrong?

#

@azure latch I’m soo confused

azure latch
#

lp bulkupdate users delete "permission=*"

nocturne elbow
#

I think my luck perm is broken

azure latch
#

...

nocturne elbow
#

Ummmm

azure latch
#

You typed a working command at 2:38:09 but didn't confirm it

nocturne elbow
#

Nooo

#

I did that

#

And it clears all the player data

#

Ranks

azure latch
#

lp bulkupdate users delete "permission==*"

#

Try that

#

It's == this time

nocturne elbow
#

I think luck perm just don’t like me

azure latch
#

Ah

#

Mabye

nocturne elbow
#

Ummmmmmm

azure latch
#

l.p. bulkupdate users delete "permission == *" like 10% chance, but mabye. Also, try it without the "s as well

nocturne elbow
#

Oke

#

Oof

azure latch
#

Good

nocturne elbow
#

I think it worked

#

Yay stay at

azure latch
#

Did you confirm it?

nocturne elbow
#

Wait

#

Let me confirm

#

It xddd

#

Yessss

azure latch
#

Cook

#

Cool*

nocturne elbow
#

Thank youuuu

azure latch
#

Now if you want to clear any other permissions, just change * to whatever permission.

#

Np

nocturne elbow
#

Your a god

sour rock
#

I am confused. How can i get the permissions of an player with his uuid?
I get the User without an problem.
But i dont know how the permissioncheck should work...

crystal sonnet
#

Do you want to check single permissions or get all nodes a player has?

sour rock
#

I want to check if he has a single permission or if he has the permission *.

crystal sonnet
#

If you want to check a single permission just use the platform permission checks

#

And checking for * works the same way

sour rock
#

You mean the permissions check of Spigot/Bungeecord/Bukkit?

crystal sonnet
#

Yes

sour rock
#

They wont work for me, because the Event state i dont have a User.

#

I just get the uuid.

crystal sonnet
#

Then get the player object

#

Assuming they are online

sour rock
#

Ok I will give it a try

crystal sonnet
#

If there's a chance that you get an offline player's UUID then you need to do it through the API

#

But that'll make it a whole lot more complicated as you need to load player data and everything needs to be async

astral plover
#

attempting to convert from a custom group plugin into this, but it's not saving for some reason.

Reference: https://github.com/lucko/LuckPerms/blob/ec7a5321a62827a9da3f3b515dc10a316ffbe3d4/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java#L165

Code:


        for (GlobalProfile globalProfile : getManager().getMongo().getDatastore().find(GlobalProfile.class)) {
            UUID user = UUID.fromString(globalProfile.getUniqueId());

            User lpUser = api.getUserManager().loadUser(user, globalProfile.getName().replace(" ", "")).join();
            RankEntry rank = globalProfile.getHighestRank();

            if (rank == null)
                continue;

            lpUser.setPrimaryGroup(rank.getName().toLowerCase());
            api.getUserManager().cleanupUser(lpUser);
            api.getUserManager().saveUser(lpUser);

            System.out.println("Migrated " + userCount.incrementAndGet() + " users so far. (" + rank.getName() + ")");
        }```

Output (obv from 0):

[00:44:58 INFO]: Migrated 16071 users so far. (Member)
[00:44:58 INFO]: Migrated 16072 users so far. (Member)
[00:44:58 INFO]: Migrated 16073 users so far. (Member)
[00:44:58 INFO]: Migrated 16074 users so far. (Member)
[00:44:58 INFO]: Migrated 16075 users so far. (Member)
[00:44:58 INFO]: Migrated 16076 users so far. (Member)
[00:44:58 INFO]: Migrated 16077 users so far. (Member)
[00:44:58 INFO]: Migrated 16078 users so far. (Member)
[00:44:58 INFO]: Migrated 16079 users so far. (Member)
[00:44:58 INFO]: Migrated 16080 users so far. (Member)
[00:44:58 INFO]: Migrated 16081 users so far. (Member)
[00:44:58 INFO]: Migrated 16082 users so far. (Member)

#

Also

#
1
astral plover
#

^^ nvm, managed to fix it.

30079
minor hare
#

how do I get player prefix

dusky wagon
#

who i get player wight?

#

@minor hare Contexts contexts = LuckPerms.getApi().getContextManager().getApplicableContexts(s);
MetaData metaData = LuckPerms.getApi().getUser(s.getName()).getCachedData().getMetaData(contexts);
String prefix = metaData.getPrefix();

neat jackal
wet veldt
#

can we use getApplicableContexts on OfflinePlayers? Trying to obtain the prefix of a potentially offline player here.

dusky wagon
#

were i find the event for luckprems what trigger if my parent changed?

nocturne elbow
#

NodeAddEvent

#

UserDataRecalculateEvent

shy widget
#

Is there any way to get a Group object from a LocalizedNode? Node::isGroup is true, but, I can't just cast it

shy widget
#

Nevermind, I figured it out. Use the Node::getGroupName and feed into LuckPermsAPI::getGroup (for any searchers wondering how to do)

minor hare
#

@dusky wagon a bit late but thx

azure latch
vapid hedge
#

hi guys, anyone can help me?
I have problem with downloading preffix from group of player

neat jackal
#

"downloading"?

severe cove
#

^?

nocturne elbow
#

what u mean, when say "downloading preffix"?

vapid hedge
#

getting prefix style to display in another formatter, i mean moment when i need to display nick of player by on example getDisplayName()

#

but then im getting nick of player with default vanilla formater

#

on example ops have red nick

#

but i want get prefiix of rank and suffix for use in plugin

#

example:

@EventHandler
public void pisanie(AsyncPlayerChatEvent e) {
    e.setCancelled(true);
    if(pl.getLocation().distance(ploc) <= dis) {
            pl.sendMessage(p.getDisplayName()+" "+e.getMessage());
    }
sweet field
#

dose anyone know why i can't give people /home and /sethome in my sever its a different plugin

frank driftBOT
vapid meadow
#

Hey can I get some help with a couple things?

old relic
#

What things?

vapid meadow
#

i need some help giving people certain permissions

#

and ive watched some videos etc and im still having a bit of trouble

serene haven
#

How do I check all of a player's active permissions?

#

that they get from all their groups

magic crow
#

Hey, i have one question how can i get Group prefix

rotund light
#

Is there any event for group, prefix, suffix change for player?

nocturne elbow
#

NodeAddEvent/NodeRemoveEvent UserDataRecalculateEvent

rotund light
#

Thanks!

cunning bane
#

Hello, i am very confused i want to set a certain permission for everyone on the server and everyone that will join the server. How do i do that

#

actually, i want to unset the permission

#

sorry

twin tiger
#

All new users automatically are members of the group "default". so set the permition you want in that group

#

/lp group default permission set bukkit.command.plugins false (for example)

cunning bane
#

ok

#

thanks

#

sorry to bother you again, i only recently got luck perms and when i inquire how many people have the 'default group' it says no one is in it. anyway to change that?

twin tiger
#

/lp group default listmembers
gives you 0 members ?

cunning bane
#

yes

twin tiger
#

have you logged in after installing the plugin ?

cunning bane
#

yes

#

and restarted

twin tiger
#

you moved yourself to another group ?

cunning bane
#

no

#

right now im restarting my entire minecraft

#

ok still no

#

it says there is 0 entries for it

twin tiger
#

than i am sorry, i dont know. wait for someone else to help you

cunning bane
#

ok thanks anyway

#

I want to remove a certain permission from everyone but my default says there is no on e in it

#

nevermind i fixed it

cunning bane
#

which command do you use to add members to a group? and also can it be used with @p

proud crypt
#

Please use #support-1 for these questions. This channel is meant for developers using the API.

stray frigate
#

is there any way you can like clone default and give everything default has to anther group (EX: Give all the perms that Default has to helper) how would i go about doing that? @thorny echo sorry for the tag

crystal sonnet
#

@stray frigate are you trying to do that with the plugin developer API?

proud crypt
#

It was cross posted on general too, so I assume not

stray frigate
#

I am just using the one for the sever I don’t think I got the dev one

flat void
#

Hi!

#

How i can get all players from "admin" group?
I need send message to admin group

long moon
#

just check if they have group.admin

flat void
#

ok

#

thx

native axle
#

is it possible to make the group show up in the tab list, so if i give someone [admin] in tab list it'll show up as [admin]tommankt

old relic
#

That would require a separate tab plugin

crude sentinel
#

Hello I want to create several grades on my server (Sponge)
but to each command executed
I can't find a solution

neat jackal
#

If it just shows "Running LuckPerms vX.X.X" then you don't have permissions to execute any LuckPerms command

crude sentinel
#

ok ! So how do I authorize myself to execute command ?

#

I don't find

turbid solar
#

give yourself luckperms.*

crude sentinel
#

The /op doesn't work aps

turbid solar
#

Sponge disables /opwhen a permission plugin is installed

#

!usage

frank driftBOT
crude sentinel
#

I'm fine, thank you.

crystal sonnet
#

This channel is for people using the developer API

vestal folio
#

HI!

#

I am having some trouble setting up LuckPerms on my BungeeCord server.

#

Could someone talk me through the steps and give me some help?

#

Wait nvm

crystal sonnet
nocturne elbow
#

I want to ask what is the value of the ranks that I have or I need to use in the scoreboard
Can someone help me
Is there anyone?

ripe thorn
#

A own scoreboard plugin or a general one like FeatherBoard?
If second one, then use PlaceholderAPI's vault expansion with %vault_group% (if supported)

idle seal
#

hello i have a question. how can i get the highest group from a player

idle seal
#

Can someone help me?

crystal sonnet
#

@idle seal try to get the primary group

idle seal
#

If i have an Livetime group and a temporary group i became the temporary group and this is the lower group

#

@crystal sonnet

frank driftBOT
idle seal
#

Oh sry

crystal sonnet
#

Then you need to set the group weights correctly

#

Or iterate over all permission nodes to filter out the groups and work with that

idle seal
#

How can I get the lowest group?

#

Or how can i filter the nodes for the lowest group?

dire atlas
#

How do I check if an OfflinePlayer has a permission?

#

User.hasPermission() requires a node

#

idk what to do

crystal sonnet
#

Create a node

#

The wiki has examples on how to do it

dire atlas
#

@crystal sonnet link?

frank driftBOT
#

Hey Viktoracri! Please don't tag staff members.

dire atlas
#

if(LuckPerms.getApi().getUserManager().getUser(player.getUniqueId()).hasPermission(LuckPerms.getApi().buildNode(Permission.BAN.getPermission()).build()) != Tristate.TRUE) { This returns an error for some reason

#

Permission.BAN.getPermission = "ban"

crystal sonnet
#

What error?

dire atlas
#

let me find it

#

NullPointerException

#

at that line

crystal sonnet
#

You need to load an offline player first

dire atlas
#

Oh

#

LuckPerms.getApi().getUserManager().loadUser(uuid)?

crystal sonnet
#

Yup

#

And you can store the API in a variable

dire atlas
#

Thank you

limpid sapphire
#

i still have a problem, i have my own server on aternos i try to make ranks on this server with luck perms. But it doesn't work. I have watched a lot of explanation videos and asked friends but I couldn't figure it out. I would therefore like to kick perms from eg essnensials and a prefix and suffix.

#

Can you help me????

dire atlas
#

What have you tried

crystal sonnet
#

!usage

frank driftBOT
crystal sonnet
limpid sapphire
#

!usage

frank driftBOT
dusky wagon
#

witch event trigger if a parent change?

dusky wagon
#

@ripe thorn

frank driftBOT
#

Hey Meerpaluten! Please don't tag staff members.

dusky wagon
#

jo

ripe thorn
#

Do I look like I know the API?

#

Ask here and wait for someone to answer

dusky wagon
#

ok

proper terrace
#

hey muss ich luckypermsbungee in Bungeecord orderner ziehen???

crystal sonnet
#

@proper terrace programmierst du ein Plugin?

proper terrace
#

ne

crystal sonnet
nocturne elbow
#

yo how can i make this support luckperms

#

i cant find anything in the api website or im just blind

#

fuck im blind

#

i think i found it dw

#

nvm its not what i was looking for

crystal sonnet
#

There’s a page on the wiki that explains the API basics and one that has examples

nocturne elbow
#

sry

#

hello i have a problem with a seflmade plugin witch should return the expire time of a group Permisson.... can anybody help me there...???

#

i am a beginner in permissions

crystal sonnet
#

Get the permission node object and check the expiry time

nocturne elbow
#

have you a sample for me ...pls

crystal sonnet
#

There's a wiki page explaining the API and one with examples

nocturne elbow
#

yes but i didnt unerstand it right an so im here...

crystal sonnet
#

We are not here to do the work for you

nocturne elbow
#

no pls

crystal sonnet
#

Show us what you have and at what point you are struggling

nocturne elbow
#

public void onPlayerInteract(PlayerInteractEvent e)
{
if((e.getAction()==Action.RIGHT_CLICK_BLOCK)&&((e.getClickedBlock().getState() instanceof Sign)))
{
Sign s=(Sign)e.getClickedBlock().getState();
Player p=(Player)e.getPlayer();
if(s.getLine(1).equals("VIP")){

        p.sendMessage("Vip Staus ist :" + getPlayerGroup(null,null));
    }
    }
crystal sonnet
#

So nothing

nocturne elbow
#

i know

#

wich term should i use for it

#

you know waht i want to do?? shure i think but i dont know how to...pls help me..!!

crystal sonnet
#

"Term"?

nocturne elbow
#

Function...

crystal sonnet
#

There's not a single function do to that

#

You'll need to do a bit of programming

nocturne elbow
#

ok..i will do this

crystal sonnet
#

Take a look at the examples

nocturne elbow
#

if found some helps but i cant get it to a running version...

crystal sonnet
#

Then post what you got and what's not working/erros

#

We can't read minds

nocturne elbow
#

ok...but it is not mutch

#

this one is to read the permissions right??

#

public boolean hasPermission(User user, String permission) {
ContextManager contextManager = api.getContextManager();
Contexts contexts = contextManager.lookupApplicableContexts(user).orElseGet(contextManager::getStaticContexts);

PermissionData permissionData = user.getCachedData().getPermissionData(contexts);
return permissionData.getPermissionValue(permission).asBoolean();

}

crystal sonnet
#

That would be checking a permission

nocturne elbow
#

wich one ist the right one to get the expire time of a permission...

#

This is the right help for me???

#

no help possible...

long moon
#

People aren't sitting around waiting for questions to answer for people who don't wanna go look themselves

#

No idea if luck hosts the javadocs himself somewhere, but quick 2 second google found a site hosting them, or you coulda gone to look at the repo itself

nocturne elbow
#

spigot repo not working?

long moon
#

maven just tries every repo until it finds it

#

dmulloy was the protocollib one? There was people having issues with that

#

That could stall maven in general

long moon
#

maven just tries every repo