#luckperms-api

1 messages · Page 34 of 1

wild rune
#

But aren't nodes like, permission nodes?

nocturne elbow
#

although modifyUser is advised

#

Permission nodes is a type of node

#

Inheritance nodes is another type of node

#

Everything is a node at the end of the day, different types, but all nodes

wild rune
#

Oh

#

I've never used nodes

neat jackal
#

Node is just another term for permission

nocturne elbow
#

eeh....

wild rune
#

Oh in that sense

neat jackal
#

I mean feel free to correct me, but I don't see a difference between PermissionNode and Node (other than the name)
Or maybe I'm just missing something...

wild rune
#

Okay I think I'm on the right track

#

Except it won't let me use Node#builder() rn

nocturne elbow
#

InheritanceNode#builder

wild rune
#

yeah apparently i don't have jdk 8 lol

nocturne elbow
#

lol that has nothing to do with it?

#

I don't think so at least

wild rune
#

yeah might be me being dumb

#

"References to interface static methods are allowed only at source level 1.8 or above"

nocturne elbow
#

Show me the code please lol

wild rune
#

I'm just doing InheritanceNode.builder()

nocturne elbow
#

I mean feel free to correct me, but I don't see a difference between PermissionNode and Node (other than the name)
Or maybe I'm just missing something...
Maybe a PermissionNode doesn't, but a RegexPermissionNode or a WeightNode do

#

Besides, it's senseless for you to change the "value" (true/false) of a weight node or a meta node just because they are nodes

#

It does make sense if they are permission nodes or regex permission nodes

#

I'm just doing InheritanceNode.builder()
screenshot pleaaaase

#

Or check for wildcards in non-permission nodes

wild rune
#

I got it fixed, just had my eclipse project properties wrong lol

nocturne elbow
#

oh okay

neat jackal
#

Ah, got you there, thanks Fefo

nocturne elbow
#

They would be "specifications" with their own parsing and setting and stuff

#

