#luckperms-api

1 messages · Page 22 of 1

hollow zodiac
#

Oh I see you changed how the API works

polar cargo
#

Hello !
I search what replace user.inheritsGroup(groupname) can you help me ? (for the new api)

lilac mountain
#

How does this ContextSet Thing work?

crystal sonnet
#

In what context?

#

Like what do you need if for?

lilac mountain
#

I just purely want to get the users group from the database

#

the prefix is mostly want Im aiming for to display on the side

#

the context i need would probably be "server" "lobby"

crystal sonnet
#

So you just want the players prefix?

lilac mountain
#

yes

#

specifically their group prefix

crystal sonnet
#

Search this channel

#

I think there have been many examples of that

#

Why bother with their group prefix?

lilac mountain
#

I just mainly in the end to put their rank on the sidebar

crystal sonnet
#

If you get the players prefix you get their group prefix if they don’t have one applied to themselves with a higher priority.

lilac mountain
#

Ok

errant inlet
#

good morning 🙂

#

how long does u need to create a lp configuration on a 1.14.4 Citybuild, Arena, .... system ? 😄 (30 plugins) ^^ i need help

crystal sonnet
#

@errant inlet #support-1. Read the channel description before asking

#

And also we are not here to set things up for you

dapper jetty
#

Hi, I'm new at using plugins' API. Does it need to be the exact same version as a plugin? Or can I just use the newest one?

#

Or does p.getDisplayName() include a prefix? I just want to send a message with player's name and the prefix.

nocturne elbow
#

is it possible to list all players in a specific grou? even if they are offline?

haughty solar
golden forge
#

permission is easy

haughty solar
#

then say

golden forge
#

use the web editor

haughty solar
#

uffff

golden forge
#

do u wanna talk

haughty solar
#

haha no

golden forge
#

ok

haughty solar
#

i am coding

#

I asked how to set in my code

golden forge
#

u wanna create ur own plugin?

haughty solar
#

yes..

golden forge
#

ah ok

#

sorry

haughty solar
#

haha no problem

sleek axle
#

Can anyone help me??? I have an bungee system , which works with an specific permissions system! But this System is shit and i want to swap the old system with luckperms. I cant programm java so somone have to help me. PLS is there somone? Its not hard...Just 2 Commands

#

@haughty solar it seems you can programm java..Can you help me???

#

@golden forge Can you help me?

haughty solar
#

Ask

nocturne elbow
#

is it possible to list all players in a specific grou? even if they are offline?

sleek axle
#

@haughty solar what do you mean

haughty solar
#

What do you need?

golden forge
#

@sleek axle tell me

crystal sonnet
#

pass group.<group> as the permission node

nocturne elbow
#

can you make an example @crystal sonnet

frank driftBOT
#

Hey HOPE! Please don't tag staff members.

crystal sonnet
#

I mean the method getWithPermission

#

@nocturne elbow

chrome kelp
#

Help please

crystal sonnet
#

Sorry it didn't link the method properly

nocturne elbow
#

so can i load every player in a group with the method even if they are offline?

chrome kelp
#

@crystal sonnet

frank driftBOT
#

Hey _NotSeba! Please don't tag staff members.

crystal sonnet
#

@nocturne elbow you can get their UUIDs at least

chrome kelp
#

sorry for tag

crystal sonnet
#

You will need to load the separetely

#

@chrome kelp You might want to check if you're in the right channel

nocturne elbow
#
CompletionStage<List<HeldNode<UUID>>> manager = LuckPermsProvider.get().getUserManager().getWithPermission("*");

gives me not an uuid

crystal sonnet
#

Do you have anyone with a * permission?

nocturne elbow
#

yea

#

it gives me this output:

java.util.concurrent.CompletableFuture@73f3455[Not completed]
crystal sonnet
#

Not completed

nocturne elbow
#

means?

crystal sonnet
#

You have to wait for the Future to complete

nocturne elbow
#

oh okay

#

so this feature isnt ready yet?

crystal sonnet
#

Yes

nocturne elbow
#

okay

crystal sonnet
#

There's plenty of methods to wait for it be ready

#

That's pure Java stuff

nocturne elbow
#

yea

slow lake
#

is there a way to get a user's group expiry

gentle ocean
#

Hi, how can I check when a player's rank changes? With api

wary locust
#

I need help with some lp stuff

#

How do i change players name colours

crystal sonnet
#

@gentle ocean there are events

#

@wary locust with the plugin API?

#

@slow lake get the group node and check the expiry

gentle ocean
#

@crystal sonnet Wath is that ?

frank driftBOT
#

Hey Zelix! Please don't tag staff members.

crystal sonnet
#

Events

#

That fire when stuff happens

#

Same principle as with plugin events

gentle ocean
#

No

#

The name of event x)

sleek axle
#

@golden forge ok...so i want to implement luckperms on my bungee system.....but i cant programm java.....would you do it for me?

crystal sonnet
#

@sleek axle erm you do know LP supports bungee

#

Right?

fallen bronze
#

Hey, new to using all this stuff - was just wondering how to get a pre-existing plugin to pull prefixes/ranks from LuckPerms instead of the current .yml file?

crystal sonnet
#

!api

frank driftBOT
burnt hearth
#

how do i use it with spigot/bukkit? need to change perms with essentialsX

gleaming lance
#

Is there an event for tracking users prefix change? (Edit: nvm, figured it out)

dusky wagon
#

net.luckperms.api.model.group.Group, wie kann ich da die member getten?

crystal sonnet
dusky wagon
#

and wich permission have the groups?

crystal sonnet
#

group.<group>?

dusky wagon
#

oh okay

dusky wagon
#
  CompletableFuture<List<HeldNode<UUID>>> test = BuildSystem.api.getUserManager().getWithPermission("group.builder");

it will return null

crystal sonnet
#

What returns null? @dusky wagon

glad leaf
#

Hi

#

Can you help me?

#

Plis

#

Admin

crystal sonnet
#

@glad leaf I can't help you if you don't tell us what you need

glad leaf
#

Ok

#

Speak Spanish ?. I find it easier. If you do not speak there is no problem

crystal sonnet
#

No I don't

glad leaf
#

I have a LuckPerms placeholder problem. I get an error and I cannot restart the PlaceHolderAPI configuration

#

Is this

#

On that page is the problem

crystal sonnet
glad leaf
#

Ok

dusky wagon
#

@crystal sonnet the code there are over the message

frank driftBOT
#

Hey Meerpaluten! Please don't tag staff members.

dusky wagon
#

Nö he has tag me too

crystal sonnet
#

@dusky wagon I'm asking what part of that returns null?
How do you know it returns null?

dusky wagon
#

Because there is a null exception in the console

crystal sonnet
#

That means that a call before the getWithPermission returns null

#

So my guess would be that either BuildSystem.api or BuildSystem.api.getUserManager() is null

#

Most likely you are accessing the API too early

dusky wagon
#

Why to early?

#

I get it after i join.

#

And the api will register on start

crystal sonnet
#

Then you access the API too early

#

You can onyl get the API after LP has initialized

dusky wagon
#

Yes

#

I have add luckprems to the depdend

#

I looking tomorrow

crystal sonnet
#

Make sure you do not try to initialize your LP API instance before your onEnable

gentle ocean
#

I have check api and don't find Event on player rank update

crystal sonnet
#

There should be one for any updates to permissions

#

Use that and see if the group changed

gentle ocean
#

Okay, is it used the same way as spigot events?

crystal sonnet
#

No

#

!api

frank driftBOT
dusky wagon
#
public boolean hasPermission(User user, String permission) {
    ContextManager contextManager = api.getContextManager();
    ImmutableContextSet contextSet = contextManager.getContext(user).orElseGet(contextManager::getStaticContext);

    PermissionData permissionData = user.getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
    return permissionData.getPermissionValue(permission).asBoolean();
}

Why it this not work, it is so on wiki

nocturne elbow
#

When i create a Group and give them somoene they cant write in the Chat. I use it on Nukkit

#

Can any help meee

crystal sonnet
#

@dusky wagon what's happening with this code?

#

Does it not compile?

#

Give the wrong answer?

#

etc

dusky wagon
#

i fix it.

#

in the wiki is the error

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

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

this is the code that it right

crystal sonnet
#

@nocturne elbow this is the channel for plugin developers asking for help with integrating the LP API

velvet hedge
#

Good evening, I would like to use the spigot API of LuckPerms but I have this error:

java.lang.NoClassDefFoundError: net/luckperms/api/LuckPerms

I have version 4.4.1 and I added to the classpath of the project the jar api-5.0.jar but the package net.luckperms.api

crystal sonnet
#

The API changed completely between v4 and v5

velvet hedge
#

Only API or the main plugin too ?

#

It work, thank you

crystal sonnet
#

I mean you're already using the v5 API

