#luckperms-api

1 messages ยท Page 33 of 1

native thistle
#

all i need is a better prefix plugin

#

that i can understand

crystal sonnet
#

Vault is as simple as it gets

native thistle
#

yes ik but the people showing me how to use it arnt

rustic laurel
#

Brain wrote th code for you

crystal sonnet
#

Minecraft is not the place to learn Java

rustic laurel
#

The simplest code he could've

native thistle
#

you are proving my point

crystal sonnet
#

And you're not understanding it

#

The thing is we are not here to teach you how to program

#

The thing I posted is super easy to understand

native thistle
#

im not asking for that

crystal sonnet
#

And you're not understanding it

native thistle
#

all i was asking is to give me a simple way to under stand vault

crystal sonnet
#

Which means writing plugins is waaay too advanced for you right now

rustic laurel
#

and we diddd ๐Ÿ˜ฉ

native thistle
#

bro

#

first you didnt show me how to instal

crystal sonnet
#

There's not way to make it simpler except feed you the code

native thistle
#

i had to figher that out

crystal sonnet
#

Yes because you should be able to do that on your own

#

And btw you did it wrong

#

It works but that's not the right way to do it

#

And that is the thing

#

You are so inexperienced that you are not even understanding what you're not understanding

#

I really want to help you

#

But you are not ready

#

Like you are currently learning to walk. And what you're trying to do is running a marathon

#

And installing vault would be the equivalent of tying your shoes

#

They are gone btw

#

I wonder how many more frustrating weeks it's gonna take them before they either understand that they actually need to learn java or give up

lime rune
#

LuckPerms source isn't for beginners. There exist more simpler permission plugins which is easier to read and understand from.

#

oh that dude left :/

nocturne elbow
#

lmao like almost 12hs ago

lime rune
#

my discord is just kinda delayed idk

obtuse jolt
#

ye always happens

primal silo
#

Hi have a small question regarding the Java API.
I was wondering how one would retrieve the current active groups for a certain player.
With active I mean for the current context. What is the best way to retrieve those groups

rustic laurel
#

!api

frank driftBOT
rustic laurel
#

The two links here should guide ya

primal silo
#

Maybe I am overlooking something. If that's the case I'm sorry.
So when I do groupManager.getGroup(groupName) it will retrieve me the group. But I guess this is independent from the context?
I don't really know how to retrieve the currently active groups for a certain user. I saw something about using the user.getDistinctNodes() method. But not sure if this is the right direction to go in

#

And if I use getNodes() does it take the context into account?

nocturne elbow
#

I think you'll want to PermissionHolder#getInheritedGroups(QueryOptions), with the query options with contexts added

#

Defo take a look at the QueryOptions doc page

primal silo
#

Something like this:

Collection<Group> groups = user.getInheritedGroups(user.getQueryOptions());

And the queryOptions are automatically build by LP based on the environment?

nocturne elbow
#

I think that would work, yes

primal silo
#

Ok thanks! I'll try that

native thistle
#

ok so with yesterdays help

#

i did a little figgling

#

and came up with this

#
public Chat chat;

    @Override
      public void onEnable() {
        this.getServer().getPluginManager().registerEvents(this, this);
        
        if (Bukkit.getOnlinePlayers().isEmpty())
            for (Player online : Bukkit.getOnlinePlayers()) {
                createBoard(online);
                start(online);
                
                setupChat();
            }
      }
    

    
    @Override
      public void onDisable() {
       
      }
    
    private boolean setupChat() {
        RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(Chat.class);
        chat = rsp.getProvider();
        return chat != null;
    }
    
    @EventHandler
    public void onInventoryClick(final InventoryClickEvent e) {
    String prefix = chat.getPlayerPrefix((Player) e.getWhoClicked());
    }```
#
Score score4 = obj.getScore(ChatColor.GRAY+ ">> " + ChatColor.GOLD + "Rank: " + ChatColor.WHITE + chat.getPlayerPrefix(player));
        score4.setScore(2);```
nocturne elbow
#

Welcome back

native thistle
#

โค๏ธ

wild whale
#

On mobile, but see a few issues

native thistle
#

this is my main

#

code

wild whale
#
  • Bukkit.getOnlinePlayers inside a .isEmpty of that seems pointless. Did you forget to invert that?
#
  • checking if players are online in your onEnable seems pointless given that will only really fire during startup before the server is accepting connections
native thistle
#

ok

#

getting rid of thos

wild whale
#
  • main class also implementing listener is usually frowned upon
native thistle
#

i have another class

#

but my bukkit

#

get online playres is for

#
Score score2 = obj.getScore(ChatColor.GRAY+ ">> " + ChatColor.GOLD + "Online Players: " + ChatColor.WHITE + Bukkit.getOnlinePlayers().size());
        score2.setScore(4);```
wild whale
#

???

#

The 2 are unrelated?

native thistle
#
@Override
      public void onEnable() {
        this.getServer().getPluginManager().registerEvents(this, this);
        
        if (Bukkit.getOnlinePlayers().isEmpty())
            for (Player online : Bukkit.getOnlinePlayers()) {
                createBoard(online);
                start(online);
                
                setupChat();
            }```
wild whale
#

The code inside the if block will never run unless you are doing some really wierd things

native thistle
#

so i get rid of

#

wait

#

hold up

#