Besides, it's senseless for you to change the "value" (true/false) of a weight node or a meta node just because they are nodes
And that's something I don't like from the editor (in which I made an issue here https://github.com/lucko/LuckPermsWeb/issues/307)

#

@proud crypt for when 👀

neat jackal
#

Generally I meant that you can just aswell do permission set group.groupname true etc. as it's also just a permission

nocturne elbow
#

Yeah I get that, it's more of a node set rather lol but the string you put in there is the one that will go to the holder, regardless of the actual type

neat jackal
#

Are we at the level of "is a node a permission?" or "is a permission a node?" xd

nocturne elbow
#

A node can be a permission 👀

#

But a permission will always be a node

wild rune
#
UserManager um = LuckPermsProvider.get().getUserManager();
User user = um.getUser(loopPlayer.getUniqueId());
user.data().add(InheritanceNode.builder("group1").build());
neat jackal
#

But yeah as a permission is something true/false, and a node is just... a string then I guess?

wild rune
#

This feels right

#

I mean not to be set up that way, but is the method correct?

nocturne elbow
#

Even in the suggestion it shows <node> rather than <permission> lol

neat jackal
#

Looks correct (even tough #getUser may cause issues if the user is not loaded)
And don't forget to save!

nocturne elbow
#

This feels right
remember to saveUser

wild rune
#

yeah, that brings me onto the modifyUser, which does it for you, right?

#

How would I integrate this with modifyUser?

nocturne elbow
#

Exactly

#

yeah, that brings me onto the modifyUser, which does it for you, right?
it loads it from storage if not loaded and saves it, all for you

#

Tobi will explain :)

neat jackal
#

I can 🥄, but not explain

#

Maybe JavaDoc can

wild rune
#

I've looked for it, I can't find anything on modifyUser except for the commit on github :S

nocturne elbow
#

I can't find anything on modifyUser

#

wut

wild rune
#

oops, consumer I mean

neat jackal
#

Consumer means a lambda

#

Ok, I'm too bad at Java, it doesn't mean that directly, but a lambda works there.

nocturne elbow
#

Consumer, Function, Supplier, Callback

#

All fancy words for "a method in an object"

neat jackal
#

I did just spoon here

wild rune
#

I learned a valuable lesson

nocturne elbow
#

computing was a mistake

#

yes

#

I know

wild rune
#

I've been programming for about 4 or 5 years and I've never been exposed to lambda before

neat jackal
#

I hope not from me, whatever you learned from me: forget it

nocturne elbow
#

xDD

neat jackal
#

Really fun: JavaScript callbacks

nocturne elbow
#

lambdas are just "inline" "anonymous" methods

#

You don't make a special method for it in your class

wild rune
#

yeah i looked it up, can't believe I've never seen it before

nocturne elbow
#

So they don't have a name per se

wild rune
#

Well hahah

#

You've all been a great help

#

I'll try and get it actually working now

knotty plinth
#

How do I make it so people can warp everywhere but certain warps

nocturne elbow
#

With the developer api?

neat jackal
#

Use more refined permissions?

knotty plinth
#

It’s essentials

neat jackal
#

Why are you asking in this channel?

knotty plinth
#

Where should I ask for plug in support

neat jackal
#

At the plugin's support channels

nocturne elbow
neat jackal
#

!moss has beloved Jason who can help you

frank driftBOT
#
Essentials

Make sure you are using EssentialsX and Vault for prefixes. For any other issues with Essentials, you should seek support in either #general or the official EssentialsX support Discord.

EssentialsX Discord
wild rune
#

I've added a suffix with a priority of 50
Can I remove said suffix only using the priority?

#

Can I just use

user.data().remove(SuffixNode.builder(null, 50).build());

?

crystal sonnet
#

No you can’t. However there is a node matcher

hard oar
#

How does one add context (in my case I want to only add the permission for 30 minutes) to a permission node?

String permission = "cmi.command.fly";
Node node = Node.builder(permission).build();
this.luckPerms.getGroupManager().modifyGroup("default", (Group group) -> {
                group.data().add(node);
            });
nocturne elbow
#

Doesn't the node builder take context?

#

And contexts isn't what you're looking for Node.builder(permission).expiry(long, TimeUnit).build();?

#

@hard oar 👀

#

Hi

#

@nocturne elbow 👀

#

🤔

#

3qm

#

3am

#

Sleep

#

Mayb

nocturne elbow
#
[00:27:43 ERROR]: [BurstTags] BurstTags v1.0 attempted to register an invalid EventHandler method signature "public void com.morais.tags.handler.TagsHandler.onRankUpdate(net.luckperms.api.event.user.track.UserTrackEvent)" in class com.morais.tags.handler.TagsHandler```
#

I'm getting this error for no reason

#
public class TagsHandler implements Listener {

    public TagsHandler(BurstTags plugin) {
        plugin.getServer().getPluginManager().registerEvents(this, plugin);
    }

    //update method, to big to post

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        update(event.getPlayer(), "a ", " b");
    }

    @EventHandler
    public void onRankUpdate(UserTrackEvent event) {
        Player player = Bukkit.getPlayer(event.getUser().getUsername());
        if (player != null)
            update(player, event.getGroupTo().get() + " ", " " + event.getGroupFrom().get());
    }


}```
wild whale
#

LP events are not handled through the bukkit event bus

nocturne elbow
#

That's--- not how you listen to LP events

#

Ah

wild whale
#

LP has it's own event bus

nocturne elbow
#

Uhm

#

!api it's explained somewhere in here

frank driftBOT
nocturne elbow
#

thanks

wild whale
#

or in the cookbook, pinned

nocturne elbow
#

It was fast

#

The very last section

#

thank you

#

@nocturne elbow @wild whale You guys deserve the tag

frank driftBOT
#

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

nocturne elbow
#

:p

#

sorry @frank drift

nocturne elbow
#

What's the event to check if a player changes rank?

#

I tried

#

UserPromoteEvent

#

and

#

UserTrackEvent

#

NodeAddEvent

#

Is what you're looking after

#

the key

#

is the player

#

uhm what? no?

#

Then how can I check

#

what was the player who changed the rank

#

"rank"

#

Then you get the node, and check if the node type is NodeType.INHERITANCE (means that they got a group node added)

#

getTarget?

#

for what..

#

I want to get

#

the player name

#

First you'll want to check if the event was applied on a user

Then you get the node, and check if the node type is NodeType.INHERITANCE (means that they got a group node added)

And then you can get the target, yes

#

Uhm I'll give it a try

#

You're fast

#

lol

#

uh

#

event.getTarget().getIdentifier().getName()

#

This will return

#

the player name?

wild whale
#

Javadocs are pinned.

nocturne elbow
#

I'm checking them

#

I'm just confused

#

1st time with lp api

wild whale
#

PermissionHolder.Identifier#getName returns a UUID for Users, not their name

#

event.getTarget().getFriendlyName() ?

nocturne elbow
#

Gets a friendly name for this holder, to be displayed in command output, etc.

wild whale
#

read the long description

nocturne elbow
#

makes sense

#

only need 1 more step

primal bloom
#

Does anyone know how to make people appear on the server with a specific rank?

nocturne elbow
#

What do you mean?

#

Is this related to the developer api?

primal bloom
#

nono

nocturne elbow
primal bloom
#

ah

#

yes

#

lucky perms

nocturne elbow
#

..................

primal bloom
#

srry xd

#

put a range in default and that all those who start have that range

nocturne elbow
#

What?

primal bloom
#

ok

ripe token
#

Are the groups from luckpermsapi.getCachedGroups() sorted in any particular order?

#

So when I loop through them and checking if a player has the group permission that it gets the main group perhaps?

nocturne elbow
#

what?

ripe token
#

Is the list of groups that you get from that method sorted in any particular order? By weight or smth?

#

Or is it random for example: default, admin, builder, donater

nocturne elbow
#

Where did you get this getCachedGroups method?

#

I can't seem to find it neither in LuckPerms nor GroupManager

ripe token
#

luckPerms.getGroupManager().getLoadedGroups()

#

Sorry, I thought I memorized it correctly, was too lazy to open up my IDE

nocturne elbow
#

I don't think it's sorted in any order in particular, but you shouldn't rely on that one specifically for that. What is it exactly you're trying to do?

ripe token
#

Get the players group. In the new api there is no method for that. The recommended way is to use smth like this:

#
    for (String group : possibleGroups) {
        if (player.hasPermission("group." + group)) {
            return group;
        }
    }
    return null;
}```
#

But for admins with all perms they would be in all groups.

#

Or operators

nocturne elbow
#

That's... a way I really don't suggest using lol because the possibleGroups has to be sorted how you want it to already

ripe token
nocturne elbow
#

And yes there is a way to get the groups a holder inherits sorted by weights

#

I know

#

PermissionHolder#getInheritedGroups(QueryOptions) is what you're looking after

ripe token
#

That will then get me a sorted list of inherited groups by weight?

#

Or do the queryoptions decide that which is my second question. What do the queryoptions do? I have never understood that

nocturne elbow
#

That will then get me a sorted list of inherited groups by weight?

ripe token
#

Ai thanks, I'm bad at reading 😄

nocturne elbow
#

And they QueryOptions basically dictate what things will and will not be taken into consideration when resolving a... well... query

#

For example, does it take contexts into account, server context, world context, does it resolve the inheritance, etc

ripe token
#

And non_contextual will not take into account any contexts? How would that work then?

#

Just ignore worlds, servers and such?

nocturne elbow
#

I have no idea lol

#

I guess?

ripe token
#

Ai okay, good that I only have global stuff and a tiny server

#

Thanks for your assistance!

nocturne elbow
crystal sonnet
#

@ripe token What's wrong with the getPrimaryGroup call?

ripe token
#

I thought that was removed

#

¯_(ツ)_/¯

crystal sonnet
#

No?

#

Why would it be?

nocturne elbow
#

is there some methode to get the group were Player is in?

#

Yes, User#getPrimaryGroup()

#

Oh, ok I will try it when I am at home.. Because the other option with the permissions es bad I think

#

Is there also an option to get the configured Prefix from the Config?

#

I am new on LuckPerms and my time is about 2houers on a day, so I prefer ite to ask before search…

#

what do you mean from the config?

nocturne elbow
#

But for admins with all perms they would be in all groups.
@ripe token

#

why would you give the admins all perms?

#

Because people tend to give * which I highly discourage

#

¯_(ツ)_/¯

#

Same

ripe token
#

cuz only 2 ppl have that

nocturne elbow
#

@ripe token only console should!

#

which you can't do

ripe token
#

why only console?

nocturne elbow
#

avoid some future problems

ripe token
#

lik

tender tree
#

Hello, im trying to give a user a permission with context. It should read the servers and worlds for the permssion and add it to the node. The Permission node gets addet as it should, but without any context for server or wold. What am i doing wrong?

    public void addPermission(Player player, String nodeString, long duration, String[] servers, String[] worlds){

        PermissionNode  node = PermissionNode.builder(nodeString)
                .value(true)
                .expiry(duration, TimeUnit.HOURS)
                .build();

        for(String s: servers)
            node.toBuilder().withContext(DefaultContextKeys.SERVER_KEY,s).build();

        for(String w: worlds)
            node.toBuilder().withContext(DefaultContextKeys.WORLD_KEY,w).build();


        User user = loadUser(player);
        DataMutateResult result = user.data().add(node);
        api.getUserManager().saveUser(user);

    }
nocturne elbow
#

When you re-call .build(), you're not re-building the current Node, you're "creating" a new one

#

I suggest you build the node at the very end and work with the same builder you create at the beginning till you actually build it

#

@tender tree

#

I also suggest you put all of that inside UserManager#modifyUser, it will load and save the user for you and it will also run the action you want to do asynchronously

tender tree
#

Thank you very much. Now it works more. But still not as intended. It only adds worlds. It doesnt add any Servers. And the servers array is not empty. Also it somehow doesn't find the modifyUser method in the last row

nocturne elbow
#

This will load the user, run the code you put in there and save it

userManager.modifyUser(uuid, user -> {
  // Build node blah blah
  // user.data() blah blah
});
crystal sonnet
#

@nocturne elbow Ah yes. Because searching is inconvenient to you, you inconvenience others. How considerate of you

#

@tender tree you can’t have multiple worlds or servers in one node

nocturne elbow
#

savage

crystal sonnet
#

It’s gotta be said

nocturne elbow
#

thanks dad

#

Ooooooh damn

tender tree
#

Ok now i got everything to work i guess. The problem was that i used api version 5.0 for gradle, cuz thats the version displayed at https://luckperms.net/wiki/Developer-API#gradle . In this Version modifyUser is not implemented yet. I now figured out that there is 5.1 Also i testet my Plugin on a Bukkit only Server. Thats why the Server Context didnt work. Thank you for helping

crystal sonnet
#

If the server context works or not has nothing to do with what kind of server you’re running. It only depends on the server name you’ve defined in the LP config @tender tree

#

And I’ll reiterate but you can’t have multiple of the same context (key) per node.

#

So setting two world contexts overrides the first.

tender tree
#

Well i tried it with "global" which was defined in the config but it didnt work unless i made a 2 server bungee network

#

Now that i have 2 sub servers i can add both to the context and multiple worlds

crystal sonnet
#

Then you did something wrong. How many servers you have has no effect on if something is working or not

#

Now that i have 2 sub servers i can add both to the context and multiple worlds
@tender tree for the third time. No you cannot. At least not in a single node

#

Each key can only have one value

nocturne elbow
#

uhm idk bout the api, but you can add several contexts of the same key to a node, both the editor and commands let you

tender tree
#

By executing this (which is what i want)

    public void addPermission(Player player, String nodeString, long duration, String[] servers, String[] worlds){

        api.getUserManager().modifyUser(player.getUniqueId(), user -> {

            PermissionNode.Builder builder = PermissionNode.builder(nodeString);

            builder.value(true).expiry(duration, TimeUnit.HOURS);

            for(String s: servers)
                builder.withContext(DefaultContextKeys.SERVER_KEY, s);

            for(String w: worlds)
                 builder.withContext(DefaultContextKeys.WORLD_KEY, w);

            PermissionNode node = builder.build();
            user.data().add(node);

        });

    }
#

But it didnt add any server to the context (even if i tried to add only one server to the context and nothing else) until i set up a bungee network with two subservers

crystal sonnet
#

Damn. Did I really miss that change?

#

Multiple values for context keys must’ve come somewhere between 5.0 and 5.1

#

Because I know for a fact that at least in the early 5.0 versions that wasn’t possible

remote sky
#

Im new to luckperms, how do I make a buy sign??

#

Someone??

#

Hello???

obtuse jolt
#

ehh

#

using luckpermsAPI?

remote sky
#

I’m new to luckperms

#

I’d rather ask in here

#

Can’t be arsed looking for it

obtuse jolt
#

lol sure

remote sky
#

And why does luckyperms not work??

obtuse jolt
#

bcu you dk how to use it ofc

remote sky
#

I’m trying to create a buy sign

#

But luckyperms doesn’t work

obtuse jolt
#

buy sign isnt part of luckperms

#

!verbose to debug permission nodes

frank driftBOT
remote sky
#

I did this command

obtuse jolt
remote sky
#

luckyperms:/buysign create

#

But it did nothing -_-

obtuse jolt
#

🤷‍♂️

#

so unfortunate

remote sky
#

Can you help me???

obtuse jolt
#

you you are not just pranking and read what i say sure

#

😁

remote sky
#

Lol

#

I stg the ppl at luckperms are the most clueless of them all

#

The users

#

Poor helpers

short fossil
#

Wot

remote sky
#

Nothing personal

obtuse jolt
#

loll

rustic laurel
#

Next time u troll use #general so real dev stuff can remain pls 🥰

obtuse jolt
#

says larry... the one that trolled at Multiverse discord

remote sky
#

part of the troll was to go in the wrong channel :) but yea sure

rustic laurel
#

I knowwww 😂

#

No trouble, just a polite request

crystal sonnet
#

@remote sky since I lost brain cells and it was in #luckperms-api that’s a warning from me.

remote sky
#

oof sorry

#

idk if youre fr or not im sorry either way

crystal sonnet
#

I’m being serious

remote sky
#

:(

crystal sonnet
#

Especially because it was in this channel

nocturne elbow
#

I wanna add a permission node to a player with context how do I do that?
I am pretty confused looking at the wiki

#

Like this?

#

lgtm

crystal sonnet
#

That’s not how you obtain the API instance @nocturne elbow

#

!api

frank driftBOT
nocturne elbow
#

Ok fixed that

nocturne elbow
winged remnant
#

oh ok

lucid rapids
#

hello o/ small question, i am trying to use the API to bulk add a bunch of permissions (somewhat like a feature to automatically add player-only commands for my plugin). i saw the wiki to use data() and add the permission node, but that takes only 1 node as a parameter. is there no better way like a bulk-add, or will i have to invoke the same method on all nodes?

#

if it's the latter, i assume #data() is immutable (like all other components) so i can re-use it, correct?

crystal sonnet
#

Well just call add multiple times

#

And I believe there's also addAll which lets you add a collection

#

And the object data returns is mutable (else you couldn't add stuff to it, duh)

lucid rapids
#

add appears to be the only method, there isn't addAll

crystal sonnet
#

But you can reuse the same object

#

And if in doubt, just try it

lucid rapids
#

And the object data returns is mutable (else you couldn't add stuff to it, duh)
oh well i thought it runs on side-effects, like it just queues LuckPerms and doesn't change by itself

crystal sonnet
#

Even if that was the case you could still reuse the base object

#

Unless there would be some very weird stuff

thorn ocean
#

hey sorry to bother all but I rework a late pluning but he use import me.lucko.luckperms.api.caching.MetaData; but I not find it or find the rework like ```import me.lucko.luckperms.api.User; to ->import net.luckperms.api.model.user.User;