swift portal
#

What is the easiest way to get a user group (a string) ?

crystal sonnet
#

Get the primary group of the player

swift portal
#

that's not what I'm looking for

#

because it is often default even if the player has a rank on a specific part of the server

crystal sonnet
#

Then give the groups weights

swift portal
#

I do already

#

But it is getting default whatever I do

feral flare
#

how do i change the i set autolistranks false on rankgrantplus how do i do prefixs???

fallen bronze
#

Currently my custom chat plugin uses a custom rank+prefix setup, which pulls ranks from .yml file everytime a player speaks. I'm struggling to figure out a way to have it instead pull the chat prefix from luckperms instead of the current one right now. Any tips on what documentation I should be looking at or what I should be focussing on?

crimson zinc
#

Set a String when the player is joining

crystal sonnet
#

Set a string where?

rugged river
#

Is it possible to copy all userdata from one server to another server?

crystal sonnet
#

Copy the storage files over while both are off or use the export/import functionality

rugged river
#

Is there a wiki for how to use export/import?

#

I just want to transfer the "users" not the "groups"

#

Since I got different perms for the servers.

crystal sonnet
#

That sounds like a different story then

#

In this case I’d recommend you use a network setup with contexts

rugged river
#

How do I do that?

#

Can I then setup different perms for different servers? But if a player gets a rank at one of the servers. He gets the rank at all servers?

languid socket
sly hearth
#

what happened to user.unsetPermission()

#

how do u unset a node in 5.0 api

#

is this correct user.getNodes().remove(node);

cyan beacon
#

so is there a way to mass give all permissions to a group at once like, for admin I want complete OP

sly hearth
#

or i should use CachedPermissionData instead

#
public static void unsetPermission(User user, String permission) {
        ContextManager contextManager = api.getContextManager();
        ImmutableContextSet contextSet = contextManager.getContext(user).orElseGet(contextManager::getStaticContext);

        CachedPermissionData permissionData = user.getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
        permissionData.getPermissionMap().remove(permission);
        api.getUserManager().saveUser(user);
    }
wicked coral
#

Hi, how can i add transient permissions to a player?
permissions which wont be persisten anywhere in luckperms database and are cleared when the player disconnects, or server stops?
Im on spigot platform.

jaunty pecan
#

@sly hearth user.data().remove(...)

#

the collections are all immutable

#

@wicked coral use this method

#

it's part of the Bukkit API, no need to depend on LP

wicked coral
#

@jaunty pecan Do i need to remove the attachment later manually? is is the context cleared when player disconnects?

frank driftBOT
#

Hey NeumimTo! Please don't tag staff members.

sly hearth
#

Oh thanks and i assume for adding is user.data().add()

jaunty pecan
#

it's cleared when the player disconnects

wicked coral
#

nice, thank you

upper jetty
#

anyone knows anything about installing luckperms global and making it work global on a bungee?

crystal sonnet
#

@upper jetty check the channel description

dusky wagon
#

wich event is trigger if a player have a permissionchange?

timid axle
#

What is the permission for able to use /perm /lp commands ?

#

For manager like we are not giving manager op so how can they able to use /perm and /lp command which perms we need to add

crystal sonnet
#

@timid axle check the channel description

timid axle
#

I just need help

crystal sonnet
#

Then ask in the right channel

timid axle
#

which channel can i ask

crystal sonnet
#

The channel descriptions should tell you

timid axle
#

can't you help me i am kind of new this things

crystal sonnet
#

I can

#

But a minimal effort is expected from your side

timid axle
#

I know but please

nocturne elbow
#

drip

#

drip

#

drip

#

drip

dusky wagon
#

wich event is trigger if a player have a permissionchange?

ornate talon
#

^also interested

#

and which event triggered by /lp applyedits?

lime python
#

How on earth do i make a query to get permissions from a group? Why can't it just be group#getPermissions :/ this new API is so confusing

crystal sonnet
jaunty pecan
#

to actually answer the question

#

you probably want the #getNodes method

blissful beacon
#

Hi friends 🙂 Can anyone point me in the right direction on how to promote a user down a track if they enter a certain command? ie. when they join a server, they have to say something in particular to be put in a group that allows them to start playing?

upper jetty
#

Any rankup plugin compatible wich luckperms?

crystal sonnet
#

@flat quiver there’s a method for that on the user object

upper jetty
#

Oops sorry

uneven saddle
#

Anyone have advice as to which API placeholders to use in order to get the correct prefix to show? I have a normal path and a staff path and I want staff to show, then normal, but to not show staff path if they do not have that group
I may not make any sense.... send help... lol

neat jackal
#

You probably need prefix stacking.

So if I understand you right you want that it shows "[Staff] [Member]" for staff. And just "[Member]" if they aren't staff.

#

!stacking

frank driftBOT
uneven saddle
#

Correct, how would I couple this with my chat program? Would there be a specific API to use for it?

flat matrix
#

it should insert using your plugins {PREFIX} placeholder that would pull from vault.

#

(i thought you wanted actual API info) sorry, but yea, just using LPs stacking would put the right info in if you pull from vault for prefix

raven pelican
#

how can i give a permission to a user using the API?

raven pelican
#

Hello, i am trying to see if a user has a permission so i looked at the dev api usage and found this (i had to slithly change it, as PermissionData does not exist) but its not working```Java
public boolean hasPermission(User user, String permission) {
ContextManager contextManager = instance.getLuckPerms().getContextManager();
ImmutableContextSet contextSet = contextManager.getContext(user).orElseGet(contextManager::getStaticContext);

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

@raven pelican what’s stopping you from using the normal permission check?

ornate talon
#

which event is triggered if a player have a permissionchange,and which event after /lp applyedits?

warped finch
#

guys i want to know how i can create an owner rank and a staff rank plz help

raven pelican
#

@crystal sonnet when i tried it, it didn't work

frank driftBOT
#

Hey Johni! Please don't tag staff members.

crystal sonnet
#

@raven pelican what have you tried exactly?

#

And what was the outcome?

raven pelican
#

if(player.hasPermission("CAH.Game.Answer"){

crystal sonnet
#

@warped finch if you ask in the right channel we can help you

raven pelican
#

outcome is that i got the message that my plugin removed the permission even though the user didnt have the permission

#

so it should give an error saying hey, that player doesnt't have that perm

#

but it always game me the success message

crystal sonnet
#

@raven pelican I'd recommend using lowercase permissions

warped finch
#

@crystal sonnet where is the right channel

frank driftBOT
#

Hey Abdollah Senpai! Please don't tag staff members.

warped finch
#

Ok

raven pelican
#

but using non-lowercase permissions aren't causing these problems right?

crystal sonnet
#

There's a chance

raven pelican
#

ok ill try that in a sec, cheers, may i tag you if it doesnt work? i know cwippy doesnt really like that but yea

#

btw isn't clippy like from windows xp or something?

crystal sonnet
#

It's ok

#

And clippy is from Word

nocturne elbow
#

Can I use the luckperms api in a bungeecord plugin? (i.e. check the meta to get their prefix/color)

crystal sonnet
#

Yes

nocturne elbow
#

Oh? Could I possibly get some kind of pseudo example? Can't seem to find it on the developer-api page on github

#

Oh wait nevermind

#

Didn't see the singleton access one

crystal sonnet
#

@nocturne elbow

nocturne elbow
#

Thanks for your help and time

ornate talon
#

Is there an event that is triggered when player gets permission change?

ornate talon
#

Yeah looks like it,thanks

rose anchor
#

I am confused as to how to alter a user's groups from nodes. How would I check if a given node is of a group?

dusky wagon
#

how i get the group prefix?

#

group.getCachedData().getMetaData(api.getContextManager().getQueryOptions(group)).getPrefix();; so?

grim cape
#

I need help with creating my own context

errant inlet
#

Skills:

  • message{cooldown=10;m="thx for helping me"}
    @PlayersInRadius{r=7} ~onSpawn

does it works with Playernames too ??
@"Name"InRadius{r=7} ~onSpawn

nocturne elbow
#

Hello.
Is there any information how to use the new API?
I would like to set player rank with it. (One player one rank.)

grim cape
#

You want to create your own ranks? If so, you don't need to use the api

#

I am confused as to how to alter a user's groups from nodes. How would I check if a given node is of a group?
@rose anchor I think you go into group.yml then check which nodes the groups has

grim cape
#

Hello can someone help me

#

I need help making my own context

coral plover
#

I need a help. Please can you solve it?
(problems : version 1.7.10 , permission did working but prefix and suffix didn't working.)

grim cape
#

Do you have a prefix and suffix plugin?

#

Luckperms does not include that

#

Try VaultChatFormatter also by Luck, but that didn't work for me. I had to use a different one.

past acorn
#

how do i limit permission per world?

#

or would i need a bungee cord server to do that?

#

?

grim cape
#

ahh

#

by using context

crystal sonnet
#

@past acorn @coral plover this is not the general support channel. As indicated by both the channel name and the channel description. Use #support-1

past acorn
#

ok

coral plover
#

OK I see.

magic cypress
#

huhu, can someine show me how to use a command and after the user types /accept secr3tw0rd he will get the <normal> userrole?

crystal sonnet
#

I don’t see how this relates to the LP API. Only the group assigning part

#

For that see !api

#

!api

frank driftBOT
fair barn
#

Hey guys, can i post here for getting API Support or is this the wrong channel?

wind chasm
#

Yes @fair barn

#

But don't ask me

#

xD

#

as I don't know how the API works

fair barn
#

perfect, i want to listen on a Luckperms Event who called if i change/add a Parent for an User. But i dont know wich one is the best Event and i dont understand how to subscribe the listeners. this is my class to test this stuff:

        TablistModule.instance().getEventBus().subscribe(NodeMutateEvent.class, this::onGroupChange);
        TablistModule.instance().getEventBus().subscribe(UserDataRecalculateEvent.class, this::onGroupChange2);
        TablistModule.instance().getEventBus().subscribe(UserTrackEvent.class, this::onGroupChange3);
        TablistModule.instance().getEventBus().subscribe(UserFirstLoginEvent.class, this::onGroupChange4);
    }

    private void onGroupChange(NodeMutateEvent event) {
        System.out.println("track");
    }

    private void onGroupChange2(UserDataRecalculateEvent event) {
        System.out.println("track");
    }

    private void onGroupChange3(UserTrackEvent event) {
        System.out.println("track");
    }

    private void onGroupChange4(UserFirstLoginEvent event) {
        System.out.println("track");
    }```