my setupchat(;

#

is in the wrong bracket

wild whale
#

Still doesn't change the fact that looping over a collection that is known to be empty makes zero sense

native thistle
#

no

#

lmfao it was it

#

lol

#

bec of you i say my mistake

#

ty

#
score4.setScore(ChatColor.translateAlternateColorCodes('&', prefix)).setScore(2);```
#

i added this to the code

#

to get rid of the &4

#

and prefix is giving me a issue

#

si i need to put prefix in ""

#

wait no i just added

#
String prefix = chat.getPlayerPrefix(player);```
crystal sonnet
#

What does setupChat() do?

native thistle
#

gets the prefix

#
score4.setScore(ChatColor.translateAlternateColorCodes('&', prefix)).getScore(2);```
#

i set it up like

#

and setScore is giving me a issue

crystal sonnet
#

What does setupChat() do?

native thistle
#

do i need to set it up at get score

#

for vault to get the prefix it needs to setupchat

crystal sonnet
#

I know what it does. I want to know if you understand it as well

#

Yes, but what does that method do?

#

And why are you calling it inside a loop?

native thistle
#

its in the name

crystal sonnet
#

Well then what does it do?

native thistle
#

sets up chat

crystal sonnet
#

Not quite

native thistle
#

hmm

crystal sonnet
#

Frankly not even close

native thistle
#

then what dose it

#

do

crystal sonnet
#

Or well depending on what you mean by chat

sudden pelican
#

why do you have this

@EventHandler
public void onInventoryClick(final InventoryClickEvent e) {
    String prefix = chat.getPlayerPrefix((Player) e.getWhoClicked());
}```
native thistle
#

im a biggener

crystal sonnet
#

Exactly

#

I want you to look at the code and try to understand it

#

Then I want you to find a good place to put it in your onEnable

#

Because where it is currently is the wrong place

native thistle
#

but it works

#

?

#

lol

crystal sonnet
#

Sure

#

So would if I went to the store and back home for every single item I need

#

I would get everything

#

But it would take ages

#

And I mean that's where I take issue with your approach. You paste stuff until it "works" without trying to understand what it does

native thistle
#

bec when i try to get help on google

#

the slap the "YUo nEED TO LeArn JaVA"

#

witch im trying to

#

but with out trying to help

#

and that is you rn

crystal sonnet
#

Yes. I'm not here to teach you java

#

You're currently learning to walk and you're asking for help with running a marathon. And meanwhile you're asking us to tie your shoes

#

And that's just not what we're here for

#

And unless you can demonstrate understanding of the code you're working with you will not get anything out of me other than "learn java", because that's the truth

#

Making plugins is not something you can copy paste together

#

I know that sucks

#

But that's the sad reality

obtuse jolt
compact zinc
#

oh ok

grand bough
#

just wondering if i could get some help with this i am trying to create time based ranks within my server and cant find anything online about it has anyone done this and could lend a helping hand?

nocturne elbow
grand bough
#

oh sorry

native thistle
#

i finished

#

it

#

lmfao

#

took a while

#

but its done

#

and it updates every time a player joins

#

or your rank

sudden pelican
#

Did you make sure it updates when a player leaves

native thistle
#

yes

#

but after a reload

#

the scoreboard wont load :p

#

it wont even show up in /plugins

#

its giving me

#

Ambiguous plugin name ServerSelector' for files plugins\SS.jar' and plugins\HS.jar' in plugins'

sudden pelican
#

Try changing the plugin name

native thistle
#

yes

#

that is what i did

#

from

#

HS

#

to HubScoreboard

#

it works

#

๐Ÿ˜„

#

i want to fix this issue but i cant resolve how

#

when a player clicks on the server selector

#

it is fine

#

but when the player

#

clicks on the compass

#

it runns the command

#
@EventHandler (priority=EventPriority.HIGH)
    public void onPlayerUse(PlayerInteractEvent event) {
        Player player = (Player) event.getPlayer(); 
        if(event.getItem().getType() == Material.COMPASS)
        player.performCommand("server");
        
    }
    ```
#

and gets rid of the compass

sudden pelican
#

Show the server command

native thistle
#

changed it to this

#
@EventHandler (priority=EventPriority.HIGH)
    public void onPlayerUse(PlayerInteractEvent event) {
        Player player = (Player) event.getPlayer(); 
        if(event.getItem().getType() == Material.COMPASS)
        player.performCommand("server");
        
    }
    @EventHandler
    public void onPlayerUse2(PlayerInteractEvent event) {

        Player player = (Player) event.getPlayer();
        ItemStack selector = new ItemStack(Material.COMPASS); //Creates the stack
           ItemMeta meta = selector.getItemMeta();
        ArrayList<String> lore = new ArrayList<String>();
           lore.add(ChatColor.GRAY + "Click to select server");
           meta.setLore(lore); 
           meta.setDisplayName(ChatColor.DARK_GRAY + "[" + ChatColor.RED + "Server Selector" + ChatColor.DARK_GRAY + "]");
           selector.setItemMeta(meta);
        player.getInventory().setItem(0, selector);
        if(event.getItem().getType() == Material.COMPASS)
            player.performCommand("server");
        
    }
    

            }
#

wait

#

that should be

#

a invitory on click event

obtuse jolt
#

you shouldnt be running /reload on minecraft servers anywyas

#

also, do fix your indentation...

nocturne elbow
#

Would probably be copying from intelliJ or other IDEs to discord. It fucks with the indentations

#

Sometimes

sudden pelican
#

๐Ÿคทโ€โ™‚๏ธ even his hastebins have weird indentation

nocturne elbow
#

Truth

obtuse jolt
#

the first and last line sure.... but look at the if condition, and the method onPlayerUse2 has lines with indentation so random lol

nocturne elbow
#

Ohhh I know what you mean yeah

obtuse jolt
#

is this about LuckPermsAPI?

nocturne elbow
#

Huh

obtuse jolt
#

the message was delete

#

ppl smh

#

always delete mesage and then make helper/mod look like we are talking to ourselves lol

nocturne elbow
#

Lol

remote flower
#

Hello

#

i have an issue with luckperms bungee

#

when i set a prefix it says %vault_prefix%

nocturne elbow
#

No need to post in multiple channels, and this isn't about the developer API anyhow

rustic blade
#

What is the simplest way to set a group for a player as parent...
I watched they API but i dont get it ...

neat jackal
#

Remove all other inheritance nodes and add the new one

rustic blade
#

So this
user.data().clear(NodeType.INHERITANCE::matches);
removes all inheritance ?

#

And how can i check if he has the group allready ?

hallow harbor
#

I am trying to make an owner prefix but it is not showing up

nocturne elbow
#

Why would you post it in the dev api channel

hallow harbor
#

huh

nocturne elbow
#

This is the dev api channel

hallow harbor
#

what is that

nocturne elbow
#

DEV API

#

Developer API

hallow harbor
#

what does that mean

nocturne elbow
#

Oh dear

rustic blade
#

And how can i check if he has the group allready ?
๐Ÿ˜ฆ

nocturne elbow
#

#readthedocs

#

!api

frank driftBOT
rustic blade
#

didnt found something

#

and im not blind ๐Ÿ˜„

nocturne elbow
#

So you call user.data() and you can get all the nodes, right?

#

What does it return? What does data() return?

rustic blade
#

What does it return? What does data() return?
@nocturne elbow NodeMap

frank driftBOT
#

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

rustic blade
#

Wait i will get a "permission" with the group name ?

nocturne elbow
#

Everything is a node

#

Different types of nodes, but everything is a node, and as far as Bukkit is concerned, everything is a permission node

rustic blade
#

Okay

nocturne elbow
#

yea

rustic blade
#

user.data().clear(NodeType.INHERITANCE::matches);
That will clear all inheritance correct ?

nocturne elbow
#

Yes

rustic blade
#

So basicly

public void giveUserRankOrMoney(Player player, RewardModel boosterModel) {
        String groupName = String.valueOf(boosterModel.getCustomProperties().get("value"));
        if(player.hasPermission("group." + groupName)){
            this.getEconomyAPI().addMoney(player.getUniqueId(), this.filterNumber(String.valueOf(boosterModel.getCustomProperties().get("money"))));
            return;
        }
        this.luckPerms.getUserManager().modifyUser(player.getUniqueId(), (User user) -> {
            user.data().clear(NodeType.INHERITANCE::matches);
            user.data().add(InheritanceNode.builder(groupName).build());
        });
    }

This will give the user the rank and when he already is a parent he will get money correct ?

nocturne elbow
#

should

rustic blade
#

Okay ^^ Thanks

clear wing
#

Could someone help me, when I put the plugin on the server it does not turn on

novel canopy
#

wrong channel

#

use one of the general ones

nocturne elbow
#

^

nocturne elbow
#

Does Luckperms has events?

#

Like permission update event and stuff?

nocturne elbow
#

Yes it does

#

!api

frank driftBOT
nocturne elbow
#

There's a section in there called "Listening to events" or something like that

#

@nocturne elbow

#

The very last section in that Usage link

gritty palm
#

Does luckperms support multiple groups? All I see in user is "getPrimaryGroup"

crystal sonnet
#

!api the javadocs are linked pretty far up. Also check the inherited methods

frank driftBOT
native thistle
#

wait nvm

wet agate
#

How can I get all groups that a player is in?

#

Using luckperms.

obtuse jolt
#

With the api?

wet agate
#

Yes

obtuse jolt
#

!api if so

frank driftBOT
wet agate
#

I already looked inside of the User class and I can't seem to find it.

obtuse jolt
jaunty valley
crystal sonnet
#

@jaunty valley why are the LP packages in your jar?

jaunty valley
#

Shouldn't it be? I don't know. It is gradle's work.

#

It's API module

crystal sonnet
#

That's shading

#

Don't shade plugin APIs

#

Shouldn't it be?
No it shouldn't. In fact it mustn't!

jaunty valley
crystal sonnet
#

APIs should be compileOnly

jaunty valley
#

Ah, ok

crystal sonnet
#

How you configured it everything that's a compile dependency is shaded in

#

Only shade external libraries

#

Not APIs

jaunty valley
#

Thank you.

crystal sonnet
#

You're welcome

nocturne elbow
#

When should implementation be used then if not when using APIs? ๐Ÿค”

crystal sonnet
#

When you're using the modern notation

#

compile and compileOnly are the old notation

nocturne elbow
#

O

misty hinge
#

API's should be compileOnly

#

looks at litebans API
uhhhh

prime glacier
#

How can I change the Prefix of a user?

sudden pelican
ember spruce
#

Hey how do i get the prefix from a group (plugin)?
I only find the displayname but i need the prefix

obtuse jolt
ember spruce
#

thanks

wild whale
#

!usage

frank driftBOT
willow thistle
#

whats the code for letting people warp in essentials

crystal sonnet
#

What does that have to do with the LP API?

#

Also the code is Open Source @willow thistle

willow thistle
#

nonono im in luckperms editor and i need to know the code so people in default group can warp to all the warps but i dont know the permissions code

crystal sonnet
willow thistle
#

how?

obtuse jolt
#

bcu luckperms isnt a permission node encyclopaedia... look at your plugin documentation that handle warps for the relevant perm nodes

nocturne elbow
#

What is it

#

Everyone might be able to help

#

Even Tim

#

And we can't help if you don't explain your problem

#

What is it?

#

lol

#

lol

#

wow

#

That way nobody will ever be able to help you, bud :\

#

Riperino

junior jay
#

So I am trying to Hook into LuckPerms in my spigot plugin
But the Registration is null and therefore i am unable to get the API
The plugin is enabled (i have a check for it and it doesn't trigger).
Can anyone help me with this?
I can share what I have done so far if you want.

#

I have tried static access too but that throws IllegalStateException (as mentioned in the docs).

#

I do have LuckPerms as a depend in my plugin.yml

nocturne elbow
#

!paste Mind sharing the plugin.yml and the whole class that gets the LP instance?

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!

junior jay
nocturne elbow
#

I asked for the whole class, not only the method.
When does loadLuckPerms() get called? On onEnable or onLoad?

junior jay
#

In the onEnable()

wild whale
#

could you just send the whole class?

junior jay
#

ok...

#

(I tried using static access there btw)

wild whale
#

try { ... } catch(Exception ignored) {return false;} is almost never a good idea

junior jay
#

which line are you talking about?

nocturne elbow
#

This is a silly question but just making sure... LP is installed on the server you're testing this, right?

wild whale
#

around LuckPermsProvider.get()

junior jay
#

This is a silly question but just making sure... LP is installed on the server you're testing this, right?
@nocturne elbow yes it is

frank driftBOT
#

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

junior jay
#

uh sorry

#

around LuckPermsProvider.get()
the exception only says that the API was not loaded yet

nocturne elbow
#

that sounds more like a bukkit thing...

nocturne elbow
#

I mean, the issue

junior jay
#

Is there a way I can wait for the API to get loaded?

nocturne elbow
#

You could listen to PluginEnableEvent

junior jay
#

hm ok

#

wait actually

#

It fixed itself

#

:/

nocturne elbow
#

computers smh

crystal sonnet
#

@junior jay @nocturne elbow this error is commonly caused by shading the API. Or on other words having the LP API classes in the plugin jar.

#

They must not be in the plugin jar

junior jay
#

They weren't

#

but it's fixed now so all good

errant night
#

hey so some of my plugins permissions are enabled but it still syas no permission when i try then

#

them*

rustic laurel
#

No need to ask in several channels

sleek jay
#

For some reason when I add luckperms to my pom.xml I can't use it... anyone know why?

<dependency>
  <groupId>net.luckperms</groupId>
  <artifactId>api</artifactId>
  <version>5.1</version>
  <scope>provided</scope>
</dependency>
nocturne elbow
#

Are you syncing your maven project? ๐Ÿค”

sleek jay
#

well I'm reloading it

latent briar
#

Hi guys. Is there event that is triggered when a player has a new parent group?

nocturne elbow
#

And you check if the node is an inheritance node

errant ermine
#

Does luck perms support fetching perms for offline players?

nocturne elbow
#

You need to load the user first through the user manager, and then do all the queries you want

errant ermine
#

and to be clear, users can be loaded offline?

nocturne elbow
#

I think you have to use their UUID?

#

I think

#

Yes, that's why you load them, online users have their data already loaded.

#

And yes you need to use the UUID

drifting breach
#

Hi! Is there an event that is triggered when a player requests for a web editor link?

nocturne elbow
#

Probs

short fossil
#

You can always just make a onCommand event listener and filter it from there

nocturne elbow
#

Yeah PlayerCommandPreprocessEvent will do more than okay

obsidian pilot
#

hey. Is there something like a UserUpdateRankEvent or should i use a combination of UserPromoteEvent and UserDemoteEvent.

nocturne elbow
#

If you're using tracks, those are the ones you want to listen to

#

If you're using tracks

obsidian pilot
#

and if not?

nocturne elbow
#

If not, you should listen to NodeAddEvent and NodeRemoveEvent

obsidian pilot
#

ok. There is no singe UserChangeRankEvent

#

I wonder why sth like UserChangeGroupEvent#getOldGroup and UserChangeGroupEvent#getNewGroup won't exist

nocturne elbow
#

Because with NodeAddEvent and NodeRemoveEvent you can do that

#

GroupAddEvent?

#

Is that a thing?

#

Oh yeah

obsidian pilot
#

GroupAddEvent?
what if a player already has a group?

nocturne elbow
#

because group.<group>

#

what if a player already has a group?
???

#

itll still trigger the listener Im sure
Edit: I stand corrected

#

If they already have it, nothing will happen

#

Is that a thing?
no it's not

obsidian pilot
#

represents a Node a group? Or how do i have to understand you?

nocturne elbow
#

Everything is a node

#

A permission is a permission node, an inherited group is an inheritance node, a prefix/suffix is a chat node

#

youd just have to get the node and check what it is in your listener

#

If not, you should listen to NodeAddEvent and NodeRemoveEvent
You can have to listen to those and check if the node.getType is of NodeType.INHERITANCE

obsidian pilot
#

ok. Luckperms will define groups over permissions? I thought it works with sql entries?

nocturne elbow
#

????????????????

#

what????

#

lol

obsidian pilot
#

You say a Node is instance of PermissionNode

nocturne elbow
#

When a user is added to a group, they get the node group.<groupname>

#

No, I say a permission is a node of type permission node

#

A permission is a permission node

#

Not "A node is a permission node"

#

A permission is a node

#

lol

obsidian pilot
#

does someone has the docs link for Node to me?

rustic laurel
#

It's on the javadocs

obsidian pilot
#

i know

#

thx

nocturne elbow
#

๐Ÿฅ„

#

lololol

obsidian pilot
#

rly... On github docs is no package name for Node...

#

so why do you say ๐Ÿฅ„

#

i just asked for a docs link -,-

nocturne elbow
#

And there it is

#

๐Ÿ‘€

#

Im not going to say anything

obtuse jolt
#

you just said something ^ ๐Ÿค”

nocturne elbow
#

Fefo, why are you using compact mode

#

Because I like my chat clean

zenith dagger
#

compact mode is disgusting

#

you cant tell whos talking

#

like imagine having to read

nocturne elbow
#

get out of dev api if u cant dev

obsidian pilot
#

After you told me about Node i found NodeMutateEvent. Why should i use a combi of NodeAddEvent and NodeRemoveEvent if there is a NodeMutateEvent that is exactly what i need.

nocturne elbow
#

I guess we don't all know all the ins and outs of the API

#

, sorry about that

#

Because NodeMutateEvent isn't an event that gets called at any time, but rather the subclasses that extend it

#

It's like trying to listen to Event on bukkit

#

it'll do nothing

#

because Event per se doesn't get called at any time

#

but rather the subclasses that extend it

obsidian pilot
#

UFFF I see my mistake.... I havn't seen extends NodeMutateEvent

solemn condor
#

Hi folks, there is any Event to when the player change the main group?

nocturne elbow
#

Nope, you should listen to a combination of NodeAddEvent and NodeRemoveEvent (maybe NodeClearEvent instead of Remove, unsure how that one works)

errant ermine
#

what is the equivalent of bukkit's Permissible#isPermissionSet() for LP's User object?

nocturne elbow
#

@errant ermine you can either call PermissionHolder#data() and NodeMap#contains(Node, NodeEqualityPredicate) or you can PermissionHolder#resolveInheritedNodes(QueryOptions) and check if the returned collection contains a node with the key you need

errant ermine
#

Ty

errant ermine
#

It seems that resolveInheritedNodes doesn't pick up inherited nodes that are set to false, whereas Permissible#isPermissionSet does, is there a way to workaround this?

#

Actually nvm it seems using PermissionHolder#getCachedData() in tandem with getPermissionMap() gets all the user's nodes regardless of value

nocturne elbow
#

So does NodeMap#contains with the proper equality predicate :)

#

It seems that resolveInheritedNodes doesn't pick up inherited nodes that are set to false, whereas Permissible#isPermissionSet does, is there a way to workaround this?
And that should work for any node regardless of value ๐Ÿค”

#

I mean, if it didn't, I'm sure LP would be 100% broken

errant ermine
#

I printed the backing map and the inherited nodes that were set to false didn't appear but the ones that were true were in the map

drifting echo
#

hey

nocturne elbow
#

Hello

errant ermine
#

For getPermissionMap()#contains it returns UNDEFINED but I'm pretty sure thats because the nodes I'm looking for are inherited, and not part of the user itself

#

ignore my previous comments it seems to be working now, I must've borked something beforehand

dusty imp
#

How do I get or prefix the player?

echo steppe
#

PlaceholderAPI should work

#

With the LuckPerms addition

nocturne elbow
#

Vault is your best bet

#

So LP gives you the prefix you actually want to see, it'll sort all the stacking, weights and stuff

solemn condor
#

Hey @jaunty pecan sorry to pin you but currently I'm working on a project of scripting with Kotlin and I need to relocate the script dependencies, I was thinking in use jar-relocator, to problem is that RElocatingClassVisitor and RelocatingRemapper is not public, I want to know if could make it all public or if you give me permission to make a PULL REQUEST with this feature

frank driftBOT
#

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

solemn condor
#

because, currently I basicly coping pasting from jar-relocator

untold cloud
nocturne elbow
#

I want to know if could make it all public or if you give me permission to make a PULL REQUEST with this feature
@solemn condor isn't it open source?

#

I mean, you can do pretty much anything you'd like without consulting at all as long as it complies with the license

dusty imp
#

How do I get or prefix the player?

nocturne elbow
#

Vault is your best bet

So LP gives you the prefix you actually want to see, it'll sort all the stacking, weights and stuff

crystal sonnet
#

@untold cloud Make sure that your plugin at least softdepends on LuckPerms

untold cloud
#

wdym?

wild whale
#

plugin.yml

crystal sonnet
#

In your plugins.yml you can declare dependencies

#

And not only should you do that but since this affects loading order sometimes you need to

untold cloud
#

ah ok ty, didn't think it affected anything except stopping the server and not loading

#

for sponge i'd just declare it in the Plugin annotation right?

crystal sonnet
#

Oh. It's Sponge

#

Then yes

#

If the dependency is optional, mark it as such

rich flare
#

I'm new to making plugins... I'm trying to make a plugin that is a global list command (displays a list of everyone online), and I was using LP api for that. It's just, now that I added it into my command, the command doesn't seem to get registered. I still have it in the PluginManager portion of my main onEnable. Thanks for any help.

nocturne elbow
#

Okay, uhm, two things:

(displays a list of everyone online), and I was using LP api for that
??????

the command doesn't seem to get registered
getCommand("mycommand").setExecutor(commandExecutor)?

obtuse jolt
#

why do you need LP api to display players online?

nocturne elbow
#

bukkit#getOnlinePlayers?

#

Bukkit.getPlayers() is a thing... you know?

rich flare
#

why do you need LP api to display players online?
basically: I want it to look cool. i don't just want a list like "here's players on the server" I want a list of who is on which server divided by role.

nocturne elbow
#

If you're looking to list players by specific permissions, use a for loop

rich flare
#

Well... Yeah. The thing is... my command isn't getting registered.

nocturne elbow
#

You dont need lp api

#

on which server
That screams bungeecord plugin

#

getCommand("mycommand").setExecutor(commandClassName())

rich flare
#

yes. It is a bungee plugin.

nocturne elbow
#

Oh true

rich flare
nocturne elbow
#

And your command class how does it look like?

#

idk bungeecord API so i will leave this conversation

rich flare
#

It's a mess of spaghetti code, but do you want me to send it here?

nocturne elbow
#

hastebin

rich flare
#

okay

nocturne elbow
#

Question, why don't you start with the spigotAPI instead of diving right into making bungeecord plugins?

rich flare
#

I have.

#

I am just new to APIs.

nocturne elbow
#

Question, why don't you start with the spigotAPI instead of diving right into making bungeecord plugins?
It's not harder, it's just different

#

Thats why I asked

rich flare
#

Oh.

#

Well... I have only been doing this for like a year... so.

nocturne elbow
#

I found this

#

You might want to mark your execute with an @Override annotation

rich flare
#

I tried that... It gave an error.

nocturne elbow
#
public ProxiedPlayer FindByPermission(String permission) {
    for (ProxiedPlayer p : ProxyServer.getInstance().getPlayers() ) {
            if (p.hasPermission("group.group") return p;
        }
    return null;
}  ```
#

wat

#

how would it give an error

rich flare
#

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

#

just does man

obtuse jolt
#

send your code and error message then

nocturne elbow
#

no it doesn't "just does"

rich flare
#

'ey look at that. it doesn't error.

nocturne elbow
#
@Override
public void execute(CommandSender sender, String[] args) {
  //blah blah
}
rich flare
#

It used to.

nocturne elbow
#

k cool now try compiling and running the command

rich flare
#

For some odd reason.

sudden pelican
#

you loop through the same thing in two different for loops which is just like why?

nocturne elbow
#

huh?

sudden pelican
#
        for (ProxiedPlayer player : players){
            playerServers.put(player, player.getServer());
        }

        for (ProxiedPlayer player : players){
            playerGroup.put(player, api.getUserManager().getUser(player.getName()).getPrimaryGroup().toLowerCase());
        }```
rich flare
#

Still doesn't think it is a command.

nocturne elbow
#

Where did that come from

sudden pelican
#

compileList methods

nocturne elbow
#

This may help

rich flare
#

you loop through the same thing in two different for loops which is just like why?

I don't use Java much so it is a learning curve. Plus, I was trying to get past the limitations of just Bungee API.

I expect my code will be a LOT less "spaghetti" once I actually get LP API to work.

nocturne elbow
#

You shouldnt need LP api to get online players

#

qq

sudden pelican
#

okay

nocturne elbow
#

both are CommandSender

#

both have sendMessage

rich flare
#

one for console one for player

sudden pelican
#

you only need the one

rich flare
#

Oh.

#

Just how I code.

nocturne elbow
#

I didnt see them send the code here. I was wondering where it was all coming from ๐Ÿคฆโ€โ™€๏ธ

#

Check to see if it is an instanceof a player

#

Then use else

#

lol

rich flare
#

This may help
The thing is... I don't need something like that...
I am trying to make a per-rank global list. Which won't work with Bungee API due to the fact that player.getPermissions doesn't show the LP group permissions. (Or any LP permission... for that matter...)

So, I need LP API.

sudden pelican
#

I don't even think he needs to, doesn't seem like he's using any player specific methods

nocturne elbow
#

Would just have to change player.sendMessage to sender.sendMessage

rich flare
#

Guys... The problem isn't my code being spaghetti. I know that. I will fix it myself when I figure out why the command isn't registering.

nocturne elbow
#

You can ditch half of your code Nitrate and simplify it

rich flare
#

I know.

#

The problem isn't that though.

nocturne elbow
#

Might help you better understand whats going on

#

on the commands

#

I might have an idea

rich flare
#

No. I understand that it isn't my GlobalListCommand command.

nocturne elbow
#

Wheres the @Override?

#

remove the aliases containing :

rich flare
#

I put it in after sending.

nocturne elbow
#

Okay

rich flare
#

:/

#

I just want my command to actually register. Is there anywhere I need to instantiate the LuckPerms api thing in my Main class?

nocturne elbow
#

I might have an idea

remove the aliases containing :

rich flare
#

?

#

oh

#

no. It was working like that before.

nocturne elbow
#

m okay

rich flare
#

I've had this working. I just need to change it because it wasn't working like I wanted.

nocturne elbow
#

send your main class?

rich flare
#

And when I added LP api, it now won't register my command.

#

No errors or anything.

#

ok one sec.

nocturne elbow
#

What do you need LP API for?

sudden pelican
#

did you add it as a softdepend or depend

nocturne elbow
#

I still dont get it

#

to get the primary group

#

But you could just check permissions cant you? Or is that not a bungeecord api thing?

rich flare
sudden pelican
#

if they don't use lp api they'd need to know all the groups ahead of time

nocturne elbow
#

eeh as I said, bungee is different

#

True

#

That makes sense

#

Thanks Jordan lol

rich flare
#

Thanks jordan. I'm tired and don't know how to explain stuff.

nocturne elbow
#

do any of the other commands register?

rich flare
#

how do I add "softdepends" I saw it on another API set up but I didn't know how to do it for this one. (Someone should add that to the wiki.)

nocturne elbow
#

bungee.yml

rich flare
#

Well... duh. :P

nocturne elbow
#
softdepends:
  - LuckPerms
#

add that

rich flare
#

okay.

nocturne elbow
#

at the "root" level of the yml

rich flare
#

yep

nocturne elbow
#

dumb question

#

but have you tried without the (this)

#

I mean, you'll want it to be depends instead of softdepends

#

because your plugin won't run without LP

sudden pelican
#

why doesn't bungee support arrays for authors ๐Ÿ˜”

nocturne elbow
#

getProxy().getPluginManager().registerCommand(this, new StreamCommand()); instead of getProxy().getPluginManager().registerCommand(this, new StreamCommand(this));

rich flare
#

no. You need the this.

#

But thanks.

nocturne elbow
#

Oh wait

#

im being hella stupid

#

you are

#

smh

rich flare
#

okay. I'm going to test it with the depends in.

#

Still doesn't work.

nocturne elbow
#

public class GlobalOnlineCommand extends Command {
Again, idk if im being stupid or not because bungee.. but isnt it implements CommandExecutor

#

nope, extends

#

huh

#

it's abstract class, not interface

#

it has its own implementations

rich flare
#

See. I've never used class inheritance because I'm a C# person and I've never needed to use it. Java has it used a lot more...

nocturne elbow
#

do any of the other commands register?

rich flare
#

Yes.

#

All of them, but this one.

nocturne elbow
#

but that one

rich flare
#

Yeah.

nocturne elbow
#

console clean of errors

rich flare
#

Yep.

nocturne elbow
#

comment out everything LP related from that class alone and see if it registers

#

๐Ÿคทโ€โ™‚๏ธ

#

fun

rich flare
#

oh wait... I'm blind...

#

one sec

#

[00:00:40 WARN]: Exception encountered when loading plugin: StreamLine java.lang.NoClassDefFoundError: net/luckperms/api/LuckPermsProvider at main.net.plasmere.commands.staff.GlobalOnlineCommand.<init>(GlobalOnlineCommand.java:21) ~[?:?] at main.net.plasmere.StreamLine.onEnable(StreamLine.java:48) ~[?:?] at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:300) ~[travertine.jar:git:Travertine-Bootstrap:1.16-R0.4-SNAPSHOT:11b0fea:157] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:297) ~[travertine.jar:git:Travertine-Bootstrap:1.16-R0.4-SNAPSHOT:11b0fea:157] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62) ~[travertine.jar:git:Travertine-Bootstrap:1.16-R0.4-SNAPSHOT:11b0fea:157] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) ~[travertine.jar:git:Travertine-Bootstrap:1.16-R0.4-SNAPSHOT:11b0fea:157]

nocturne elbow
#

I said everything lp related

#

wait

#

did you

#

did you uninstall LP from bungee...?

rich flare
#

nope

nocturne elbow
rich flare
#

It won't compile if I do that, though.

nocturne elbow
#

comment out everything LP related from that class alone and see if it registers

#

comment out everything LP related

#

COMMENT OUT everything

#

EVERYTHING

rich flare
#

no errors

nocturne elbow
#

cool

#

does it register

rich flare
#

Yes.

nocturne elbow
#

What version of LP do you have in proxy?

rich flare
#

Oh wait.

#

shoot

#

LuckPerms-Bungee-4.3.99

nocturne elbow
#

V4

#

Broooooo

#

Update to v5

rich flare
#

aight.

#

okay

nocturne elbow
#

You're most probably using 5.1 api, right?

rich flare
#

yeah

nocturne elbow
#

smh

#

And yes, uncomment everything

rich flare
#

btw. Y'all should fork LP to Fabric.

nocturne elbow
#

Not up to me

sudden pelican
#

I think someone was making a pr for it but it hasn't been merged

nocturne elbow
#

There's one person working on that

rich flare
#

Is it i509?

nocturne elbow
#

In #issues there's been a recent comment on that pr

rich flare
#

I know he's doing something for that.

nocturne elbow
#

Well I mean, s/he did pretty much everything for it

#

Fuck no

#

I hate embeds

rich flare
#

hey. It registers now guys. fancy that. it's almost like I could've spared myself coming here and your guys' time being wasted.

nocturne elbow
#

it's okay ;d

rich flare
#

:D

#

okay. That's all I needed. Time to clean up my code and get it working correctly.

#

Thanks!

nocturne elbow
#

np

#

That was quite satiating for me personally.

#

lol

rich flare
#

"satiating"?

nocturne elbow
#

Look idk I looked up complicated sentences

#

I think it means satisfying

#

Lmfao

#

It does

#

I am adept because I had a great pedagogia.

#

No you didn't

rich flare
#

nice

#

me too

nocturne elbow
#

I utilized a q-tip to emaculate my auditory perceivers.

#

LOLL

#

Sorry I will move from dev api

jaunty valley
#

Hello there. Can someone help? I'm trying programmatically add permission to group but API doesn't provides me any group but default. For an example:

LuckPerms perms = LuckPermsProvider.get();
GroupManager manager = perms.getGroupManager();
scheduler.runAsync(plugin, () -> {
  manager.loadAllGroups().get();
  manager.getLoadedGroups().forEach(it -> System.out.println(it));
});
//Returns only defualt group but I have about 10 groups besides default

Any ideas??

#

And besides that I can't execute any command of my plugin if it require permission even if i have admin group with * permission

obtuse jolt
#

you prob didnt register your commands properly then

jaunty valley
#

I use a popular Aikar's ACF api for making commands. I can show some code how I registered it (i followed the guide i mean). Commands working properly but if they only doesn't require permissions to be executed

nocturne elbow
#

So maybe you're not checking permissions properly?

#

Can you send code for the commands that aren't working?

crystal sonnet
#

@jaunty valley run the forEach on the get()

#

And what does /lp listgroups show on the server?

jaunty valley
#

get() returns Void type

crystal sonnet
#

Odd

#

What about the second?

jaunty valley
#

Very odd

obtuse jolt
#

tab completion != have permission

jaunty valley
#

tab completion != have permission
I know. I said it to demonstrate that my command is registered

#

My command requires "discordauth.admin" permission

nocturne elbow
#

How are you checking for the permission?

#

Send code

jaunty valley
#

I use Aikar's ACF api for commands

#
@CommandAlias("discordauth|dauth")
@CommandPermission("discordauth.admin")
public static class PluginCommands extends BaseCommand{...}
nocturne elbow
#

And whats the rest of it

jaunty valley
#
@CommandAlias("discordauth|dauth")
@CommandPermission("discordauth.admin")
public static class PluginCommands extends BaseCommand{

@Inject
private DataSource db;

@HelpCommand
public void onHelp(CommandSender sender, @NotNull CommandHelp help){
    help.showHelp();
}

@Subcommand("get player")
@CommandCompletion("@players")
public void onGetPlayer(CommandSender sender, @NotNull ProxiedPlayer player){
    String name = player.getName();
    AuthPlayer authPlayer = db.getPlayer(name);
    if(authPlayer == null){
        sender.sendMessage(new TextComponent("Player \""        + name + "\" is not in database."));
      return;
    }
    sender.sendMessage(new     
    TextComponent(authPlayer.toString()));
}
}
#

basically i need get player subcommand

#

it isnt working too

#

I hope that it is some kind of acf's problem idk

nocturne elbow
#

Why dont you just make commands normally

#

lol

jaunty valley
#

This api is very comfy

nocturne elbow
#

Fair enough

#

I'd say refer to their docs

jaunty valley
#

Their docs are pretty cheap and their helper said that it used to be some problem with luck perms

nocturne elbow
#

Have you tried giving the permission node?

jaunty valley
#

But its just a common command of mine lol

nocturne elbow
#

Sometimes * can cause issues

obtuse jolt
#

maybe try verbose

jaunty valley
#

info of admin group permissions
.

obtuse jolt
#

/lp verbose on

jaunty valley
obtuse jolt
#

the run your /dauth command

jaunty valley
#

i have tried

obtuse jolt
#

and the result?

jaunty valley
#

welp idk its just spamming

obtuse jolt
#

!verbose

frank driftBOT
jaunty valley
obtuse jolt
#

try /lp verbose command <name> dauth

jaunty valley
#

name of my player?

obtuse jolt
#

of the person running the command yes

jaunty valley
nocturne elbow
#

Whats the translation

jaunty valley
#

Its the side problem

#

"the unknown command"

#

I should investigate what returns "the unknown command" message. Need to ask my sys admin

#

Its some side think like some other plugin i think or BungeeCord

nocturne elbow
#

isnt /dauth the plugin you are coding?

jaunty valley
#

Yes

#

It is a command of mine plugin

nocturne elbow
#

Do you know how to code a command without aikar's api?

#

If so, do some testing using the normal methods you'd use to code the same command

#

If you don't know how to code a command without aikar's api I suggest you learn

jaunty valley
#

Do you know how to code a command without aikar's api?
Yes

#

If so, do some testing using the normal methods you'd use to code the same command
Yeah, I thought about it

turbid solar
#

@jaunty valley is it a bungee plugin?

jaunty valley
#

Yeap @turbid solar

turbid solar
#

/lpb verbose command <you> dauth

jaunty valley
#

i have it installed

turbid solar
#

Most likely not on a database

jaunty valley
#

Most likely not on a database
what do you mean by that?

#

its on h2 database

turbid solar
#

!storage

frank driftBOT
jaunty valley
#

should it be on mysql?

turbid solar
#

Yeah permissions won't sync to bungee with h2

#

!sync

frank driftBOT
turbid solar
#

!network

frank driftBOT
jaunty valley
#

oh thx

nocturne elbow
#

idk what happend with lpb but in all commands it returns only plugin's status
@jaunty valley You most likely dont have permission to use lpb.

turbid solar
#

That also ^

nocturne elbow
#

No, thats what it is

#

lol

jaunty valley
#

Ok

#

thx

crystal sonnet
#

How foolish was I to assume LP was set up properly

obtuse jolt
#

haha oh welll

undone forum
#

Hello everyone !
Sorry, I don't really understand the LuckPerms API ...

Actually, I'm trying to get the weight of the primary of an offline player...
How can I do this ?

obtuse jolt
#

what have you try? what are the specific issue you face with the api, else we can only link you to the api wiki and javadocs

#

!api

frank driftBOT
undone forum
#

@obtuse jolt Thank you for your answer.
Here my problem: I'm trying to dev a plugin with a ban/mute GUI. (because there are some staff who doesn't know how to use a sanction table and I'm sick of repeating myself)

To do that, I have built my GUI etc, everything works but i use:
Bukkit.dispatchCommand(console, sb.toString());
to execute a command.

But here is my problem: The command is executed by the console, so anyone can mute / ban anyone.
What I'm trying to do is get the weight of a player's primary group to know if it's bigger or smaller than the one they're trying to mute / ban ...

Here is the command:
"/ punishmentgui <nickname>"

I could have done this just with Bukkit's permission system, except the "nickname" player can be logged out!
And a disconnected player doesn't have permission, so can't check that!

frank driftBOT
#

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

undone forum
#

Euh, sorry ... ๐Ÿคทโ€โ™‚๏ธ

nocturne elbow
#

(because there are some staff who doesn't know how to use a sanction table and I'm sick of repeating myself)
100%

short fossil
#

@undone forum You can get permissions with loadUser method provided by LuckPerms

nocturne elbow
#

Couldn't you also just check if the player hasPermission bangui.bypass or something? and if they do, send a message to the person using the GUI that they can't ban this player.

nocturne elbow
#

Docker

ebon ether
#

owo

undone forum
#

I'll try, ty @short fossil

short fossil
#

Tim the problem with that is Bukkit#hasPermission does not support offline players

nocturne elbow
#

True true

crystal sonnet
#

@undone forum with the user object you can easily get the primary group of a player

#

If you want to go that route

undone forum
#

Even if the player if offline ? @crystal sonnet

frank driftBOT
#

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

crystal sonnet
#

Of course. Thatโ€™s why youโ€™re loading it

undone forum
#

Mh...
I will try when I finish class, thank you

uncut ice
#

The NodeAddEvent only gots triggered, if the change was on the Same Server

#

Is there a way to trigger it on every Server?

obtuse jolt
#

did you sync LP of your servers to a common sql database

uncut ice
#

Yes

#

If i add a Node over the Bungee, the Event dont get triggered on the lobby

#

But the Node is added on the lobby

obtuse jolt
#

i think thats just how that event works, bcu luckperms on each server is independent of each other

#

maybe try NodeMutateEvent? it depends on your usage tbh

nocturne elbow
#

NodeMutateEvent doesn't get called directly, its extending classes do (such as NodeAddEvent or NodeRemoveEvent)

obtuse jolt
#

ah

#

prob have your plugin on all servers then

uncut ice
#

Yes, the LP is on my Proxy, Lobby and GameServer

#

Synced with SQL

crystal sonnet
#

Do you have the messaging services enabled?

#

Or set to sql to be more precise

nocturne elbow
undone forum
#

Hello everyone !
BrainStone tried to help me, but here is my problem:
If you don't remember my initial problem, here is: https://discordapp.com/channels/241667244927483904/420538367986499585/750720007251427458

So I tried his solution, and I ran into a new problem, here it is:

        at fr.ayuniz.staffutils.commands.TestCommand.onCommand(TestCommand.java:24) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
        ... 15 more```

When I try to use the command with a disconnected player, here is the error I get:
(The player exists and has already connected since using the plugin, but has not connected since the last reload ...)

I showed you my current code in picture at the bottom of the message (it seems to me more visible thanks to the colors)

Is there a possibility of retrieving the information via the databases?
#

Thank you to the one who accepts to help an apprentice developer in search of knowledge! ๐Ÿ™‚

crystal sonnet
#

You were told to use loadUser, not getUser

undone forum
#

Oh, wait

junior jay
#

So I made a plugin for spigot and Luckperms
I was wondering if someone was using LuckPerms on their Bungee server and my plugin on one of their spigot servers. Would my plugin be able to hook into LuckPerms?

crystal sonnet
#

Of course not

#

LuckPerms needs to be installed on the backend servers anyways if you want it to have any effect on them

junior jay
#

hm ok thanks

crystal sonnet
#

Youโ€™re welcome

undone forum
#

I tried your way @crystal sonnet, but It returns the default group everytime, if player hasn't logged in ...

frank driftBOT
#

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

undone forum
#

This message stresses me out, I don't know if I'm making a mistake ๐Ÿ˜ฆ

nocturne elbow
#

You might want to take a look at this, loading offline user data can take a large amount of time (specially if you're connected to a remote database), you don't want to block the main server thread to load a user, do you? :q

https://luckperms.net/wiki/Developer-API#using-completablefutures

#

As for your main problem, I don't know, make sure the returned OfflinePlayer has joined before (OfflinePlayer#hasJoined I think it is).

wild whale
#

@SuppressWarnings("deprecation") ๐Ÿ‘€

nocturne elbow
#

Even if, they can still have no LP data which will return default as parent group

#

@SuppressWarnings("deprecation") ๐Ÿ‘€
Most probably the getOfflinePlayer(String) lol

wild whale
#

Oh yeah it's for sure that, notice it's crossed out

nocturne elbow
#

Oh, you'll also want to Bukkit#getOfflinePlayer(String) asynchronously as well, querying offline player data may be thread blocking too if they haven't joined before

#

Those are just tips so you don't lag the server every time you run a command.

This is what concerns you lol

As for your main problem, I don't know, make sure the returned OfflinePlayer has joined before (OfflinePlayer#hasJoined I think it is).
Even if, they can still have no LP data which will return default as parent group

#

@undone forum

wild whale
#

also btw could you nick yourself something that is actually mentionable and not invisible?

crystal sonnet
#

Are the groups assigned per server? @undone forum

undone forum
#

So much informations ... ><
@crystal sonnet There is only one server, I'm trying my plugin on a local server

frank driftBOT
#

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

marsh matrix
#

no errors at all in console

rustic laurel
#

Hey หžหžหž! Please don't tag helpful/staff members directly.
@frank drift should not need to ask again @undone forum

crystal sonnet
#

@marsh matrix how do you know itโ€™s not being applied?

marsh matrix
#

checked w the cmd in game, mb, should've specified

#

I metaed info

crystal sonnet
#

Did you check the output of /lp user <user> meta info?

#

Ok

marsh matrix
#

yup

crystal sonnet
#

Are you removing the old node?

marsh matrix
#

I don't have it

#

ignore the gibberish, it was me testing

crystal sonnet
#

Can you check the wiki it .getNodes().add(x) is the right call?

#

Iโ€™m on mobile

marsh matrix
#

Wiki doesn't mention how to set specifically meta nodes, just how to create them and get the value

#

oh

#

nope nvm, yea it doesn't

crystal sonnet
#

I mean adding a permission node

#

The call is documented

nocturne elbow
#

It's all nodes, peeps

#

All nodes

rustic laurel
#

Always has been

marsh matrix
#

I did getNodes() instead of data()

crystal sonnet
#

There we go

#

Iโ€™m surprised that didnโ€™t throw any errors

marsh matrix
#

thanks, and apologies!

crystal sonnet
#

Youโ€™re welcome

remote sky
#

How would I go about running a command with the clickEvent without checking perms?

#

just op and deop?

#

or give and remove perm?

#

or is there an easier way?

nocturne elbow
#

Make it run from console?

sudden pelican
#

run it as console?

remote sky
#

so for /rules for example

#

can you just run that from console?

#

not really cause it has to send a msg to the player

sudden pelican
#

maybe you can do /rules player, i doubt it but worth a shot

remote sky
#

yea no that wont work ;p

nocturne elbow
#

Why wouldn't a player have perms for reading the rules lmao

remote sky
#

its an example

#

and im going with an interactable setup

#

so just clicking and not typing

#

this is how Citizens does it (if i read the code correctly)

PermissionAttachment attachment = player.addAttachment(CitizensAPI.getPlugin());
if (temporaryPermissions.size() > 0) {
  for (String permission : temporaryPermissions) {
    attachment.setPermission(permission, true);
  }
}
command.run(npc, player);
attachment.remove();
#

prolly not idk

#

i have no clue

crystal sonnet
#

@remote sky how plugins usually do it is by having a helper command. Like /action <actionID>

#

You put a unique ID for every action

#

And verify that the user is allowed to run that action and what action it is

nocturne elbow
#

hey say i have in my groups
Owner
Co owner
MVP
Head Admin
How do i move MVP bellow Head Admin

junior jay
#

give it a lesser weight than Head admin

nocturne elbow
#

ok

#

thx

#

how do u change?

#

@junior jay

#

wait

#

didnt work

crystal sonnet
nocturne elbow
#

ok

crimson vector
#

Hi there, I have a question,
Is it possible to save all players that has * permission node in a stringList/hashSet ?

wild whale
#

what?

rustic laurel
#

Yes it is possible

crimson vector
#

I want to remove specific permissions like * from all players that have it with a command

rustic laurel
#

Just loop or iterate through everyone (and load them) and check if they have the permission, then remove it if so

crimson vector
#

Could you please tell me whats the best way to loop between all online and offline players?

#

I couldn't check any method for this

#

For online players is easy but how for offline ones

#

I'll search more, thanks anyway.

rustic laurel
#

I don't really recall how, tbh

wild whale
#

@crimson vector ^

#

fefo to the rescue it appears

nocturne elbow
#

๐Ÿคทโ€โ™‚๏ธ

rustic laurel
#

Hey that's pretty cool

nocturne elbow
#

That's probably what lp search uses too, since it also reports for offline players

wild whale
#

yeah that would make sense

#

although it's @since 5.1 so maybe not?

#

or maybe the functionality has been there for a while and it just got added to the api recently

nocturne elbow
#

Wow

#

11

#

Look the method described right below

#

I mean that's what was used before most probably, how did you miss that one xD

wild whale
#

ye

crystal sonnet
#

@crimson vector @nocturne elbow @wild whale @rustic laurel the UserManager has a method to load a players that have a specific permission and return them in a list

#

Much smarter than actually loading every player

wild whale
#

did fefo not link just that?

nocturne elbow
#

Wasn't that what I linked?

crystal sonnet
#

Damn it. Yes

#

The signature looked unfamilar

wild whale
#

lol is ok we're all human

nocturne elbow
#

eeh... you sure?

wild whale
#

(except @frank drift and @severe bone )

crystal sonnet
#

I was thinking about the now deprecated getWithPermission

nocturne elbow
#

and @sudden umbra

wild whale
#

owo TIL that's a thing

nocturne elbow
#

I learned it is thanks to @nocturne elbowothy

crystal sonnet
#

That's the old 5.0 method

wild rune
#

What would be the smartest way of programatically add / remove a group from a player?

nocturne elbow
junior jay
#

How would I get the instance of LuckPerms in a Bungeecord plugin?
Would I have to use the Singleton (static access) way?

LuckPerms api = LuckPermsProvider.get();
crystal sonnet
#

Yes

#

As explained on the API page

#

!api

frank driftBOT
uncut ice
#

How can i get all Players from a specific group. Threadsafe

crystal sonnet
#

What do you mean with threadsafe in that context? @uncut ice

uncut ice
#

That the Method dont let lag the server

#

How can i get all Players from a specific group

#

?

#

@crystal sonnet

frank driftBOT
#

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

obtuse jolt
#

is this what you are look for? ^

#

wait no

#

you want to opposite lol

crystal sonnet
#

Well for it to not lag, you need to run it async. No way around it

uncut ice
#

Yes

crystal sonnet
#

You cannot make data loading threadsafe in any ways other than running it async

uncut ice
#

I need all Players from a group. Not the groups from a player

crystal sonnet
#

Now the UserManager class has a method to get all players with certain nodes

#

Use that

uncut ice
#

Which method? I cant find any method for that

crystal sonnet
#

I think it's called searchUsers

#

Or similar

#

Check the javadocs

nocturne elbow
#

Hey
It's normal that luckperms projects (plugin and api) aren't at last version at the maven repository ?

#

Wdym? The API is one, v5.1, then the plugin itself implements the API and it changes every now and then but the API doesn't

#

i see

#

!api I think it explains in here how the versioning works

frank driftBOT
nocturne elbow
#

thx

#

but i use maven repo and they are not 5.1 version of plugin

#

Read the link above

#

It's in maven central, I don't know what that is lol

#

it's what use maven/gradle to download dependencies

#

oh it's not me.lucks now

#

... .-.

#

You didn't read the wiki

#

๐Ÿคฆโ€โ™‚๏ธ

#

sorry and thx x)

wild rune
#

I want to do so that when a player enters / exits a WorldGuard region, a parent is added / removed from the player

Would this cause lag?

nocturne elbow
#

The parent addition/removal wouldn't, you'd just need to modifyUser

wild rune
#

Okay good - and just to be sure, using the API to do so wouldn't log in the in-game chat, would it?

nocturne elbow
#

I don't think so?

#

Not sure

#

Try and see

wild rune
#

Fingers crossed then

nocturne elbow
#

As for the wg part

#

idk lol listen to PlayerMoveEvent and make a query? idk

wild rune
#

Yeah that's what I'm currently doing, I wasn't sure if bulk parent addition/removal would cause lag though

#

I'm having some trouble working out the LP API, I might come back later for help ๐Ÿ˜…

nocturne elbow
#

If you do it through modifyUser it won't, it runs async

wild rune
#

Okay, thank you!!

#

I'll try

#

Wait, is modifyUser a method?

nocturne elbow
#

UserManager#modifyUser(UUID, Consumer<User>) I think

sudden pelican
wild rune
#

Ahh, I was using 4.0 dependency

#

and awesome, thanks jordan!

#

Okay I have more questions hahah -- I'm reading the wiki, and it looks like a lot of code simply to add a parent to a user? or am I missing something?

nocturne elbow
#

What part exactly?

wild rune
#

as far as I've understood so far, I'm to get the user data, and add a node - this is the roadblock I'm stuck at now

neat jackal
#

If you want to do it the traditional way just save the user after adding the node (UserManager#saveUser)