nocturne elbow
#

what?

thorn ocean
#

Mm I explain badly --'

#

import me.lucko.luckperms.api.caching.MetaData;

#

this import not work

nocturne elbow
#

Yeah that's old api, v4

thorn ocean
#

yess

nocturne elbow
#

You want to know which one is it in v5.1, right?

thorn ocean
#

yes

#

because not find it on github

nocturne elbow
#

I think what you're looking for is net.luckperms.api.cacheddata.CachedMetaData

thorn ocean
#

okay thanks I will try it ^^

marble snow
#

can we get the group options/meta via sponge permission api?

short fossil
#

!api

frank driftBOT
crystal sonnet
#

@marble snow I don't think so

#

But best to ask on the Sponge Discord

nocturne elbow
crystal sonnet
#

@nocturne elbow you need to save the changes

nocturne elbow
#

how?

crystal sonnet
#

!aoi

frank driftBOT
#

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

crystal sonnet
#

!api

frank driftBOT
lethal sigil
#

How to change(remove and add) user's parent group via LuckPerms api?

short fossil
#

load the user, grab the group object, and add it to a user

lethal sigil
#

How to add Group to User? (API 5.1)

crystal sonnet
#

You need to add or remove the respective inheritance node

#

!api @lethal sigil

frank driftBOT
lethal sigil
#

Thank you! it worked😊

crystal sonnet
#

You’re welcome

umbral bough
#

whats the difference between MetaNode#getMetaKey() and Node#getKey()?

#

is the meta key always the same as the normal node key?

nocturne elbow
#

Nope, the node key is the entire string of the node and its value is the true/false state

#

Whereas the meta node is like this meta.<key>.<value>, the meta key is the piece in the middle (which is NOT the node key)

umbral bough
#

the node key is the whole thing then?

nocturne elbow
#

Yeah

umbral bough
#

and will there be any issues if the value is a double?

#

because of the decimal

nocturne elbow
#

No idea lol

umbral bough
#

im trying to save a multiplier

nocturne elbow
#

But it returns as a string so it might not affect it

#

Try and see

pastel tiger
#

is this channel for assistance

nocturne elbow
#

with the developer api yes

pastel tiger
#