wind chasm
#

more confusing java code that my brain can't handle

#

and can't answer

#

ask JG maybe

crystal sonnet
#

!api @fair barn

frank driftBOT
fair barn
#

!api @fair barn
@crystal sonnet Yes i read this, but it dont work for me ^^ this is the reason why i write in this channel 😄

frank driftBOT
#

Hey AconTM! Please don't tag staff members.

wind chasm
#

@frank drift it's for a good cause xD

crystal sonnet
#

@fair barn

fair barn
#

and again, i read this page but it dont work for me (look at my code on my second message) ^^

crystal sonnet
#

I can't tell where you're getting the event bus from

#

keep in mind it has to be the LP event bus

#

And not the platform event bus

steel edge
#

How can I get the playr prefix with luckperms api 5.0?

normal hedge
#

How do I get the time left of a temp rank?

#

Anyone?

crystal sonnet
#

Get the node and then get the expiry

normal hedge
#

with node, you mean the Node class?

crystal sonnet
#

Yes

normal hedge
#

Alright

#

?

steel edge
#

I need get the group prefix, can U help me? @crystal sonnet

frank driftBOT
#

Hey ֆкуℓєя ɮ๏у! Please don't tag staff members.

steel edge
#

Sorry for the tag :/

normal hedge
#

@steel edge - Use MetaData#getPrefix();

#

This returns a String

steel edge
#

U need harvard certificate for use this api

#

I dont understand this

fair barn
#

I dont understand this
@steel edge first you have to get your group with the GroupManager from LuckPerms (getGroup method).

then you get your cachedData from the group with group.getCachedData();

then you can get the cachedMetaData with cachedData.getMetaData(QueryOptions.nonContextual());

finaly you can get the prefix by using cacheMetaData.getPrefix(); wich will return you a String with the Prefix auf the group you define on the beginning 🙂 I hope you understand my english and i hope helped you with my answer 😄

steel edge
#

but get group with the getGroup method return null @fair barn

fair barn
#

then you have the wrong Groupname ^^

#

it works perfectly for me 10 minutes ago

#
        String prefix = "&7User";
        Group group = luckPermsAPI.getGroupManager().getGroup(groupName);
        if(group == null) {
            return prefix;
        }
        CachedDataManager cachedData = group.getCachedData();
        CachedMetaData cachedMetaData = cachedData.getMetaData(QueryOptions.nonContextual());
        prefix = cachedMetaData.getPrefix();
        return prefix;
    }```  this is my method
steel edge
#

And how do you get the group? The method returns a null value to me.

fair barn
#

String primaryGroup = user.getPrimaryGroup();

steel edge
#

e.a

fair barn
#

e.a
@steel edge what does this means?

steel edge
#

Nothing, a confused face, I'm trying, thanks for the help ^^

fair barn
#

ah, ok 😄 i dont know this "smiley" so i was confused ^^ if this is not worked for you, just wait for another helpfull guy who can help you 😄 i go offline for now ^^ have a nice evening (or what ever is at this moment in your timezone xD)

steel edge
#

Ty ^^

deep niche
#

How can I get the prefix of a user?

crystal sonnet
#

!api

frank driftBOT
deep niche
#

Wasn't it something like this: ```java
String cprefix = api.getUser(p.getUniqueId()).getCachedData().getMetaData(Contexts.global()).getPrefix();

String group = LuckPerms.getApi().getUser(p.getUniqueId()).getPrimaryGroup();
deep niche
#

?

languid socket
#

try it and see

chrome coral
#

how to set permissions in version 5? in version 4 user.setPermission(permNode); worked for me

fair barn
#

Hey guys, wich event you would prefer to check if a players group changed by commands like /lp user <name> parent add/set <group> i try it with the NodeAddEvent wich is called on this command, but it doesnt have informations about the player

pastel brook
#

oh

#

can someone ban @spring estuary please

#

harassing me with alt accounts

#

@spring estuary what is wrong with you?

#

because you need to grow up

#

the hell is wrong with you?

#

what did I do to you?

#

lmfao

#

please stop pinging me and brigading my server/discord with alt accounts

#

oh wait there's no way you're capable of doing that because you have the maturity of a 10 year old

#

you literally pinged me here twice in the past 10 minutes

#

grow up and leave me alone

crystal sonnet
#

@pastel brook no off-topic discussions. Take it to #general if needs be

pastel brook
#

Make him stop pinging me from random channels then?

crystal sonnet
#

Which he is not

pastel brook
#

Okay then lmfao

#

Didn’t get pinged here 5 times by andrewkm this afternoon at all aPES3_RetardTyping

grim cape
#

Hello people

#

I once again request help with creating my own context

neat jackal
#

Take a look at the ExtraContexts plugin from Luck.

grim cape
#

Ok

next moth
#

Anyone here a permission wiz? i am having trouble finding someone with any knowledge to help me learn ! I have setup permissions and the values change true/false no problem. It's the commands that are buggy....they work...but without tabcomplete...I have no other plugins on the test server aside from luckperms i was using to debug. It seems i can have the tabcomplete working if i am OP only.....However on a side note when changingworlds(PlayerChangeWorldEvent) i set permissions true/false also gamemode creative/survival.....when i go to creative permissions are true and i can use w/o tab complete...when i got to survival i can use tabcomplete but have no permissions ! also when first joining the server i do not have access to tab complete...i've been reading code/tuts/spigot forums/bukkit forums/java docs...u name it i think i have probably seen it google is nothing but purple links lol

I feel like theres an easy fix in the handlerList or somewhere along the lines of the WorldChangeEvent....or some code thats run just after we switch perms/worlds therefore it doesn't register tabcomplete until we switch again, as if i op via console and deop in game i can still see commands but not use them....I really need some help here guys! a nudge in the right direction would be awsome I'm stuck and feeling like i have no where else to look. all i really need todo is establish the connection with tabComplete to "refresh" it...i have the logic just no know how of implementation...

prime glacier
#

How to get Weight of a Group with vault

#

Does anybody know?

long moon
#

Vault doesn't support the concept of weights afaik

void flume
#

Hello.

#

Is it just me or is the web-editor not working?

#

I hasn't been working for me for a while

limber lark
#

For me it's working

#

Does anybody know why .getUserManager().saveUser(user); doesn't actually save the user?

void flume
#

For me, it always comes up with the same area

bold plover
#

@next moth if you want to debug perms, try /lp verbose on to log all permission calls.

next moth
#

Perms are not the issue, only tabcompletion is the issue...

crystal sonnet
#

@void flume do you mean error?

#

If so what error?

nocturne elbow
#

How do I add a permission to a user?

#

Updating an old codebase. I was using user.setPermission(Node)

#

Gimme a ping if anyone sees it. I'm heading off to do some other stuff.

next moth
#

I'm having issues, I initially set permissions in my plugin, and have tried luckperms and pex to ensure it wasn't my code. I then debugged and pulled everything apart and tried everything i could, and am now asking for help xD

This is hard to explain? as this is not suppose to happen from what i can understand, i'm going to try and explain it.