where would i got for assistance with the lp editor

crystal sonnet
#

Reading channel descriptions typically helps

pastel tiger
#

alright thank you

lethal sigil
#

UserManager::saveUser does not send user ping to another server. So, How to send user ping when update user data via api?

balmy tinsel
#

Hello, can I ask how I can remove group of user with server context? Here is how I have tried to do that, but it removes only groups without any context.

#

current_node.getContexts() is redundant, just forgot to remove it

crystal sonnet
#

What do you think group.getNodes() returns?

balmy tinsel
#

i thought it returns some permission node representations that can be used in data.remove() but it looks like I was wrong

crystal sonnet
#

No it doesn't

#

If you're not sure read the javadoc of a method

versed atlas
#

hey team we are having an issues with luckperms, where each time we do a reload of luckperms this error pops up

#

would anyone know what might be the issue?

im happy to send over the config file, if needed as well

crystal sonnet
#

Reloading the config isn't recommended. Just restart the server

#

Also wrong channel

versed atlas
#

oh sorrry!

fallow wave
#

?whois @split pilot

split pilot
#

Me

nocturne elbow
#

You

nocturne elbow
#

How to script a custom GUI?

#

using minehut

crystal sonnet
true condor
#

how do you get access to the console?

#

How do you delete a suffix?

#

i tried looking in the history but i couldn't find it

#

all of it doesn't work

obtuse jolt
#

with luckpermsAPI?? @true condor

true condor
#

LuckyPerms has a api?

obtuse jolt
#

lol read the channel info

true condor
#

o

#

what does it do?

obtuse jolt
#

are you using it?

true condor
#

yes

obtuse jolt
#

if are you are using it.... then you should know what it is used for lol

true condor
#

i didnt read it all i did was download it

obtuse jolt
#

k means you hvae no clue whats an api and thus not using it

true condor
#

ik a api does stuff for perms

#

and ranks

obtuse jolt
#

simple, you code plugins?

true condor
#

no

obtuse jolt
#

then you are no using luckperm api lol

true condor
#

can i do

#

{
"bat.kick.global":true,
"bat.ban.global":true,
"bungeechat.mute":true,
"bungeechat.unmute":true,
"bungeechat.spy":true,
"bungeechat.alert":true,
"bungeecord.command.list":true,
"bungeecord.command.server":true,
"bungeechat.helpop.recieve":true,
"Phoenix.Notification":true,
"prison/essentials.tp":true,
"prison/auction.admin.expire":true,
"prison/areashop.teleportall":true,
"prison/areashop.unrent":true,
"prefix.0.\u00264[Admin]":true,
"suffix.0.\u00264":true
}

#

or?

obtuse jolt
#

........

true condor
#

false

obtuse jolt
#

where is that screenshot from?

true condor
#

screenshot?

obtuse jolt
#

sry, the json/ list of perms*

true condor
#

its a plugin..

#

how do i add it?

#

well a api

#

or anything

obtuse jolt
#

huh

true condor
#

how do i put in {
"bat.kick.global":true,
"bat.ban.global":true,
"bungeechat.mute":true,
"bungeechat.unmute":true,
"bungeechat.spy":true,
"bungeechat.alert":true,
"bungeecord.command.list":true,
"bungeecord.command.server":true,
"bungeechat.helpop.recieve":true,
"Phoenix.Notification":true,
"prison/essentials.tp":true,
"prison/auction.admin.expire":true,
"prison/areashop.teleportall":true,
"prison/areashop.unrent":true,
"prefix.0.\u00264[Admin]":true,
"suffix.0.\u00264":true
}

obtuse jolt
#

where are you gettin this list from ^

true condor
#

2016

obtuse jolt
#

lol

true condor
#

yup

#

okay how do i delete a suffix in the editor?

#

or how do you remove a suffix from a player?

obtuse jolt
#

for editor its a perm node suffix<weight>.<suffix>

#

and for the record, you are not using luckpermsAPI lol

true condor
#

what is the weight?

obtuse jolt
true condor
#

?

#

im confused

crystal sonnet
#

@true condor the API is for integrating plugins with LuckPerms. It’s for programming.
If you don’t know what it is, then it’s not for you.
If you have questions about using LuckPerms, then ask in #support-1 or #support-2

coral beacon
#

how can I query the group of the player with the LuckPerms api

crystal sonnet
#

The User class has many methods you can use

coral beacon
#

if (permissionEntity.isInGroup("Admin")) {

crystal sonnet
#

Considering a player can have multiple groups you'll need to elaborate what you want

#

Get the groups list and check if the target group is in there

#

!api

frank driftBOT
crystal sonnet
#

The Javadocs are linked pretty far up in the first link

cinder gorge
#

i have 2 Questions

  1. is there a way to link roles to discord
  2. And does any one know a good forms for minecraft servers
remote sky
#

And well yes there is a way to do that

crimson vector
#

Hi there,
I read api for how to get a user

    User user = luckPerms.getUserManager().loadUser(who);

but what is luckPerms.? I can't find how to get this in the api guide,
(Sorry I'm not good at java, i'm learning)

neat jackal
#

!api it should be right at the top of the Developer Usage page

frank driftBOT
neat jackal
#

Actually no, it's on the normal API page then

crimson vector
#

Where can I find that page?

#

there's only Developer API page

obtuse jolt
crystal sonnet
#

I don’t think you should be working with MC plugins when you’re just learning Java

uncut ice
#

Hello, the NodeAddEvent dont got called on the spigot, if the node was added on bungee

#

The Proxy and the Spigot are synced by sql

#

Which Event can i use?

#

Or can i toggle it, that the event got called

#

@crystal sonnet

frank driftBOT
#

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

uncut ice
#

sorry

#

But i want that this works 😅

crystal sonnet
#

There might be a sync event

uncut ice
#

What is the name of the event?

#

Nothing works.....

#

It works, when im using the /lp command

#

But it dont works with /lpb

crystal sonnet
#

Have you set up a messaging service?

uncut ice
#

SQL?

crystal sonnet
#

Like when you run a lpb command does a message pop up in the spigot console?

uncut ice
#

oh no

#

How can i setup this?

crystal sonnet
#

set the messaging service to sql in all LP configs

uncut ice
#

Yes, done

#

Now i gots a message

#

But the event wont executed

#

On spigot

crystal sonnet
#

Did you restart the servers?

uncut ice
#

Yes

#

The message comes now, but the event dont get executed

#

i dont know why

crystal sonnet
#

Me neither

uncut ice
#

It works now with small delay

#

i have a schedule for one second

#

it works with this

crystal sonnet
#

Did none of the sync events work?

#

And well looking at your code

#

That the network ones couldn't have worked

#

Because sync events aren NoteMutate events

uncut ice
#

Yes, i have tried the MutateEvent

nocturne elbow
#

Those will always return false

#

And the code inside will never run

uncut ice
#

Yes, removed this early

nocturne elbow
#

"Called when a log entry is received via the MessagingService"

crystal sonnet
#

Log entry is the wrong thing @nocturne elbow

nocturne elbow
#

"Called when a log entry is received via the MessagingService"
What is that for then?

crystal sonnet
#

Log entries

marsh matrix
#
        return RanksManager.instance.getLP().getGroupManager().getGroup("default");
    }```
#

this is the other method

marsh matrix
#

oh

#

I completely skipped that

#

welp

#

thanks

dawn socket
#

!api

frank driftBOT
plucky aurora
#

Hi there,
I'm working on a simple plugin which I've nearly finished, however I'm wanting to add/remove permission nodes from the users after running certain commands.

I've practically copied the code which is listed on the wiki however I've into an issue when attempting to load the user. when using getUserManager() it's giving me a nullpointerexception and I am unable to figure out why that is, I'm running a local test server in which I am the only user (this I don't see why that would stop it from working).

I am wondering whether this is an obvious mistake on my part or it is something else.

crystal sonnet
#

A few things to check:

  • Make sure you have LuckPerms installed
  • Make sure you (soft)depend on LuckPerms in your plugin.yml
  • Make sure you don't have the API shaded in your jar (meaning make sure the API classes are not in your jar)
  • Make sure you don't try to get the API instance before your onEnable
#

@plucky aurora

plucky aurora
#
  • Yes LP is installed
  • Yes I've added it as a depend in the plugin.yml
  • The LuckPerms.jar is added in the build path, no classes are copied into my plugin
  • I've added the luckperms setup in the onEnable method
crystal sonnet
#

Well you're supposed to use the API jar, not the LP jar

#

And then just to be sure you need to figure out what exactly throws the NPE or in other words figure out what is null

plucky aurora
#

Okey I'll download the api jar, that could cause the issue.

#

UserManager userManager = lp.getUserManager(); This line causes the exception.

#

I'll send the github link

crystal sonnet
#

Good. That means lp is null

#

Ok. Where do you set lp in the Main class?

#

(I have it open btw and see the issue. Trying to guide you there)

plucky aurora
#

lp is set in the Permissions class LuckPerms lp = Main.getLuckPerms();

crystal sonnet
#

is that the same lp?

plucky aurora
#

yes

crystal sonnet
#

Are you sure

#

I mean you're declaring a new one there

plucky aurora
#

It's in the line before the on that causes the exception

crystal sonnet
#

What?

plucky aurora
#
LuckPerms lp = Main.getLuckPerms();
        
        UserManager userManager = lp.getUserManager();```
crystal sonnet
#

That's not the issue

#

the issue is that in the Main lp never gets initialized

plucky aurora
#

How should I be setting it up in the Main then?

crystal sonnet
#

You haven't answered my question yet

#

Are you sure
I mean you're declaring a new one there

plucky aurora
#

I don't get your question

crystal sonnet
#

I asked if the LuckPerms lp = ... is the same lp as the one declared in the Main class as public static LuckPerms lp = ... on line 29

plucky aurora
#

Well it should be

crystal sonnet
#

Really?

#

Are you coming from a Python background?

nocturne elbow
#

Why does that sound like an insult lol

crystal sonnet
#

It's not. That's an honest question

nocturne elbow
#

ik lol

plucky aurora
#

My only previous experience with Python and Java is from 1 uni module.

crystal sonnet
#

Ok. Then welcome to scopes

#

Redeclaring a variable in a scope shadows the old one

#

So if you declare a variable and it lets you, while another exists with the same name, you just (locally) overrode that name

#

Let me give you an example

#

Without running, can you predict what the code will output?

plucky aurora
#

1 1 1

#

?

crystal sonnet
#

No

#

I mean I'm clearly changing num

#

Am I not?

plucky aurora
#

oh yes, I didn't notice that func2() was different from 1

crystal sonnet
#

Ok. So what will the output be?

plucky aurora
#

1 1 3 then

crystal sonnet
#

Correct

#

Now why doesn't func1 change the value of num?

#

I mean I'm clearly setting it to 2 there, right?

plucky aurora
#

It's creating a new num for that method

crystal sonnet
#

Correct

#

So now compare that to your setUpLuckPerms

#

Do you see anything wrong there?

plucky aurora
#

ah yes

crystal sonnet
#

Awesome 🙂

plucky aurora
#

stupid me 😄

crystal sonnet
#

No problem

plucky aurora
#

I has referring to a near identical method called setupPermissions()

#

and stupidly forgot to change it

#

Thanks for the help

crystal sonnet
#

You're doing it correctly there

plucky aurora
#

Now I'll see if it works

crystal sonnet
#

Can't say that

#

But you'll be past that NPE

plucky aurora
#

yes that's good enough

#

since I haven't been able to test any of the other stuff yet

#

Okey surprisingly everything after that worked

crystal sonnet
#

Good

thin lion
#

What chat plugin should i use?

obtuse jolt
#

!chat

frank driftBOT
#
LuckPerms does not display things in chat!

LuckPerms is only able to send information to formatting plugins so that they display them properly. LuckPerms does not put the prefix in front of your name, you need a chat formatting plugin to do it, and you need Vault. Same goes for the tablist! If the information appears correctly when you run /lp user <user> info, LuckPerms is doing its job!

obtuse jolt
hard goblet
#

Hi, if i set permisions in the web editor, and then apply in minecraft, they doesn't work... how do i fix this

#

??

#

could someone help?

rustic laurel
#

you're not asking in the right place. hint: read the channel topic

hard goblet
#

thank you

sick quartz
#

Is there a way to set a prefix to a specific server using the PrefixNode builder?

sick quartz
#

Thanks!

nocturne elbow
#

Np

nocturne elbow
#

If the user is offline, you need to load the user from storage

#

@ornate owl

junior jay
#

which event let's me listen if a user has a group added/removed, I am guessing NodeAddEvent and NodeRemoveEvent. If so, does NodeRemoveEvent get called when NodeClearEvent is called?

nocturne elbow
#

I am guessing NodeAddEvent and NodeRemoveEvent
Correct, you'd check the node and target types for your needs

does NodeRemoveEvent get called when NodeClearEvent is called?
No, NodeClearEvent gets called when you run a clear command (... parent clear..., ... parent cleartrack..., ... permission clear..., ... meta clear...)

#

Whereas NodeRemoveEvent gets called when you remove nodes one by one

#

@junior jay

junior jay
#

yup, i read it. Thanks

junior jay
#

Are LuckPerms events not in sync?

nocturne elbow
#

I wouldn't know for sure but I'm confident they run asynchronously

junior jay
#

I didn't mean that, i mean - are they sent in batches? like i removed a group from a user and it doesn't call the event but when i do another change like adding/removing another group, both events get called.

#

If so, how can I make not wait for another change to occur and then call the events

nocturne elbow
#

I didn't mean that, i mean - are they sent in batches? like i removed a group from a user and it doesn't call the event but when i do another change like adding/removing another group, both events get called.
No, they are called as they happen. Picture this: you want to do something when a player breaks a block, the event gets queued but not called until, say, the world is saved; you want to do things when a block is broken but instead you'd be doing them when the world saves.

#

If so, how can I make not wait for another change to occur and then call the events
You could listen to the event normally and add it to a queue/stack (any collection that accepts duplicates will do), and then when a certain something happens (a certain event gets called) you'd process the whole queue

prime glacier
#

How can I create a group node with 5.1.26?

#

I've found Node.builder but what is the key?

nocturne elbow
#

InheritanceNodeBuilder is what you're looking for

prime glacier
#

I cant find it?

nocturne elbow
#

Sorry, InheritanceNode.Builder

#

it's a nested class lol

prime glacier
#

Then user#getNodes()#add(node) , right?

nocturne elbow
#

yeah

prime glacier
#

And userManager#saveUser ?

nocturne elbow
#

correct

#

if you're loading the user from storage (userManager.loadUser) I suggest you run all the operations in one big asynchronous runnable