When i use a permission plugin, or i set a permission within my plugin I can use the commands as expected but NOT the tab complete. The name of the command is typed in red as if invalid, however it still works.

Now i have permission, but NOT the tabCompleter information i must manually type everything in. I want tabCompleter to send me the information like it does when i set myself, or another player as an OP.

If i TP to another server world, or if i /op and then /deop myself I now have the TabCompleter information and permissions, I would like to know how minecraft does this so i can mimic it without the need to TP to another world or /op then /deop myself, or another player i may not know who might find an exploit to this. Now knowing this is not intended behaviour I'm wondering if i've done something wrong can anyone take the time to skim my plugin, maybe test the code themselves and give feed back? server setting? ... Spigot's tabcomplete option is set to 0 i'm not an idiot, but thanks for thinking it 😜 Thanks for any help in the matter 🙂

https://github.com/Th3-DoC/CreativeTP

wooden pine
#

@unreal mantle Hey is there a way to have different plugins on different worlds using MultiVerse?

frank driftBOT
#

Hey Evan! Please don't tag staff members.

wooden pine
#

Sorry clippy

#

@unlucky OmegaWeapon

grim cape
#

@unreal mantle Hey is there a way to have different plugins on different worlds using MultiVerse?
@wooden pine Off topic

frank driftBOT
#

Hey TurboSlayer! Please don't tag staff members.

grim cape
#

Ohh my bad

wooden pine
#

How is that off topic

#

im trying to set up different permissions for different worlds

grim cape
#

Then use context

#

it has nothing to do with the dev api

grim cape
#

!context

frank driftBOT
unreal mantle
#

@wooden pine @grim cape Please do not tag me. This is not important and neither questions are related to this channel.

grim cape
#

Sorry, i was quoting his message and it automatically had that in there. Promise I won't do it again.

nocturne elbow
next moth
#

Hm do I need to inject my own permissibleBase to update permissions in runtime? or is that purely to implement the "*" wildcard token? I feel like thats why world change /op work as they naturally inject via Bukkit with no worries of the "final" variables.

forest zealot
#

So I tried to add the API to my plugin

#

but it just gave me an error that I can't figure out

#

Can anyone help me?

#

Can I just use lombok to generate an instance and call it that way?

#

?

ebon ether
#

post the error message

forest zealot
#

Syntax error, insert ";" to complete ConstructorDeclaration

#

Adds that error to my currently generated Lombok instance

#

not for luck perms

#

just as an instance

#