prime glacier
#

Okey thank you very much

nocturne elbow
#

np

nocturne elbow
#

How can I get support in spanish?

rustic laurel
#

Ideally you would just use a translation service, and ask in the correct channel - this channel is for support regarding the luckperms developer api.

#

or, you could wait until someone who speaks spanish comes along

nocturne elbow
#

Uh sorry, ty

rustic laurel
#

Please do not reset your nickname to the unclickable monstrosity it is currently. There is a reason you were renamed

nocturne elbow
#

Im so sorry xd

remote atlas
#

can anyone help me, please? I have three servers, two servers are spigot and third server is BungeeCord, LuckPerms don't function on second server, but on first server it function, so I don't know how to repair it 😦

obtuse jolt
#

this is a channel for using luckperms developer api, if you are not using it then ask in #support-1 or #support-2

remote atlas
#

sorry

uncut ice
#

How can i check that a user has a permission

#

With the api

nocturne elbow
#

If a user has a permission or its value?

#

With the developer API?

#

I mean ... If not, #support-1 is the place for that

remote sky
#

.bold(true)?

tender tree
#
        api.getUserManager().modifyUser(player.getUniqueId(), user -> {
            PermissionNode node = PermissionNode.builder(nodeString).value(true).build();
            user.data().remove(node);
        });

So i have this code. I want to remove a permission node (obviously). But it only removes the permssion only when the node matches exactly whith the node i want to remove (with context and all that stuff). Is it possible that it ignores the context and just removes every permission with that node?

nocturne elbow
#

what a great question

#

I guess you could getNodes(NodeType.PERMISSION), then filter the ones that match the key and remove the resulting ones from the data?

tender tree
#

It works thank you. Thats what i endet up with:

        api.getUserManager().modifyUser(player.getUniqueId(), user -> {
            Collection<PermissionNode> nodeCollection = user.getNodes(NodeType.PERMISSION);
            for(PermissionNode node: nodeCollection) {
                if(node.getKey().equals(nodeString)) {
                    user.data().remove(node);
                    break;
                }
            }
        });
nocturne elbow
#

coolio

lone whale
#

Hey, I'm trying to add edit a meta node for a user with a plugin, and when I run user.data().add(node) it returns successful but running /user <name> meta info shows that the nothing has changed. Any idea why that might be?

More code to make it more clear what I'm doing:

MetaNode node = MetaNode.builder("nick", name).build();
// Sets the players metadata    Bukkit.getLogger().info("Node Addition:" + user.data().add(node).toString());```
turbid solar
#

Did you save the user?

lone whale
#

How would I do that?

lone whale
#

Ah, thought there would be something like this but couldn't find it. Cheers

coarse oxide
#

Hi, how to solve a problem when UserManager from LuckPerms is null?

neat jackal
#

Do you get any exception? How do you get LuckPerms?

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

I have this

#

and the api throws NullPointerException when I try to get a user

pseudo bramble
#

when are you trying to use the API

coarse oxide
#

later, I have a class that has that API

#

and in that class

#

I use API in a method to get a user

#

like that:

#

User player = userManager.getUser(mcId);

#

userManager is null

#

and userManager is the API

pseudo bramble
#

did you ever set user manager?

coarse oxide
#

yea

#

in the constructor

pseudo bramble
#

let's see the full context

coarse oxide
#

Okey so

#
  1. I get the API
#
RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
        if (provider != null) {
            api = provider.getProvider();
        }
#
  1. I create an object with the API as the parameter
#

CommandListener listener = new CommandListener(api);

#
  1. Then inside the COmmandListener I have a method
#

that gets the user by API

#

User player = userManager.getUser(mcId);

#
public CommandListener(LuckPerms api) {
        this.userManager = api.getUserManager();
    }
#

here's the constructor

#

and later I checked it and it turned out that userManager is null

pseudo bramble
#

that doesn't sound right

#

user manager is setup and constructed during the construction of the API, and should always be something

coarse oxide
#

that's why I'm concerned

pseudo bramble
#

it sounds like the null here is actually the API

coarse oxide
#

I'm checking it right now

#

yep

#

it's the api

pseudo bramble
#

in that case, you tried getting it too early

coarse oxide
#

what do you mean by too early?

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

isn't that enough?

pseudo bramble
#

what platform are you using

#

to get it, yes

#

but timing is also important

coarse oxide
#

I am using spigot

pseudo bramble
#

you need to initialize the API at least in onEnable and not onLoad, as that's when LP initializes the API

#

more precisely, you should have a dependency declaration to ensure you also run after Luckperms

coarse oxide
#

I am initializing the API in onEnable, however I'm not sure about dependency declaration

#

how does it look like exactly?

pseudo bramble
#

just the typical plugin.yml setup

coarse oxide
#

should I make LuckPerms depend?

pseudo bramble
#

your plugin should depend on LuckPerms

coarse oxide
#

yea, that's what I meant hah

#

depend: ["LuckPerms"]

#

something like that?

pseudo bramble
#

sounds about right

coarse oxide
#

Okey, UnknownDependency 😦

#

error

#

I get LuckPerms with gradle

#

So, is the name "LuckPerms" fine?

pseudo bramble
#

that should be it

coarse oxide
#

still the same

pseudo bramble
#

I mean, next thing to check then is if LP is even installed on that server

coarse oxide
#

shit, am I that dumb that I forgot to put LuckPerms.jar inside Plugins

#

XD

ember hedge
#

so in my plugin i need to get a list of all permissions that start with a certain string. To do this, I was getting the user's primary group and adding permissions from that to a list that i would then check for. The problem with this is that if a player is in the default group and another group, it ends up selecting the default group as the primary group.

What im asking is this: Is there a way to get a list of groups a player is in?

#

please ping me if you respond

ember hedge
#

awesome, that looks like exactly what I want! ty

nocturne elbow
#

The problem with this is that if a player is in the default group and another group, it ends up selecting the default group as the primary group.
That sounds like a bad weights setup honestly if you're not expecting default to be the primary one

jaunty pecan
#

@ember hedge 😉

#

That returns the same set of nodes as the ones used by LP for tab completion, etc

ember hedge
#

thanks, but I need all permissions that a player has

jaunty pecan
#

ah your original question lead me to believe otherwise

#

in which case, you want user.resolveInheritedNodes

violet sand
#

does anyone know how to get a list of the groups the player inherits?

#

i would need all of their groups, not just their primary groups.

#
            User s = Main.getLuckPerms().getUserManager().getUser("chriisto");
            System.out.println(s.getInheritedGroups(s.getQueryOptions()) + "");

gives me this result. i need the actual names of the groups tho.

http://prntscr.com/uko5ev

Lightshot

Captured with Lightshot

pseudo bramble
#

likely because you're returning a raw object that uses the Object toString()

violet sand
#

how would i go about fixing that?

pseudo bramble
#

what you could also see is that it's a list of api groups

#

have you tried doing anything with what is returned by getInheritedGroups

violet sand
#

no i haven't

#

getInheritedGroups returns a collection

#

while something like Group group = s.getInheritedGroups(s.getQueryOptions()); is looking for a singular group

#

so that doesn't work ^

#

fixed my problem. got it to work with

#
            for(Group groups : s.getInheritedGroups(s.getQueryOptions())) {
                System.out.println(groups.getName());
            }
pseudo bramble
#

and there you go!

#

that was exactly what was needed

violet sand
#

thanks for the pointers!

shell portal
#

I spent like an hour on the wiki trying to figure out how to add a user to a group in my plugin and I can't figure how? Can someone please assist me? 🙂

nocturne elbow
#

That's a neat example of exactly what you need

#

Except for the clear part

potent oasis
#

hi hi, is there a methode to get the max weight of a user ? or I have to keep my dirty

adaptater.getPermissionData(p).getPermissionMap().entrySet().stream().mapToInt(e -> e.getKey().startsWith("weight") ? Integer.valueOf(e.getKey().substring(7)) : 0).max().orElse(0)```
nocturne elbow
#

what in the world is that

potent oasis
#

yea i know

#

it's beautiful

nocturne elbow
#

well for starters, what do you mean by "max weight of a user"?

#

users themselves don't have weights

#

only groups, prefixes and suffixes do

potent oasis
#

well, get the weight of his group

#

or 0 if not set

nocturne elbow
#

you want to get the weight of the most weighted inherited group?

potent oasis
#

yeaaa

nocturne elbow
#

e.getKey().substring(7)

#

bruh

potent oasis
#

beautiful i said

#

so ?

nocturne elbow
#

so.. give me a minute lmao

#

you want only from the groups inherited directly or the indirectly inherited ones too?

potent oasis
#

if the player have multiple parent / groups, I want to get the higher weight

#

of them

#

And that's what I did

#

i got every node, filrer and map it, then get the higher

#

But I hope something exists in the API to do that

nocturne elbow
#

then you extract the weight off the group

potent oasis
#

.>

#

just have to learn how it works

#
adaptater.getUser(p).getInheritedGroups(/* idk what to set */ null).stream().mapToInt(group -> group.getWeight().orElse(0)).max();``` I know I am incredible
nocturne elbow
#

/* idk what to set */ well definitely not null

potent oasis
#

ha

#

lol