Syntax error on token ";", { expected after this token

#

That on the luckperms

#

Nevermind i was being an absolute spastic

#

I forgot it needed to be in a private boolean

nocturne elbow
nocturne elbow
#

Okay, I think I got it. Will have to test first. It's in the docs but has a whole two sentences dedicated to it. I'd expand but I can't edit the wiki. https://f.jacob.engineer/lHpxLS.png

naive patrol
#

I was just looking through my chat with my dev to tell you, but looks like you found it

nocturne elbow
#

yea

#

i scrolled right past it like 4 times

naive patrol
#

I remember him muttering about how it's added as a node and "is bad" haha

nocturne elbow
#

nbd

proud crypt
nocturne elbow
#

done thx

granite yarrow
#

question, using the API to switch primary groups but it seems the prefixes lag behind/are cached for the previous group until i do /lp sync

#

but if I do it directly through /lp user foo parent switchprimarygroup bar prefixes also update immediately

#

using placeholders if that matters, tried with generic prefix placeholder and the direct ones from LuckPerms, not sure if it recreates them or something

#

is there maybe something else I need to save to make the prefixes take effect?

#

I guess I could request an update task to work around this for now, just not sure if im missing something

red falcon
#

For using the API, I was wondering how one could retrieve a list of all user permissions which the user possesses specifically, not those from any group or inheritance.

ionic obsidian
#
@EventHandler
    public void onInventoryClick(final InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();

        ClassName user = ClassName.getUser(player);```
#

does anyone know what class has a method getUser?

ebon ether
#

WHat do you want to get anyways?

ionic obsidian
#

the user

ebon ether
#

Do you want to get permissions?

ionic obsidian
#

well i wanna get the user first

#

then ima do user.getPermissions

#

after

ebon ether
ionic obsidian
#

u see this

#

what class is LuckPermApi

ebon ether
#

net.luckperms.api I think

maiden vault
#

Hello, i have 2 questions.

  1. how i can change the group of player with API ? Currently i have tried (but its not work) :
final User user = luckPermsApi.getUserManager().loadUser(targetUniqueId, account.get().getName()).join();
user.auditTemporaryNodes();

user.transientData().add(InheritanceNode.builder(group).build());

luckPermsApi.getUserManager().saveUser(user);
luckPermsApi.getUserManager().cleanupUser(user);
  1. with commodore we could overwrite minecraft command suggestion, or i need lock ther commands with permission ?

Thanks.

dim thunder
#

does anyone know a sound SQL query to fetch the group with the highest weight of a player

crystal sonnet
#

@dim thunder yes. There's a user/player table

#

And the primary group there is the one with the heighest weight

#

(Unless you change how the primary group is calculated)

#

But in most cases, that's the group you want to have anyways

dim thunder
#

k tyty

nocturne elbow
#

I need Help!!

#

My english is not the best, but i try my best

#

So today ive put The Luckperms Plugin on my Server and then ive informed all the Staff that i changed from Pex to LP

#

then one of my staff said it was easy to hack

#

that means, someone could hack luckperms.* and he could have acces to the web interface

#

and then destroy everything

#

I said, i beleave in Luckperms that it is an Safe plugin but she doesn't think so

#

can you say me, if it is possible to hack that plugin??

#

or is this safe

#

and an Reason why it is Safe

crystal sonnet
hollow horizon
#

How do you get a prefix from the API? I havent updated luckperms until today, and a plugin I made isnt working due to the new API updates.

visual wadi
#

How can I check if player has a certain group with Player#hasPermission?
group.identifier doesn't work and so doesn't using UserManager#getPrimaryGroup().

crystal sonnet
#

Doesn’t work means what exactly?

#

Always true, always false?

#

Are you using the native player object or LPs one?

visual wadi
#

It doesn't really check at all? I tried this: user.getUser(player.getUniqueId()).setPrimaryGroup("name");

#

and this: event.getPlayer().hasPermission("group.name");

#

and instead of checking and executing the command only if the player doesn't have the rank

#

This is without the LuckPerms API.

#

I will try with and give you output

#

Igrač == default

crystal sonnet
#

@visual wadi I think your check is wrong

#

If the user doesn’t have one of those 3 groups the check succeeds

visual wadi
#

yeah it should succeed but it shouldn't spam

#

and it doesn't set the primary group and just spams the message

#

seems that check if player has the default group works tho

#

found the problem, I can't seem to get user.getUser(player.getUniqueId()).setPrimaryGroup("neutral"); to work.

#

with Bukkit#dispatchCommand it works perfectly

crystal sonnet
#

That’s because setting the primary group is not the same as setting/adding a group

visual wadi
crystal sonnet
#

Setting the primary group only selects which one of the groups is the primary one

#

It doesn’t change the groups the player actually has

#

To see how to do that, check this:

#

!api

frank driftBOT
visual wadi
#

where can i find this boolean isPlayerInGroup ?

#

!api isPlayerInGroup

frank driftBOT
crystal sonnet
#

This is an example function you can add to your code @visual wadi

visual wadi
#

ok

dense wren
#

Hello I am currently working on a spigot plugin for my server and I am wondering how I could get the group the person is in

crystal sonnet
#

!api

frank driftBOT
sick current
jaunty pecan
#

yeah

#

use getContexts and then this method

sick current
#

cheers ❤️

hollow horizon
#

How do you get the prefix of a group from a groupname?

next moth
#

Well for those of you that remember my issues with tab completer not resetting until WorldChange or (/op, /deop) commands.......All i needed to know was ...

player.updateCommands !!!

Holy how stupidly easy the fix was, i was into NMS to complete my task...which i accomplished with pages of java and the TabComplete Packet ... compared to one line of bukkit api... 🤦‍♂️

jaunty pecan
#

ah yes :p

fluid steppe
#

I might be about to do something really smart or really dumb in a fork... only one way to find out...

#

So I'm intimately familiar with Minecraft Permissions... And I hate discord permission management, twitch bot permission management, or really, any sort of permission management anywhere else...

#

What if LuckPerms was standalone?

jaunty pecan
#

would be quite easily doable

fluid steppe
#

Yeah I've already checked out the structure

jaunty pecan
#

most of it is standalone already soo ye

fluid steppe
#

(I've also been writing tests for brigadeer-ts)

#

Think compiling it to JS would be kind of insane though, so going to NOT do that.

jaunty pecan
#

huh?

#

idk what that is

fluid steppe
#

and instead try to wrap it in a web service

#

brigadier rather

jaunty pecan
#

oh wow

#

fair

fluid steppe
#

Yeah, I've seen the implementation of Luck Perms, think I'd rather not port all that effort to JS, just yet,

#

not to mention jdbc drivers etc

jaunty pecan
#

haha yeah that sounds like a lot of work :p

#

you'd be better off just creating something new

fluid steppe
#

You'd be surprised, the end result of luckperms has been built on 10 years of iteration, from various developers

#

don't sell yourself short

jaunty pecan
#

that's true

#

by all means use the concepts / patterns etc

#

I'm just saying a full 1:1 port in a different language is probably not a good idea

fluid steppe
#

got a preferred micro/small web server / network protocol?

#

(just in case it eventuates, / is any good)

#

I'd be tempted by protobuf / websockets / rest/json

jaunty pecan
#

I agree with you on that

#

probably for permissions, json > protobuf

fluid steppe
#

To start with I expect I'm only making a way to query per user/context

#

so that way I can just firewall it / not care about auth

jaunty pecan
#

yep

fluid steppe
#

cache, unless redis invalidates it, or timer

#

Does LP use redis much? other then pub/sub notifications?

jaunty pecan
#

nope, just for pub/sub

hollow horizon
#

Is there any way to grab a group prefix from just a groupname?

#

after I updated lp, I had to update the api

#

and yeah

#

its kinda broken now

crystal sonnet
#

You essentially do it just like before

#

Get the group object, and get the prefix

oak ingot
#

So i query string names of users whos groups should be updated from mysql db.
Than convert the string to optional player object, check if the player is online and convert it futher to normal sponge player.
Than i call the LP method, which should update the user group.
User load_user = api.getUserManager().getUser(player.getUniqueId()); line crashes the server.
Can someone expain what im doing wrong ? Сouse im realy pepeg at java.

crystal sonnet
#

We need to know the error message

oak ingot
crystal sonnet
#

java.lang.NoClassDefFoundError: net/luckperms/api/node/Node

#

@oak ingot

#

Make sure you're using LP5

#

And that you're not shading in the API

oak ingot
crystal sonnet
#

You're not doing it, so you're fine

#

It means copying the class files of the API into your jar

oak ingot
#

so whats my issue then

crystal sonnet
#

The server you are running on

#

Is it using LPv5?

oak ingot
#

LuckPerms-Sponge-5.0.39

#

its a test one, but the same version is on my main vds server aswell

crystal sonnet
#

That seems very old

#

Make sure you use a more up to date one

#

And be sure to not contruct your LP class before the pre init phase

oak ingot
crystal sonnet
#

!downloads

frank driftBOT
oak ingot
#

and then scheduler from the screenshot is at GameStartedServerEvent, so it should be fine on that part

crystal sonnet
#

I'm talking about the initialization of your instance of the LP classs

#

Well nvm

oak ingot
#

its inside the scheduler

crystal sonnet
#

You're not initializing an instance anyways

oak ingot
#

crashes with the last version aswell

#

5.079

crystal sonnet
#

Can you post the code of your main plugin class?

oak ingot
#

yeah, sorry sir i was retarded

#

i've had it

#

but before the initialization, just in the main class

#

works now

#

i mean, initialization was before the server start, and that was the crash

#

thank you

oak ingot
crystal sonnet
#

Yes

#

What about it?

oak ingot
#

it doesnt add up

crystal sonnet
#

That’s only referring to the commands

#

Not the API

oak ingot
#

huh, can i do it in api in any way ?

#

do i just node + node

crystal sonnet
#

Get the old node (if it exists) get the remaining time and your time into it

#

*onto

oak ingot
#

k, thank you again sir

crystal sonnet
#

Be sure to remove the old node and add the new node

oak ingot
#

got you

nocturne elbow
#

i've got some issues with the luckperms api. i'm not sure if i'm reading the usage wrong, but it seems to me that the usage page is outdated. i have since deleted the plugin project out of pure spite, but shortly: i was trying to make a chat plugin where you could speak like in real life, default chance was 15 blocks, you could yell, whisper etc. etc. but i ran into a problem
when trying to put prefixes and suffixes into the mix, the api didnt work. it just gave me errors

#

@placid jay yeah thanks just totally skip over mine lmAo

placid jay
#

😄 sorry

nocturne elbow
#

it's ait

ember fulcrum
#

Hi, I have a problem. How can I add permissions per world with the new editor? Please, help me as soon as possible

nocturne elbow
#

@ember fulcrum is this regarding the api?

ember fulcrum
#

idk xd

nocturne elbow
#

Then don’t post here

crystal sonnet
#

it just gave me errors
@nocturne elbow use it properly then

#

I mean that's about as helpful as I can get with that detailed error description

nocturne elbow
#

@crystal sonnet yeah well hard to use it properly when u can’t even use the fucking functions mate

frank driftBOT
#

Hey Strobe! Please don't tag staff members.

crystal sonnet
#

As I said that's the best advice I can give you as long you don't provide your error messages

#

It was meant as a humerous attempt at pointing out that you haven't provided nearly enough information to be able to help you

#

@nocturne elbow

nocturne elbow
#

Mhm. I’ll try recoding it

crystal sonnet
#

ok

neat pilot
#

Hello how can I p.getDisplayName with the rank ?

oak ingot
#

how does one query remaining time for user on node.expiry ? Сouse if i get it right, node.getExpiry is not what i need.

long moon
#

Check the javadocs, but, that's probably the time it expires

#

Which, simple maths from that point

jaunty pecan
long moon
#

having useful features in the API

oak ingot
#

I need like an actual example, couse i dont know the structure, and i cant find it anywhere. Like how do i call it? do i do it from api. or user. or node. If i call it from the node, how do i get the user, or other way, or both.

crystal sonnet
#

If you can't do it with that, then you shouldn't be programming plugins @oak ingot

#

Learn the Java basics

oak ingot
#

well im forced to write connection plugin, because i cant just modify the db value, which i would've like to do. and i did manage to get the rest together. and im pretty sure i can finish the last part if you just give me an example 😕

crystal sonnet
#

The method call is right there

#

The class which the method belongs too as well

oak ingot
#

God imagine being like that. All i ask for is a simple, well simple for you line of code, which would save me 10 hours of just trying different stuff. Like i've even specified, that i need from it. But all i get is -"ugh you shouldnt be programming, its right there, how could you not see it ?". I came here to get help, and that kinda the point. To not know something. I just cant. Its like saying to a game newcomer, well you're bad at the game, so you shouldnt be playing. Sometimes you learn from practise. And maybe i could've understood how to call those methods correctly, but ehh. Let me be hard stuck trying to find whatever you're talking about. Please don't even become a teacher, you'd be a horrible one.

crystal sonnet
#

Please don't even become a teacher, you'd be a horrible one.
If you insits. I'd disagree and let me tell you why

#

My base philisophy is that I am here to help people help themselves

#

I am not here to help them

#

That is a huge difference

#

Now you may be asking why

#

The reason for that is quite simple: If I just tell you, you haven't learned anything (or hardly anything) so you'll just come back and ask again the next time.

#

Now if I refuse to give you the direct answer and make you work for it then you're forced to learn how to find that info yourself

#

In other words I am helping by the saying "Give a man a fish and you'll feed him for the day. Teach a man to fish and you'll feed him for a lifetime"

#

Now me saying you should learn Java basics first isn't me being some elitist asshole or something

#

That is me showing you the easier way. Because in this case you can learn to write plugins by constantly begging for help, struggling and struggling with no real idea on what you're even doing or you can learn Java (basics) first (which is a lot easier) and then making plugins suddenly is 1000 times easier

#

And regarding the latter case all you need to do to find the answer is think about it and look for the right things. You clearly know already about instances how to call methods, etc. Now you are looking for a call on how to get the remaining time from a node. Luck linked you the method declaration of exactly that method. Now you asked which class you need to call that on. And the answer is quite simple. Check the top of the file. It tells you right there for which class the method declaration is for.

#

So once you figured that one out by yourself you can do it again when somebody links you another file or go a step further and search for those files yourself

#

@oak ingot

#

Now my method may seem rude, inconsiderate or even bad to you. But in the long run you'll learn the most

bold moth
#

ok so im trying to get luckperms to help my Minecraft server to get ranks ingame but me actually trying to get it like it wont work with me and it wont install or anything how can i fix this please help

#

@thorny echo

frank driftBOT
#

Hey Nightz! Please don't tag staff members.

crystal sonnet
#

Are making a plugin that uses the LP API? @bold moth

icy shard
#

Hello, I'm trying to use Commodore https://github.com/lucko/commodore and I get a null pointer exception when using "CommodoreProvider.isSupported()". Extracting my jar shows that Commodore has been shaded properly and my imports have changed to match the shaded package. I'm not sure why I'm getting the NullPointerException. My only guess is that something from the Commodore library is not being referenced properly (e.g. the pointer is missing the object it's supposed to reference). However the stacktrace doesn't tell me what pointer exactly is null.

icy shard
#

If it helps, I'm using 1.15.2 Paper

#

I'm also compiling against Graal 11.0.6.

#

➜ ~ java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07)
OpenJDK 64-Bit Server VM GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07, mixed mode, sharing)

crude laurel
#

is there a v4 to v5 api migration guide somewhere?

#

i cant find it on the wiki

icy shard
#

Nevermind, it turns out to have nothing to do with "CommodoreProvider.isSupported()" and has everything to do with lines such as "commandHealth.setExecutor(new Health());". I suspect it might be because I put "public static void registerCompletions(Main main, Commodore commodore, PluginCommand command) { ... }" in the commands' classes. I'm going to play around with that code and see if it starts working. I may have to create a separate package for commodore's registration of commands as opposed to putting the registration functions in the commands' classes.

#

omg, I may be an idiot. I forgot to rename the command from breakhealth to health in plugin.yml. I'm going to see if renaming it fixes the problem. This is not a problem with Commodore like I thought it was. 🤦‍♀️

#

Yep, I'm an idiot. For those interested, I figured out how to make the health bar disappear completely in survival by running "player.setAbsorptionAmount(Double.MAX_VALUE);" You can then fix it by resetting absorption back to 0.

oak badger
#

follow-up from what i asked in #support-1; so as for implementing hasPermission so that it's backed by a luckperms group, the best way i can think of right now is doing LuckPerms -> getGroupManager() -> getGroup(@NonNull String name) -> getNodes(), and then for each Node, check that it is a permission node, and get the value if so.

just wondering if this is the best way to approach this, or if there is a more direct / efficient way of doing this (although I could also just cache this if necessary). i wanted to try doing this via vault at first but it seems the only method available for my use case with a custom CommandSender is http://milkbowl.github.io/VaultAPI/net/milkbowl/vault/permission/Permission.html#has(org.bukkit.command.CommandSender, java.lang.String) and it just checks Bukkit's hasPermission so I probably have to implement it anyways.

crystal sonnet
#

My recommendation would be that you give your command senders UUIDs and use the implementation used for players

#

@oak badger

#

Makes you compatible with most permissions plugins

oak badger
#

i thought of that briefly but that seems like more of a hack, because this the command sender isn't a player

#

most of the player methods don't apply to this sender

#

unless a luckperms user doesn't need to be a player, is that possible here?

#

looks like UserManager has some methods for managing users, but how would i add the custom user to luckperms since it isn't an existing player?

icy shard
hallow spoke
#

I'm getting a null pointer exception when trying to get a Set of the loaded groups, I get like 20 errors when typing out my command so I know it has to to with my onTabComplete

crystal sonnet
#

Well you’re supposed to return an empty list and not null if there’s no suggestions

hallow spoke
#

oof

#

i return null for all my other tabcompleters with no problem but ill check

oak badger
#

the return type for the method signature needs to be List<String>

#

you have it as Iterable<String>

hallow spoke
#

wow im blind not sure how that got there

oak badger
#

probably just a dumb auto-suggestion from intellij

hallow spoke
#

exactly

oak badger
#

😄

crystal sonnet
#

Weird as if it was wrong it wouldn’t compile

#

He has the @Override

oak badger
#

hm, yeah, that's strange

hallow spoke
#

thanks it didn't like the return null; i changed it to an empty list :P

icy shard
#

I'm wanting to get help with the Commodore API that Lucko has provided. Where would I be able to get help with that? Thanks

crystal sonnet
#

Here. Though not many know how to use it

icy shard
#

So, looking at LuckPerms' source, I found resolving vanilla selectors, but I still have no idea how to remove displaying the player's ign from tab completion.

crystal sonnet
#

So you might wait a little for an answer

icy shard
#

me? @crystal sonnet

frank driftBOT
#

Hey Alexis.Evelyn! Please don't tag staff members.

crystal sonnet
#

Yes

icy shard
#

okay, thanks

oak badger
#

but when it was working, it worked well

jaunty pecan
#

pretty sure that issue is fixed now

#

Alexis, you also need to implement & provide the bukkit tab completion interface for your arguments

oak badger
#

oh i see it's been a while... last time i used it was 1.3

jaunty pecan
#

it's on 1.7 now 😉

oak badger
#

yeah i saw that XD

#

by the way, any advice on adding a user to luckperms which is not a player? brainstone suggested that earlier but i don't see in the api that there is anything for adding a new user

jaunty pecan
#

new users are created on demand

oak badger
#

ah so then just loadUser would work?

jaunty pecan
#

yep

oak badger
#

ah ok that could probably be more clear on the doc, since it just says Loads a user from the plugin's storage provider into memory.

#

made me think the user had to already have been created XD

#

sorry for the dumb question then

#

at this point though i'm fairly certain my idea is going to work then, and getting a custom command sender to handle perms via luckperms user is probably going to be better than by group directly

#

i think that will be a bit more flexible

#

i'll also check out commodore again soon then and see if i encounter that issue again -- will reply on github when i get around to it if it's working for me now 😛

#

i'm honestly so glad that exists because i was about to try implementing brigadier from scratch, but found that

jaunty pecan
#

haha well yea

#

people seem to really struggle using it in general

#

I think it's just because brigadier is confusing

#

and also because implementing tab complete even just in Bukkit can be tricky

oak badger
#

makes sense to me

#

to be honest after reading the code for brigadier all i thought was, wow, this seems a bit complicated for how simple of a problem it tries to accomplish

jaunty pecan
#

i've also written a (quite nice) tab completer util which makes implementing the bukkit side easier

#

for example

oak badger
#

nice

#

yeah i find myself using streams as well quite a bit for tab completions lol

jaunty pecan
#

otherwise you have to end up with loads of if statements

oak badger
#

i ended up dropping brigadier after failing to have suggestions load with commodore because i just didn't feel like it was worth it enough

#

i just wanted the contextualized parameters with the custom coloring and such lol

#

also implementing it seems like a pain to debug

#

saw the commodore impl., you got a lot of nice recursive code to handle a lot of the stuff

icy shard
#

Okay, so implementing the tab completion interface will remove the user's ign suggestions then?

jaunty pecan
#

if you implement that behaviour in your tab completer, yeah

icy shard
#

okay, cool. I'll work on that now. Thanks

jaunty pecan
#

saw the commodore impl., you got a lot of nice recursive code to handle a lot of the stuff
hah I wouldn't say any of it is nice code, it's pretty horrible in a lot of places

oak badger
#

by default spigot's tab completer returns player names if you return null

#

hah I wouldn't say any of it is nice code

well i commend you anyways for making it as clean as it is, mine would be worse lol

icy shard
#

that actually explains a lot pop4959. I haven't implemented the completer at all and only have the .commodore files setup.

oak badger
#

yeah spigot will just do that

#

honestly i'd rather have it reversed where spigot gives you a method of returning a set of players, but by default it is an empty set

icy shard
#

Same

oak badger
#

because i find myself having to return empty sets a lot lol

#

depends on the plugin though, i guess it could be a good default for some people, but it just seems kind of half baked to me

#

although it's probably already clear that spigot's impl of brigadier is extremely half baked, otherwise we wouldn't need to do anything ourselves or with commodore

jaunty pecan
#

well spigot just doesn't expose it

#

and have tried to keep the old api working with minimal effort

oak badger
#

yeah and that's what sucks -- everyone would use this, just no one knows/cares enough

jaunty pecan
#

(sums up the state of bukkit/spigot's api development in general)

oak badger
#

brigadier, at the end of the day, is pretty nice

#

i like how it works with vanilla commands a lot

icy shard
#

One issue I have with bukkit is requiring both the plugin.yml and the command registry to have the command listed. I spent a good 2-3 hours debugging why my plugin threw a npe only to find I forgot to rename a command in plugin.yml. I now have a try/catch statement to make sure I don't have to spend that long again if I forget to rename/name a command in the yml.

oak badger
#

eh im done bashing on spigot for now, but good chatting with you all. two good things out of this for me: 1) custom commandsender will probably work more or less painlessly using the luckperms api, and 2) commodore has gotten some updates. glad i figured all that out.

icy shard
#

Good chatting! 🙂

oak badger
#

honestly i would probably rather use vault or something instead but i don't think it'll work with the custom sender, as far as i can tell

#

plus that part is only for a personal use plugin so it won't be too bad if i'm stuck with using luckperms directly for it

icy shard
nocturne elbow
#

i may be missing something but is it not possible to get a uuid from a PermissionHolder

long moon
#

PermissionHolder could be a group or a user

nocturne elbow
#

figured

#

actually, is PlayerDataSaveEvent called whenever someone's groups are updated?

#

or does it wait a little bit to actually write the changes

long moon
#

depends on how they're updated

#

Basically called when ever something calls save on the data

#

commands, etc, do that immediatly

#

as for plugins using the API, they generally do it immediatly, but 🤷‍♂️

nocturne elbow
#

so at one point or another the data will be saved, got it

#

thanks

#

just needed a way to write the users groups to a database whenever they are modified

long moon
#

the thing toying with groups should generally be the thing to save it

nocturne elbow
#

lp user zbk parent add does not seem to be firing the event

#

or maybe im just registering it wrong

#

¯_(ツ)_/¯

jaunty pecan
#

PlayerDataSaveEvent refers to uuid/username data being written to the db

#

Not permissions

#

NodeMutateEvent is probably your best bet for catching that sort of thing

mortal wyvern
#

How can i get the Rank auf the Player with die LuckPerms API?

mortal wyvern
#

Help pls

last mortar
#

Hey, I’ve been playing a lot of beta 1.7.3 lately, and I’ve used luckperms for modern versions to great success. How hard do you think it would be for someone to backport it/how portable is the code? I ask because I might end up attempting to do just that.

unkempt oar
#

hey, i have the problem that i automatically create a server for each player and so i can't define the server name in the config, is there something like an onPermissionRequest event at the api to modify this?

crystal sonnet
#

@last mortar just try the legacy version

#

And it should be pretty portable

#

@mortal wyvern use the primary group

dense shale
#

uh, if I try to set the PrimaryGroup of a player nothing happens with the player

    LuckPermsProvider.get().getUserManager().saveUser(LuckPermsProvider.get().getUserManager().getUser(target.getName())); ```

The plugin gives no error back .-.
crystal sonnet
#

@unkempt oar you can make an addon that adds custom contexts

#

@dense shale setting the primary group only selects which of the assigned groups is the primary one

#

I does not add or remove groups assigned to the player

unkempt oar
#

how can i create a Dynamic contexts

crystal sonnet
#

Have a look here @dense shale

#

!api

frank driftBOT
crystal sonnet
#

@unkempt oar check the docs. Also you can have a look at the Plugin ExtraContexts for an example implementation

unkempt oar
#

thanks

crystal sonnet
#

You’re welcome

dense shale
#

Sorry if I'm dumb but how can I add a group to a player? .-.

crystal sonnet
#

!api

frank driftBOT
neat pilot
#

Hello how can I p.getDisplayName with the rank ?

#

Pls

dense shale
long moon
#

You would need to get the prefixes manually if you wanted them

#

For adding a group to a user, you'd create a group node with the factory and give it to them

nocturne elbow
#

Hi, just want to be able to check if a user has a permission within a Bungee Plugin.
The GitHub says ```public boolean hasPermission(User user, String permission) {
ContextManager contextManager = api.getContextManager();
ImmutableContextSet contextSet = contextManager.getContext(user).orElseGet(contextManager::getStaticContext);

//PermissionData permissionData = user.getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
//return permissionData.getPermissionValue(permission).asBoolean();
//Although these two lines don't work, I assume they're meant to be:
CachedPermissionData permissionData = user.getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
return permissionData.checkPermission(permission).asBoolean();

}
public User loadUser(Player player) {
// assert that the player is online
if (!player.isOnline()) {
throw new IllegalStateException("Player is offline");
}

return luckPerms.getUserManager().getUser(player.getUniqueId());

}

(The player will be online if it is called), 

Not sure whether I need to run either of these async. Could someone let me know please? 😄
heavy frigate
#

Lol that's easier

#

But I do not know much about this so.

nocturne elbow
#

Ah okay. I'm just not sure whether or not that method needs to be called Async.

#

If anyone could lmk that'd be super useful, tag me if you can please

nocturne elbow
#

How do I give someone an rank?

frank driftBOT
crystal sonnet
#

@nocturne elbow just use the bungee permissions check

#

much easier

#

@nocturne elbow @dense shale you give them a group node

#

*Inheritance Node

nocturne elbow
#

Would that work if I'm checking for spigot nodes? @crystal sonnet

frank driftBOT
#

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

nocturne elbow
#

Oh! Sorry

nocturne elbow
#

Ty, wasn't sure if bungee and spigot permissions were linked

#

Just assumed they weren't

crystal sonnet
#

There is no difference

#

Or can you tell if this permission is a bungee or spigot permission: invsync.sync.health

#

@nocturne elbow

nocturne elbow
#

No I get you, I mean I didn't know if like ProxiedPlayer.hasPermission(permission) would return the same as Player.hasPermission(permission)
As you need to use luckperms bungee to give bungee perms - you can't use luckperms spigot to give bungee perms (or that's my understanding?), so I figured they must be separate things

#

anyone knows how I can add an default rank so people who joins get get that rank instant

crystal sonnet
nocturne elbow
#

oh okat

crystal sonnet
#

@nocturne elbow there are different jars, because permissions are not a vanilla MC concept

#

Meaning it's nothing that gets communicated between Spigot and Bungee

#

The permissions are synced when you use the same database for all instances

nocturne elbow
#

Ahhh brilliant okay! Thank you for your help, wish I'd of looked into permissions first now instead of assuming 🙄, wasted everyone's time!

ripe token
#

How do I load Luckperms API on Velocity? If my plugin starts before Luckperms I won't be able to register / get the Luckperms api on startup.

crystal sonnet
#

Have it start after LP

ripe token
#

How dat? Or is this the wrong place to ask for that

crystal sonnet
#

Declare LP as an optional dependency of your Plugin

ripe token
#

That's the part i dont know how to do sadly

#

not explained anywhere how to

crystal sonnet
#

Ask on the velocity discord yjrn

#

*then

ripe token
#

👍🏼

unkempt oar
#

has the context plugin to be on all servers or only on the testserver?

crystal sonnet
#

It has to be on all servers you want the context to be apllicable to

#

The context can only appear when the plugin is present

#

But unknown contexts don't break anything

crystal sonnet
#

@unkempt oar

unkempt oar
#

okay, thanks

fluid steppe
#

I so badly wished works app used a permissions API similar to luck perms

#

It's a gross mess

dense shale
#

uhm..
help?

java.lang.IllegalArgumentException: Attempting to build non-permission node with PermissionNode.Builder. permission = 'group.owner', correct builder type = me.lucko.luckperms.common.node.types.Inheritance$Builder

long moon
#

You're tryna create a permission node for a group

dense shale
#

oh thank you 😅

mortal wyvern
#

LuckPermsProvider.get().getUserManager().getUser(p.getUniqueId()).getPrimaryGroup().equals("Owner");

#

ist that right?

#

i only want to check if the Player has the Rank Owner

crystal sonnet
#

!api

frank driftBOT
crystal sonnet
#

And keep in mind group names are always lowercase

#

@mortal wyvern

mortal wyvern
#

LuckPerms is with Perms? group.Owner also???

crystal sonnet
#

Again, group names are lowercase

#

And I don't understand your question

mortal wyvern
#

Sry i am from Germany xD

crystal sonnet
#

There are examples right on the page

mortal wyvern
#

player.hasPermission("group." + group);

#

this

crystal sonnet
#

Yeah

long moon
#

everything is a node

crystal sonnet
#

That works

long moon
#

Meaning that as a side-effect of that design choice, ^

blazing portal
#

I am making a prisons server and i was wondering how i would add a permsion / group to a users when they run the /rankup (my custom command not from ezrank or what ever its called)

crystal sonnet
upper linden
#

how do I check if an offline player has a permission

#

OfflinePlayer#hasPermission doesnt exist and this is what the wiki says

#

luckperms cant get the offline player either

cold panther
#

@upper linden (just incase you still need it)

upper linden
#

i was going to use vault api

#

but that works

cold panther
#

If the vault API is working for you, you should be fine without the LP API then

stiff glacier
#

hey

#

how do I get the tab color?

tidal scaffold
#

hiya would i be able to talk to a member of staff, i have quite a few questions about the plugin :)

upper linden
#

in general, how am I suppose to check the permissions of an offline player? or is that not something im suppose to do

#

the link ryanjh sent has the api on how to do it, but i just read another post regarding the luckperms api that it loads the user onto the servers main thread and it kills performance

#

ping when u answer pls

crystal sonnet
#

I don’t know where you read that but that’s plain wrong @upper linden

#

Also have a look here

#

!api

frank driftBOT
crystal sonnet
#

@tidal scaffold

  1. just ask. Here are plenty of people that can help you. Not just staff.
  2. if you’d have asked your questions straight away I could’ve answered them now instead of asking you for what you actually want
  3. if you have questions about using the plugin and not about using the LP API so you can integrate your own plugin with it, the right channel is #support-1
upper linden
#
Caused by: java.lang.RuntimeException: The operation to load user data for '23f54e58-e82c-4b33-bbb1-c9a2c4bb237b' was cancelled by LuckPerms. This is NOT a bug. 
The lookup request was made on the main server thread. It is not safe to execute a request to 
load data for offline players from the database in this context. 
If you are a plugin author, please consider making your request asynchronously. 
Alternatively, server admins can disable this catch by setting 'vault-unsafe-lookups' to true 
in the LP config, but should consider the consequences (lag) before doing so.

^ my error when checking the offline player

long moon
#

do it async, basically

crystal sonnet
#

Well LP is doing it one the main thread if you're calling it on the main thread...

#

Or well by default LP refuses to

visual wadi
#

I used ```java
LuckPermsProvider.get().getUserManager().getUser(player.getUniqueId()).data().add(Node.builder("group.prayer").build());

cold panther
#

If you still need help, be sure to save changes using:

LuckPermsProvider.get().getUserManager().saveUser(user);

@visual wadi

visual wadi
#

Thank you. I thought it automatically saved.

#

LuckPermsProvider.get().getUserManager().saveUser((User) event.getPlayer()); is this fine?

cold panther
#

It needs to be a luckperms User object rather than a Player object, so not really. When adding the permission above, you should store the user so you can use it for the save method

#
User user = LuckPermsProvider.get().getUserManager().getUser(player.getUniqueId());
user.data().add(Node.builder("group.prayer").build());
LuckPermsProvider.get().getUserManager().saveUser(user);```

Something like that would probably be best
visual wadi
#

Thank you.

cold panther
#

no problem

visual wadi
#

Oh nvm.

#

I'm blind excuse me.

cold panther
#

Whoops, I forgot about that myself

visual wadi
#

Yep perfect.

#

Works perfectly! Thank you.

cold panther
#

No problemo

foggy warren
#

Any reason why lp is setting my perm to have two .'s
if (player.hasPermission("apollonetworks.jointitle.default")) {

crystal sonnet
#

Not sure what you mean

#

@foggy warren

foggy warren
#

like my plugin is set to that perm.
But ingame its registering that there should be two dots in-between apllonetworks & jointitle

languid socket
#

Have you registered it correctly in your plugin.yml?

magic anchor
#

If you registered it in your plugin.yml, unregister it and try Bukkit.getPluginManager.addPermission(new Permission("apollonetworks.jointitle.default"));

nocturne elbow
#

How can i give a player a group by enter a command?

crystal sonnet
#

@nocturne elbow what code do you have already?

nocturne elbow
#

How should I set luckperms for bungeecord?

crystal sonnet
#

@nocturne elbow this is the channel for plugin developers using the LP API

harsh sparrow
#

so if someone is in a rank like owner and u want there tag to be OWNER panda4121 not panda4121 like the thing on top of there head

nocturne elbow
#

@crystal sonnet

Server.getInstance().dispatchCommand((CommandSender) Server.getInstance().getConsoleSender(), "lp user " + p.getName() + " parent set booster");
frank driftBOT
#

Hey Florian! Please don't tag staff members.

nocturne elbow
#

sry

visual wadi
#

That's not really how you should set ranks.

crystal sonnet
#

I mean that looks like it would work

#

Not the ideal way but it should work

#

Have a look at this

#

!api

frank driftBOT
nocturne elbow
#

Hi i need help with Info/option nodes
How I can use LP where get/setPlayerInfoString is used? I need it to Towny plugin.
I try it with /lp user pvvvo meta set towny_default_modes local but it doesn't work, (It should put me in towny local chat for default)

nocturne elbow
#

Anything?

#

:/

tribal ridge
#

how do i make it so when someone joins they get that role in my server

bronze loom
#

Mal eine Frage, gibts für LuckPerms ein Event (ChaningGroupEvent, oder so, ihr wisst was ich mein)? Wenn ja, wie heisst es?

languid socket
#

NodeEvent @bronze loom

bronze loom
#

NodeAddEvent
Called when a node is added to a holder
NodeClearEvent
Called when a holder has their nodes cleared
NodeMutateEvent
Called when a node is added to/removed from a user/group
NodeRemoveEvent
Called when a node is removed from a holder

#

es gibt nur diese

#

@languid socket

languid socket
#

A nodeevent is same as changingrankevents just check the api.

bronze loom
#

but witch one?

true rapids
#

Hello i want to ask if i set permission to player with api and i have bungeecord. It sets global permission or local permission?

cold panther
#

if you don't define a context, the permissions would be global

azure latch
#

Hey, so how do I get prefixes and suffixes? I'm following the dev API wiki page but MetaData doesn't seem to be something I can import

#

code so far: java @EventHandler public void onPlayerJoin(PlayerJoinEvent e){ Player p = e.getPlayer(); User user = this.lp.getUserManager().getUser(p.getUniqueId()); ContextManager manager = this.lp.getContextManager(); ImmutableContextSet set = manager.getContext(user).orElse(manager.getStaticContext()); QueryOptions queryOptions = manager.getQueryOptions(user).orElse(manager.getStaticQueryOptions()); //MetaData metaData = user.getCachedData().getMetaData(queryOptions); }

#

NVM

#

solved

#

You should update the docs to show you have to use CachedMetaData now tho

#

Is there an event for when a player's primary group changes? If so what is it, and if not how can I check for it?

azure latch
#

Also, how do I get all users in a group without using a for loop for online and offline players and then checking if each one is in the group?

stray current
#

When using NodeMutateEvent(in my caseNodeAddEvent) does the getDataBefore() method return group permissions too or only personal permissions ?

stray current
#

Is there a way to search for a permission value from online players on 3 different servers through the API ?(The permissions are shared between the servers)

crystal sonnet
#

What do you mean with search?

#

What exactly are you searching

stray current
#

Alright ill give a full explantation of what I am doing and what I have tried
I am working on three servers strongly connected
I have a placeholder plugin that I need to say how many of a certain permission is online

Currently I am using redis to set variables of how many of each perm is online on the server, incrementing and decrementing it when people log in and log out
That worked okay.. until someone has permission changes on them while logged in, so I had to listen to those with the LuckPerms API
For furturer explaining, lets say I am listening on the permission vv.a
Started of only listening on when vv.a was removed and added and incremented and decremented accordingly - This worked okay, until a group with vv.a was added or removed from someone - So I added group checking too, going through all the permissions of the groups being added/removed.. this again works okay but now the problem comes with adding multiple groups with vv.a perm as it has already counted it once.. This is what I am working on atm - any suggestions to another approach is very welcome

So if it was possible to just search all three servers for the amout of people online with the permission then it would be a lot easier to create as I would only have to call that whenever the placeholder was requested

#

@crystal sonnet

frank driftBOT
#

Hey Rasmus! Please don't tag staff members.

stray current
#

sorry

fresh blade
#

Hey guys, I'm just trying to find the easiest way to add a permission to a user, and a way to remove it for a plugin I created. I'm only an intermediate java developer, and I'm reading this https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#modifying-usergroup-data -- Seems way too complicated. I was simply hoping for a LuckPerms.addPermission(UUID, "permission"); but it appears to be way more complicted then that

#

I see

DataMutateResult result = user.data().add(Node.builder("your.node.here").build());

But I'm not sure where user is coming from. I used a Player instance, but then it wants me to cast it as something else..

#

Oh I think I found it... standby

#

Okay so I found

public class UserPerm {
    public UserPerm loadUser(Player player) {
        // assert that the player is online
        if (!player.isOnline()) {
            throw new IllegalStateException("Player is offline");
        }
        
        return luckPerms.getUserManager().getUser(player.getUniqueId());
    }
}

but luckPerms on the last line cannot be resolved

#

Lmao I think I'm just gonna do this Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "lp user " + user + " permission set perm.here true");

warm ginkgo
#

Is there a specific event for a user being added to a group (for the API)?
Like would be triggered by the command /lp user lazerpent parent set myGroup

azure latch
#

@fresh blade. Why don't you read the documentation? It covers stuff like this

#

!api

frank driftBOT
azure latch
#

@warm ginkgo mabye GroupDataRecalculateEvent?

warm ginkgo
#

alright ty

#

I am using UserDataRecalculateEvent right now

#

but it triggers on every join, leave, ect

cold panther
#

It really depends on the use case. The basic NodeAddEvent allows you to get the node which was added, and then you can check the node to see if it contains 'group.'. Since it extends the NodeMutateEvent, you could possible check whether the subject is a user quite easily

warm ginkgo
#

alright, im really new to luckperms api, so I don't know much of this

cold panther
#

it's all good

warm ginkgo
#

so this event will trigger whenever a users parent group is changed?

fresh blade
#

@azure latch You stated "Why don't you read the documentation?" Did you happen to read what I said? I clearly state that I referenced the documentation, I clearly gave an example from the documentation. Maybe you should use your own eyes and take your own advice before telling others.