potent oasis
#
adaptater.getUser(p).getInheritedGroups(QueryOptions.builder(QueryMode.NON_CONTEXTUAL).build()).stream().mapToInt(group -> group.getWeight().orElse(0)).max();``` this api won't allow me to sleep
nocturne elbow
#

take into account that like it is now it will also include groups inherited indirectly (say I have vip+ and vip+ has vip and that one has member, it'll include vip and member as well)

potent oasis
#

so, what would I set there ? owoMochaThink

nocturne elbow
#

check the flags link above

potent oasis
#

but I can just get everything just like I did

nocturne elbow
#

mhm

potent oasis
#

it seems it isn't what u expect >.>

wet grove
#

for some reason using api.getUserManager().getUser(playerName) works well with players on java edition, but when I lookup a bedrock player on my server, it returns null (my server has bedrock and java crossplay, and for some reason /lp user (user) info works for all players but not this)

clever lake
#

what are you using for bedrock to java crossplay?

nocturne elbow
#

it returns null
is the user online?

#

@wet grove

wet grove
#

nope

#

I'm trying to use luckperms as a uuid fetching system

#

but the java player was online

nocturne elbow
#

getUser requires the user data to be loaded

wet grove
#

I see

#

is there anyway to load it?

nocturne elbow
#

Either loaded by your plugin or the player online

#

UserManager#loadUser(UUID)

wet grove
#

but the problem is I don't know their uuid

#

what does /lp user (user) info do?

#

because it works with offline players

nocturne elbow
#

LP has mappings of names -> uuid

#

But you shouldn't rely on another plugin for getting someone's UUID

#

Thought of Bukkit.getOfflinePlayer(String)?

wet grove
#

thats depreciated I though?

nocturne elbow
#

It's deprecated but that's because it can potentially cause a request to mojang's servers, and if ran on the main server thread it can cause lag

wet grove
#

the thing is I want to get a bedrock player's uuid

#

and thats not on mojangs api

#

so I was thinking of using luckperms

nocturne elbow
#

potentially

#

If the player has joined before, it won't

#

The server will load it from local storage

wet grove
#

oh cool

#

thanks

nocturne elbow
#

Make sure to check OfflinePlayer#hasJoinedBefore() before getting the UUID

wet grove
#

I see

#

thank you!

nocturne elbow
#

np

clever lake
#

When i try to remove a user's group using this: it doesnt remove it am i doing it right (No Errors in console, and yes the user is online)

Node node = InheritanceNode.builder(rank).build();
        lpapi.getUserManager().modifyUser(player.getUniqueId(), (User user) -> {
            user.data().remove(node);
            lpapi.getUserManager().saveUser(user);
        });
nocturne elbow
#

lpapi.getUserManager().saveUser(user);
The idea of UserManager#modifyUser(UUID, Consumer<User>) is that it loads and saves the user into storage for you so you might as well want to remove that :p

clever lake
#

ok

nocturne elbow
#

But that's not the issue lol

clever lake
#

lol

nocturne elbow
#

NodeMap#remove(Node) will remove the node if all of it matches exactly, that is:
* key
* value
* context
* expiry time

#

And it'll only work if the user itself contains the node directly, it won't remove it if a group the user inherits has the node

clever lake
#

the user has the group

nocturne elbow
#

In the case of key and value it's no issue since it's an inheritance node

#

(unless it's set to false for some reason lol)

clever lake
#

it isnt

nocturne elbow
#

mm are you testing this rn?

clever lake
#

yes

nocturne elbow
#

Mind showing me a screenshot of /lp user <user> parent info and the name of the group you want to remove?

clever lake
nocturne elbow
#

And the full snippet of code that runs the modifyUser too

#

method, class, whatever

clever lake
nocturne elbow
#

hm do me a favor

wild whale
#

How are you getting the api?

#

(i.e. how is Moosecore.lpapi set)

clever lake
nocturne elbow
#

I'm assuming the hooking is correct bc "No Errors in console"

clever lake
#

yes

#

giving the rank to a player works

violet sand
#

quick question. sorry to interrupt.

http://prntscr.com/ukr9gi

target is an offline player, and the if statement is firing, and i'm not sure why. this works when the player defined by User is online.

Lightshot

Captured with Lightshot

nocturne elbow
#

Just because it's not null doesn't mean it's online

#

Maybe you/another plugin loaded the user data from storage

#

So getUser won't return null in that case

pseudo bramble
#

@clever lake curious, what's the input of strings?

violet sand
#

also. when that player joins it i guess loads the data? because when they leave (offline) it won't return null

pseudo bramble
#

could we see more context there

violet sand
#

so i guess theres just no data to get yet

nocturne elbow
#

Anyhow, Moose, do me a favor and add System.out.println(rank) in your takeRank method

pseudo bramble
#

that also works

nocturne elbow
#

(and check console when that runs see what it prints)

clever lake
#

ok

nocturne elbow
#

also. when that player joins it i guess loads the data?
yes

violet sand
#

so no data has been loaded, so how am i supposed to get it?

clever lake
nocturne elbow
#

UserManager#loadUser(UUID)

#

mm Moose try turning that lowercase

#

idk if it's case sensitive tbh

violet sand
#

that worked tysm.

nocturne elbow
#

np

clever lake
#

still doesnt remove the rank even when i make it lowercase

pseudo bramble
#

perhaps there's trailing whitespace

clever lake
#

nope

nocturne elbow
#

lp group dev info?

clever lake
nocturne elbow
#

hmm the node builder makes it lowercase anyway

#

I'm assuming you're running a command for that, right?

clever lake
#

to run the takeRank function?

nocturne elbow
#

Anyhow, Moose, do me a favor and add System.out.println(rank) in your takeRank method
do System.out.println(player.getName())

#

just to make sure you're targeting the player you're thinking you're targeting

clever lake
nocturne elbow
#

uh

#

:|

#

wtf

clever lake
#

(I'm using the same inputs for giveRank and that works)

nocturne elbow
#

What does user.data().contains(node, NodeEqualityPredicate.EXACT) return?

clever lake
#

UNDEFINED

nocturne elbow
#

uh

#

oh it returns a tristate right

#

mind sending an editor link?

clever lake
#

for dev group?

nocturne elbow
#

for the user

clever lake
nocturne elbow
#

:|

clever lake
#

and only 3 of thoses prems have a use / plugin checking for them

nocturne elbow
#

brah wtf

pseudo bramble
#

perhaps the data just isn't synced? I'm clueless at this point

#

checked the code, everything should be fine with that

clever lake
#

after a restart should the data sync

pseudo bramble
#

I mean, you can try /lp sync first

nocturne elbow
#

I mean the user is online and modifyUser loads it if it isn't loaded already

clever lake
#

I mean, you can try /lp sync first
doesnt work

nocturne elbow
#

ngl I'm 10000% clueless

#

how tf is it undefined...

clever lake
#

also api version 5.1 and luckperms version 5.1.106

pseudo bramble
#

try the sync then see what the data contains value states

clever lake
#

still undefined

nocturne elbow
#

try with NodeEqualityPredicate.ONLY_KEY?

#

idfk at this point lmao

clever lake
#

using that is true

nocturne elbow
#

but it's an inheritance node.......

#

doesn't make any sense...

pseudo bramble
#

this may sound dumb

#

but is dev somehow acting as default?

#

aka the undeletable group

nocturne elbow
#

users can not have default if they have other groups

pseudo bramble
#

ahh, forgot that part

clever lake
#

you can delete dev

wet grove
#

for some reason, using bukkit.getOfflinePlayer didn't seem to work on non mojang users. Is there anyway I can get the mapping of player to uuid through luckperms api?

nocturne elbow
#

euh.. ngl that's a weird setup you got right there but AFAIK it should work fine if the player has joined before

#

soooo.... yeah no idea

#

Is there anyway I can get the mapping of player to uuid through luckperms api?
I am not sure but I don't think you can

wet grove
#

what about if I somehow hook into the plugins core?

#

because all the classes are public

nocturne elbow
#

I mean you could do that but I personally won't provide any support for it bc it's not supposed to be used from the outside (that's what an API is for) ¯\_(ツ)_/¯

wet grove
#

ah I see

shell forge
#

how would you go at giving a user temporary group using the api?

clever lake
#

InhertiancdNode.bulder("rankname").expiry(inputs here); (for thee node)

shell forge
#

how to import luckperms using gradle

obtuse jolt
#

!api

frank driftBOT
shell forge
#

i followed it but it doesnt seem to be importing properly

obtuse jolt
#

explain more

shell forge
#

like its in my build.gradle file and i refreshed it to install the luckperms but when i try to import it the class isnt found

obtuse jolt
#

!paste your gradle and how you import the luckperm class

frank driftBOT
#
Please use pastebin!

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

For console errors:

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

Other errors:

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

shell forge
#

both files are there

#

i use eclipse so ctrl + shift + o is how to import

obtuse jolt
#

i dont see you importing luckperms in your code at all tho, iirc its like import net.luckperms.api.LuckPerms;?

shell forge
#

it says it cannot be resolved

iron saddle
#

I was going to ask about fabric but i know how to use the search box owosneaky pure You go i509VCB! Not gonna ping ya o-o

haughty solar
#

Can you query whether a user is in the database?

#

With the Luckperms api

nocturne elbow
wild whale
#

No advertising.

#

For fucks sake.

shell forge
#

how do you check if the group exists in the db?

nocturne elbow
#

I literally linked that above

shell forge
#

but not the user, the group is what i want to check if the group exists in the database doesnt necesarrily mean the user should have the group

nocturne elbow
#

Oh a group

#

Just GroupManager#loadGroup(String)

#

If it returns null it doesn't exist

#

¯\_(ツ)_/¯

shell forge
#

ok ok thanks

nocturne elbow
#

Mb it does not return null bc:
a) it returns a CompletableFuture
b) it gets populated with an optional
And c) "Returns an empty optional if the group does not exist."
So yeah don't trust me, trust the docs @shell forge

wet grove
haughty solar
#

thanks

potent oasis
#

Is it possible to use the messaging system configured in luckperms from another plugin ?

clever heron
#

Alguien que hable español sabe como sacar la variable para la compatibilidad de rangos con mi plugin?
Ejemplo: luckperms.getRanks
O que metodo se usa?

nocturne elbow
#

La qué de qué....

clever heron
#

xdxd

#

Resumen, tengo un plugin y la pregunta es como hago para que el rango de un usuario se muestre en la scoreboard

nocturne elbow
#

@potent oasis not that I know of... what are you planning to do? Sounds nefarious

clever heron
#

Gracias 2469_xQcL

potent oasis
#

Well, instead of use an other system of messaging/broadcast (like bungeecord messaging but need someone on the server, redis or rabbitmq) why not use the configured system of luckperms

nocturne elbow
#

I mean, you could try and see how it is implemented and used in LP and imitate it, although I'm sure a bit of googling might solve it

potent oasis
#

yea i searched a bit in the code, but expect someone could know which method use to send and register a listener for that here owoMochaThink

nocturne elbow
#

I mean it depends on your needs, platform and platform availability 🤷‍♂️

potent oasis
#

well, just send and listen raw message, I saw there is some an Messager abstract class but didn't find out how to get it, will search more

nocturne elbow
#

"just send and listen raw message" highly depends on the messaging system used

#

I mean plugin messaging is one of the options

potent oasis
#

in fact we use sql, and don't really want to use redis or something else just for messaging, so I have to use (or copy) the way that luckperms use sql as a messaging system

nocturne elbow
#

I suggest you either copy it complying with the license or google a bit on how to do it and make it yourself sticking to no license (other than the ones already having a role)

obtuse jolt
#

just curious, why is sql messaging not sufficient?

potent oasis
#

it is

#

but

#

why would I implement something in my plugin if it is already implemented in luckperms

nocturne elbow
#

Because it is implemented for LuckPerms?

potent oasis
#

.> maybe

#

it still 1 connection instead of 2

nocturne elbow
#

what??

potent oasis
#

connection to sql server

nocturne elbow
#

LuckPerms uses 10 connections to the sql server

potent oasis
#

lol

nocturne elbow
#

And many other plugins use more than just 1 as well

#

Concurrency is a thing :^)

potent oasis
#

haha

prime glacier
#

Does anyone have an idea why the user in this case don't get the rank? There is no error in the console

clever lake
#

Is the user online?

prime glacier
#

He got kicked before saveUser

clever lake
#

Thats might be why he didnt

nocturne elbow
#

Why save the user twice

prime glacier
#

Oh

nocturne elbow
#

In any case I suggest you start printing stuff, like if the group is available, the expiry time, the time unit, etc etc.

prime glacier
#

okay

nocturne elbow
#

And I also suggest you use UserManager#modifyUser, it will load and sync the user data from storage, run the provided action and save it for you, all of it asynchronously too

prime glacier