#luckperms-api
1 messages · Page 38 of 1
me = confused, it gets the permission on NodeAddEvent, but it doesn't show in /lp user powercas_gamer permission info
using Maven/intelliJ
I'm a little lost as to what to do here. Version is giving me error "Dependency 'net.luckperms:api:5.2' not found "
Ctrl + Shift + O?
oh, what did that do?
okay cool, thanks
I'm looking to get a list of all players in a group (online or offline). Is there a method for that? I can't seem to find anything.
Never mind, I found it. api.getusermanager().searchAll()
for those searching in the future
@turbid solar try pinging Luck about it
Hey BrainStone! Please don't tag helpful/staff members directly.
smh 😔
/ban
Lol
Is there no feature for getting directly all players from specific group
It could be good to cache all uuid, but idk
Or a method like Group#loadAllUsers
You can call UserManager#searchAll(NodeMatcher) for that
And search for the InheritanceNode you want
ok ty
Hi
Hi
How i can do an action on player change group?
You subscribe to the NodeAddEvent, check that the event target is a user and the node is if type INHERITANCE
!api IIRC the second link explains how to subscribe to events
Learn how to use the LuckPerms API in your project.
Oh ok ty
@nocturne elbow how to get the uuid from the event?
Hey zAngel! Please don't tag helpful/staff members directly.
ups
check that the event's target is a user
then you cast to User and get the uuid
yeah?
no way to get :c
check that the event's target is a user
how
target instanceof User?
yus
oks
That is after checking that it's a user I presume
nop
That'll return uuh.. something, but you're looking for the node's key
If you want to test the node's type, check that the NodeType is of NodeType.INHERITANCE
==
??
this return like "group.mod"?
yes
ok ty
Can i aska question that may not be appropriate over here cuz im not sure
is it about the LP API?
sort of
ask away
It's conflicting with my plugin which uses bungee chat API for action bar
okay
I could give your th error
how is this conflicting with your plugin? this is strange 
especially since the Stacktrace doesnt give anything about my plugin
!paste the entire latest.log ig
Seeing a paste of the problem makes everything so much easier! Use https://bytebin.lucko.me/ for easy pasting!
Pastebin any relevant segments of the console log. If it's a startup error, this includes the entire startup log!
Pastebin the entire LuckPerms config file (passwords removed) as well as any other relevant files!
ok 1sec lemme redownload
i just redownloaded Luckperms and it seems to work for now
idk what happend
me neither
must have been using an outdated version
Corrupted file
yes bot nodeaddevent dont come when i do parent clear or in editor
what event i need use?
i need check when editor change a rank of a player, when you use parent clear
NodeAddEvent will trigger...... when you add a node, not when you clear or remove
For those you have NodeRemoveEvent and NodeClearEvent iirc
and when i edit the groups by editor?
I'm not exactly sure but those should do. Check the javadocs, they contain lots of useful info; play around with the events, experiment, that way you'll know for sure
link?
📌
Uh. hi,
I'm confused with the API. If I want to remove permission I do this?
api.getUserManager().getUser(uuid).getNodes().remove("island.own")
!api
Learn how to use the LuckPerms API in your project.
!cookbook has some examples on how to add/remove permissions afaik
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
Oh, there it is. I saw this sometime ago but couldn't find it. Thanks
Hm.
api.getUserManager().getUser(uuid).getNodes().add(Node.builder("island.own").build());
doesn't seem to wrok
Gotta save the user
oh .-.
@crystal sonnet Well I'll start to learn Java then haha. Thanks for the help! It shouldn't be too hard.
Minecraft plugins are not the place to learn Java
And working with the API even more so
🙇♂️
Maybe I should ask a friend who knows then. Oh boy why every Idea I have needs to be so hard to implement 😂
!api
Learn how to use the LuckPerms API in your project.
Hello I'm trying to put a manager position on it but the tag is on master and I don't know how to fix it could help me?
??
https://github.com/LuckPerms/api-cookbook/blob/master/src/main/java/me/lucko/lpcookbook/commands/AddPermissionCommand.java#L44-L50
You use an InheritanceNode.Builder instead of a regular Node.Builder, you build it with the expiry you want and the contexts you want and you use this method instead of the other add https://javadoc.io/static/net.luckperms/api/5.2/net/luckperms/api/model/data/NodeMap.html#add-net.luckperms.api.node.Node-net.luckperms.api.model.data.TemporaryNodeMergeStrategy-
yo fefo congrats on the mod promo
no congratulations allowed
hola, alguien me puede ayudar con esto?
@worldly pewter I believe you're in the wrong channel - please use #support-1 or #support-2
ok, tanks
Any dev online? This isn't related to your plugin although I know you guys have bash scripts.
Why does the following not work in a bashcript
sudo rm -rf ./Servers
sudo rm -rf ./Plugins
sudo rm -rf ./BuildTools
nevermind froget the #!bin/bash
!api Check the second link in the embed
Learn how to use the LuckPerms API in your project.
In particular the one that says something "Difference between online and offline users" or something like that
When I try to give a person a permssion with the api I get this result FAIL_ALREADY_HAS even though the person as no perms ```LuckPerms api = provider.getProvider();
User user = api.getPlayerAdapter(Player.class).getUser(playerMC);
...
String lpGroup = plugin.getConfig().getString("roles." + role.getName());
DataMutateResult result = user.data().add(Node.builder("group." + lpGroup).build());
System.out.println(result);```
Node.builder("group." + lpGroup)
might want to use anInheritanceNode.Builderinstead, so you don't have to deal with the"group.bit (if that changes some time,InheritanceNode.Builderwon't break (it won't change, but still, it's there for a reason lol))
but that's not the issue anyway
- Are you saving the user data after modifying it?
- Screenshot
/lp user <user> parent info - Print out the group name too
Debugging is vital
@nocturne elbow you can always just call user = userManager.loadUser(uid).join();
If the user is loaded this works just the same as user = userManager.getUser(uid);
If not then it loads it in
You're welcome
hey is there some kind of wiki for lucko's helper api?
Hi, I'm getting NPE for line with getUser().getNodes() ```java
for (Player p : Bukkit.getOnlinePlayers()) {
if (seconds > 0) {
LuckPerms api = LuckPermsProvider.get();
Node owned = Node.builder("island.ownA").value(true).build();
if (api.getUserManager().getUser("" + p).getNodes().contains(owned)) {
scoreboard(p);
}
}
while in another class it works perfectly, what can be the issue?
What on earth is getUser("" + p)?!
Uh, getUser() is @Nullable User getUser(@NonNull String username)
Oh, OH
In any case use the UUID
And please move the stuff you don’t need to create every loop outside of it
Wdym, for ```java
LuckPerms api = LuckPermsProvider.get();
Node owned = Node.builder("island.ownA").value(true).build();
Yes
Alright, works, thank you
And you can additionally also store the user manager in a variable outside the loop
Hi, how to remove group? couldn't see in wiki maybe im dumb
or just a node with group.name set to false will be enough?
i want to remove specify groups from all players
and apply them to that server specify
i mean remove global group, add specified server group
luckPerms.getUserManager().loadUser(player.getUniqueId()).thenAccept( user -> {
for (Group group : user.getInheritedGroups(user.getQueryOptions())) {
if (!map.containsKey(group.getName()))
continue;
user.data().remove(Node.builder("group." + group.getName()).build());
user.data().add(Node.builder("group." + group.getName())
.withContext(DefaultContextKeys.SERVER_KEY, map.get(group.getName()))
.build());
}
});
}```
just write this
currently testing.
looks like didn't worked
here you are
You need to remove the group node
looks like theres a inheritancenode
That’s the one
and, "group." is needed?
And you should use that to add them to a group as well
Not if you use an inheritance node
Thanks ^^
You’re welcome
How do I get all the nodes of a player's primary group?
Well you get the primary group of the player and then get all the group's nodes
This returns String
Then use the groupmanager to get group object...?
Ok got it thanks
You're welcome
@rugged hedge could hello help me to configure MyQL?
Hey GabeGkOFC! Please don't tag helpful/staff members directly.
Deen could hello help me to configure MyQL?
Api related?
As well ?
Ask in #general please
Oh well
How is this related to the developer API? I fail to see that
I'm the last person anyone should ping over sql configuration lol
Api related?
Please ask your question directly
where in the luckperms code would this class be? me.lucko.luckperms.lib.adventure.text.serializer.bungeecord.SelfSerializable$AdapterFactory.create
it's from a dependency downloaded and relocated at runtime, it isn't bundled in the core jar
..... if you are having an issue or getting an error.. paste it lol
have posted it before, couldnt get an answer, here it is anyways https://hastebin.com/uyidafehin.md
right..... I think I remember? it only did that with your plugin installed too?
Is there a way to get everyone with x group?
yes
How?
lemme uuh
And for the NodeMatcher you'd want to match an InheritanceNode (presumably by key only)
https://cdn.vertcode.eu/png/o72xk
This as NodeMatcher?
Simpler yet: NodeMatcher.key(InheritanceNode.builder("vip-idk").build())
aah thy 🙂
I'm trying to run LP v5.2.44 in my dev environment with SpongeForge and LP is throwing a java.lang.NoClassDefFoundError error during FMLPreInitializationEvent and not loading. Full error: https://pastebin.com/raw/Zs7DZWTU
Could anyone help with this?
The paste link you sent in is invalid or expired, please check the link or paste a new one.
Sorry Clippy, try this one: https://pastebin.com/Zs7DZWTU
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
!libsdir
LuckPerms requires several libraries in order to operate. If you're getting a startup error such as NoClassDefFoundError, ClassNotFoundException or "Unable to load dependency...", stop your server, delete the /plugins/LuckPerms/libs/ directory and start it up again.
Sorry, I should have said that first; I did delete the /luckperms/libs/ directory (I don't believe there is a /plugins/ with SpongeForge) and restart the server and am still getting the error :/

Send startup log in #general 1 or 2
Ok, I just put it in #support-1
?
I need help! I installed EssentialsX Chat (latest update), Vault and LuckPerms but prefix dosen't work
Hi just a question, have there been any breaking API changes within the last weeks/months, for adding and removing group notes. Just wanna resolve an issue report and remove possibilities.
nope
You can either take my word for granted or go see the changelogs in the commits history which I suggest you do instead lol
Na, your word is enough, just got resolved, had nothing to do with LP ... I knew it
Sorry for anoy...
no worries!!
Thanks of course
How do i check if a player has a perm using luckperms api?
Sorry, player is offline and it's bungee
Learn how to use the LuckPerms API in your project.
Wait
!coobkook Might have a example
Sorry! I do not understand the command !coobkook
Type !help for a list of commands.
Just what code to check it?
!cookbook
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
Well
I have a question
If player never joined before
It can still fetch the perms?
Should yes not sure

If loadUser "loads" anything, it'll only have the default group as parent
Well, since you can use UUIDs in commands I would assume it would work like that?
what is the bungee dependency?
Whut?
!api
Learn how to use the LuckPerms API in your project.
there is only for bukkit
public static LuckPerms lpapi = LuckPermsProvider.get();
I get an error
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at net.md_5.bungee.api.plugin.PluginManager.enablePlugin(PluginManager.java:328)
at net.md_5.bungee.api.plugin.PluginManager.loadPlugins(PluginManager.java:235)
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:271)
at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
Caused by: java.lang.IllegalStateException: The LuckPerms API is not loaded.
at net.luckperms.api.LuckPermsProvider.get(LuckPermsProvider.java:50)
at me.bluetree.razeempire.Bungee.Main.<clinit>(Main.java:22)```
Add lp as depend or soft depend
it's bungee
did you add LP as a dependency in your bungee.yml/plugin.yml?
try softdepends instead of softdepend
same error
What did u put in it
LuckPerms
Whole Thing
just share the entire plugin.yml
softdepends: ["LuckPerms"]
`name: RazeEmpire
version: no version
main: me.bluetree.razeempire.Bungee.Main
author: BlueTree
softdepends: ["LuckPerms"]`
ngl bungee.yml sucks ass
same error
also, how are you managing your dependencies? maven? gradle? "external libraries"?
maven
hm
Open the jar and send the plugin.yml
it's static
Static loads it at runtime doesnt it? (Before lp loads)
then, how to get user perms from other classes?
it loads before LuckPerms
every plugin's main class is initialized even before their constructors are called
way before onEnable
and the LP API object is available since onEnable
it being static doesn't have anything to do with when you initialize it
just call LuckPermsProvider.get inside onEnable
fixed
coolio
java.lang.NullPointerException
User onlineUser = Main.lpapi.getUserManager().getUser(p.getName());
this is null it seems
this is when player is logging in
https://paste.helpch.at/ share your plugin main class and the one that is calling that method
uhm..... there is no player object to get on PreLoginEvent
it's before they log in
so the ProxiedPlayer object is null

Can't you use login or join event?
JoinEvent no
why not
I want player kicked before joining
Login then
PostLoginEvent?
will this work?
Try and see
uhm.... you do realize you can load the LP User object without the need of a ProxiedPlayer
right?
just UserManager::loadUser(uuid)
if it's explicitly set, yes
it will only return the nodes that are set
either to true or false
I want to check if it contains it and it is true
CompletableFuture<User> userLoadTask = Main.lpapi.getUserManager().loadUser(e.getConnection().getUniqueId());
this is null
how?
Q: with the api, that is the event called when a parent is added to a user?
NodeAddEvent
its not null
Only if the player never joined before
Well is it null or is the code throwing a NullPointeeException? Huge difference
@crystal sonnet it throws a NPE
Well that means something returns null that shouldn’t you need to find out what
Use the async join event with a normal priority and then LP has the user loaded
Well
I dont want JoinEvent
I want it before player logs in
Because it will kick him if he is not staff and maintaince is on
That’s before the player logs in
Again. Use the async login event
Or join event
*async join event
Only one of those exists
That is the right one
And how to check if the user has perms after it?
At that point permission data is loaded
Also, does bungee load the ProxiedPlayer when AsyncLoginEvent?
LP loads the user on loginevent priority low
What platform are you making that plugin for?
Bungee ^
Yes Bungee
Well then the login event is right
As bungee has no async event
But yes the data has been loaded at that point
And people telling you wrong information based on assumptions they made because you didn’t even mention what platform you’re using is 100% on you
How to fetch nodes after the loginEvent?
Can't you just use ProxiedPlayer#hasPermission?
Yes he can
You can get it from the event
Get connection, get uuid?
Then?
Then use luckperms to check
That is what i am doing
Do i need to load the user?
Dont think so but you can if you want
!paste log then
Seeing a paste of the problem makes everything so much easier! Use https://bytebin.lucko.me/ for easy pasting!
Pastebin any relevant segments of the console log. If it's a startup error, this includes the entire startup log!
Pastebin the entire LuckPerms config file (passwords removed) as well as any other relevant files!
How do i get the user by the name?
the player / user object should have a getName method?
you dont need lp api to get the user name tho
No, how to get the nodes from the begging?
Get nodes or check if they have a permission?
actually right, what is your end goal?
Nodes contains the perms..
Checking if player is staff while they didnt join yet
LoginEvent
Yes
Get the connection
From that get their uuid
Then load/get the user using LP api
Then check if they have the permission
How to get the connection?
....
Please, i am new
event.getConnection()
^^
How to load the user and check if they have perms?
!api
Learn how to use the LuckPerms API in your project.
you know you dont need lp api to check if player has permissions right
PROXIEDPLAYER IS NULL
Another LoginEvent?
There are a few for different stages during login. Yes
I don’t know by heart
You have to look yourself
Just take a look at the Javadocs
@crystal sonnet PreLoginEvent okay?
https://github.com/SpigotMC/BungeeCord/blob/master/api/src/main/java/net/md_5/bungee/api/event/PostLoginEvent.java is the first event with a proxied player.
Thanks Luck!
Weirdly enough, LuckPermsProvider.get() is throwing an exception even though it's being called after LuckPerms is loaded (I know this since this is called when running a command, so there is no reason why it shouldn't be loaded)
LuckPerms: v5.2.47 on Bungeecord
Paste code in a hastebin
The best I can do is send a Github repo, though I will warn that the code is very confusing and the order is pretty bad. Anyways, here you go:
https://github.com/Fernthedev/global-prefix-approval/blob/2deb1e081f1f749ba495445df1a1cec568642e59/src/main/java/com/github/fernthedev/gprefix/bungee/hooks/LuckPermsPrefixHandler.java#L24
Hope that suffices, lemme know if it doesn't
Whats the error you get?
The "LuckPerms API has not been loaded" exception, as expected when calling it before it has loaded
however that is not the case atm
What version of LP is on the server?
Yeah I noticed now
I was about to give it a try, thanks though :D
Just to make sure, getUser(uuid) works for only online users or does it work for offline users as well?
Should I always load or check if offline then load?
just loading works fine
How do i get the colored meta name of a Group? Group#displayName returns null and Group#friendlyName returns a basic string with no capitalization or coloring. Please help!
You mean the prefix?
Because the group's displayname isn't the prefix
This is basically it, but instead of loading a user with the user manager you.. load a group with the group manager, that's the only difference https://github.com/LuckPerms/api-cookbook/blob/master/src/main/java/me/lucko/lpcookbook/commands/GetOfflinePrefixCommand.java#L59-L71
Thanks
Hmm, seems to throw a no method exception (i decided user prefix was what i was looking for rather than "group" prefix)
java.lang.NoSuchMethodError: 'net.luckperms.api.cacheddata.CachedMetaData net.luckperms.api.cacheddata.CachedDataManager.getMetaData()'
at com.elytraforce.bungeesuite.localchat.model.ChatPlayer.getOnlineGroupName(ChatPlayer.java:52) ~[?:?]```
(running bungee)
nvm as it would turn out running outdated versions of luckperms will lead to errors
Eyup that tends to happen
What is the right way to change an existing entry?
NodeMap groupData = lpGroup.data();
Node wscClanGroupID = MetaNode.builder(WSCclanGroupID, Integer.toString(group.getGroupID())).build();
Tristate isWSCclanGroupIDExisting = groupData.contains(wscClanGroupID, NodeEqualityPredicate.ONLY_KEY);
if (isWSCclanGroupIDExisting == Tristate.TRUE) {
// update wscClanGroupID ?
groupData.
} else { // UNDEFINED
// add wscClanGroupID !
groupData.add(wscClanGroupID);
}
Find and delete the existing Node or is there a way to change it?
remove the existing one and add the new one
also, keep in mind that ONLY_KEY refers to the entire node's key, not the meta key (in the case of a MetaNode it would be the entire meta node "string")
so all MetaNodes not only my WSCclanGroupID ?
no, you remove the existing one for WSCclanGroupID and add the new one
Nodes are immutable, so you can't "modify" them or "replace" them
Replace is basically just remove and add
ok thanks
Basicly this way?
Node wscClanGroupID = MetaNode.builder(WSCclanGroupID, Integer.toString(group.getGroupID())).build();
groupData.clear(node -> node.equals(wscClanGroupID, NodeEqualityPredicate.ONLY_KEY));
groupData.add(wscClanGroupID);
also, keep in mind that ONLY_KEY refers to the entire node's key, not the meta key (in the case of a MetaNode it would be the entire meta node "string")
what does NodeMap#clear take as argument?
/**
* Clears any nodes which pass the predicate.
*
* @param test the predicate to test for nodes which should be removed
*/
void clear(@NonNull Predicate<? super Node> test);
Thanks you
Yay, it works ❤️
Is there a way i could check what the expiration milliseconds are on a temporary group applied to a user?
Yes
LuckPerms.getApi().getUser(player.getUniqueId()).getTemporaryPermissionNodes() by chance?
Yes. Then filter for inheritance nodes and you’re golden
😮 ty!
You’re welcome
we're running old 😛
I can tell...
5.2.49
Yeh. Pixelmon is on 1.12.2 though
Yeah. I brought it up to the guy that has it like that, but guess it breaks some stuff
think he has some mixins for it or something
but yeah, i agree lmao
lmao
In all honesty
The only thing I can think off that could even remotely require a mixin would be getting the forge permissions API to work with LP
Well the actual solution to that is using an up to date Sponge version. Because that was added about a year ago
Yeah im not relatively sure what exactly he does with LP
Awful things
I can only imagine.
I’d almost be willing to bet money that whatever he’s doing has long been added to either sponge or LP
In any case you should ask what on earth he is doing with Mixins
lemme ask for ya
And if you know feel free to let me know. I can let you know if it’s necessary or if there is a better way
As 9/10 times there is a better way
cause i build core around the old lp
and updating it will be a nightmare
no mixins i suppose
If updating the API is a night mate then boy must that code suck
It’s such a straightforward process
And hell
hes nto wrong
problem is i do most of my shit with mixins rather than via the api
If needed there’s an extension that will add APIv4 support to LP5
Find a new server. Abandon ship
Any issues related to that are self inflicted and totally unnecessary
yea, i think he can handle anything that does decide to come up for him though
Frankly interfacing with a plugin through Mixins is so much harder and more time consuming than just using the API
It’s like competing in a car race but instead of using a car you decide to walk and drag a ship anchor with your neck
Great! Good luck finding a new server
Thanks for the nightmares. That’s by far the worst thing I’ve heard all year
I’m done
using mixins is actually faster in a closed env instruction wise than using the api (nanoseconds but it makes a difference when making thousands of calls)
So a few ms are worth your sanity?
its a closed enviroment
the base for the mixins is the same mod that every plugin has access to
just casting to an accessor is much easier than you think
Well now you’re stuck with an outdated version that has lost the editor and has known security issues
Congrats
Certainly worth it
security issues we fix intenally
editor im self hosting

not that big of an issue
and yeah been a while larry :p
JFC

This is anything but ok
On so so so so so many levels
Like in all honesty
Did you benchmark it?
per basic commands its on average 300ns slower however for internal lookups which we do allot its on average 15-20ns faster
Ok. How many thousand lookups per second do you do?
depends on the queries request size and playercount at that time (*41 servers)
I mean server count has no impact on the calls to LP
Absolutely
But in any case. When ns are significant just use an internal cache
And I mean you do know that LP 5 had some significant performance improvements, right?
Regarding the cache:
GriefPrevention/GreifDefender does so many lookups that it tanks performance. So their solution was to use internal caches. Which gained significantly more time than any direct accessor through a Mixin ever could
prob true however its not a priority to update as it stands prob will in the future but meh for now
Utter insanity
hey, be nice :p
hes not wrong lol
it was a working fix then, and if it works it works. don't see the huge deal with it being harder to do or not working the utter best way
I’d rather be forced to work with Node for the rest of my life than to touch that code base with a stick
So I’m being as nice as I can be
This is by faaaar the utterly worst and most insane way possible
This is far beyond “it works”
Oh and @obtuse scroll the performance improvements for v5 were so significant that GD had a few test builds with their internal cache disabled.
But they decided to keep it because it’s still faster
But no longer needed
That’s a hole you dug yourself in. Good luck getting out of it
not so much a hole
would prob take maybe 3 hours to update the internals the rest of the core can work around the change without issue
just a matter of doing it
If you’re tasking other devs to interface with LP you should
The new API is significantly better
also out of curiosity what is the lowest spongeversion support by v5?
it support 7.0.4 still or 7.3+?

do any one know how i can let people with out OP do different commands as i have chosen?
With the api?
sry i wrote i wrong chat
how do i have ppl join a group i cant get my friend in a group because idk how.
you are coding a plugin?
i made a group and idk how to inv ppl

me again...
var optionalMetaNode = group.getNodes(NodeType.META).stream().filter(NodeMatcher.metaKey(LuckPermsMetaKeys.WSCclanGroupID)).findAny(); // No result
var optionalMetaNode = group.getNodes(NodeType.META).stream().filter(node -> LuckPermsMetaKeys.WSCclanGroupID.equals(node.getMetaKey())).findAny(); // one result
I thought that should return both the same result?
LuckPermsMetaKeys.WSCclanGroupID = "WSCclanGroupID"
welp, LuckPermsMetaKeys.WSCclanGroupID.equals(node.getMetaKey()) is case sensitive that's for sure
I wonder what NodeMatcher.metaKey(LuckPermsMetaKeys.WSCclanGroupID) does bts
uuh yeah this is no surprise it's like that
@river lance could you run /lp export --upload and send me the code so I can test it on the same dataset as yours?
Hola, alguien español/spanish?¿
o i speak inglish?
Hola si 
O no
xd
es que tengo un problema
y para que se que es pero no
xd
no se si es no cheat plus o luckperms
a si que estoy viendo
?? me parece que #support-1 es un canal más apto a menos que tenga que ver con la API
ehhh
vale
es que general
no es de soporte
entonces como no vi
un canal de soporte
vine aqui
no vi la descripcion xd
ok
gracias
Hallo, was ist denn hier los!
What?
Speak english dammit
Does someone know why adding a permission to a group doesn't actually save it?
are you saving the group?
is neat
Indeed it is
Fefo any new Idea with the metanode matcher over the night ?
didn't test yet
Ok..
Is it there directly link to a blog/page that talk about luckperms dependency manager?
No. Internals typically don’t have a page
Hey,
I pasted the code to Obtaining an instance of the api in my class, but I get following error. What can I do to repair this error?
Also, light theme
That is 100% part of the problem 
in the first line?
the first line in that image, yes
thx
then i had to add an ; { at the end of the first line and a } after that whole thing from the website

uuh you don't need to add those braces
if I remove them, everything there is red
screenshot the entire thing please
Yeah the whole snippet from the website has to be inside your onEnable
then i get this error
Whole ss
oooookay
Java 101
@river lance yep, seems to be a bug
probably something to do with the case sensitivity, Luck will know :d
yep, this is 100% to do with case sensitivity hah
Update: filed an issue on GitHub https://github.com/lucko/LuckPerms/issues/2760
when it output code as messages
how do you do that tho

lol no
Yay, thanks for testing 😁

anyideas how to fix this https://prnt.sc/vz95k3
since 5.0 ive got confused i knew how too use 4.0 but not new one
did you just update the dependency and none of the code?
i have but the dev api i dont know how to get Use Lp as im using bungeecord its a bungeecord plugin and it doesnt like it for some reason
!bungee
If you run a Bungeecord network, learn how to correctly setup LuckPerms on all server instances (including Bungee).
Syncing data between servers
Learn how to use the LuckPerms API in your project.
ignore the !bungee lol
I would like to know how I can pull players from just one group and show them in the chat to whoever performs the command.
Any example of how I could do it?
Not for that method exactly, but you can check some general API usage examples
!cookbook
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
!api might want to give the first two pages a read too, I do suggest it
Learn how to use the LuckPerms API in your project.
Thanks.
Hi !
LuckPermsProvider.get().getUserManager().modifyUser(target.getUniqueId(),
user -> user.data().add(Node.builder("essentials.fly")
.withContext("modifier", "accumulate")
.expiry(min, TimeUnit.MINUTES).build()));
Is this how you add the modifier "accumulate"?
No, the temporary modifier is not a node context
Iirc the NodeMap#add method takes an argument for that behavior
!javadoc
Learn how to use the LuckPerms API in your project.
Thanks !
hey luck, where did you get that solution: https://github.com/lucko/LuckPerms/commit/8a38c5f4b72cf610c49bff5a3fef5f8752921c6b?
just interested where did you read this out
hidden in a stackoverflow thread
there's a lot of other bs on that question, idk why that one isn't the accepted answer
Im using the dev api for chat formatting for my server, and i want to use node metadata to mark prefixes as staff or not so in certain situations itll show the highest-priority non-staff prefix instead of just the highest-priority. I got the api working to sort and filter by metadata, but now I dont know how to actually set the metadata for a prefix with commands/editor.
I dont know how to actually set the metadata for a prefix with commands/editor.
what

theres no command to set metadata for a node
like ingame
only metadata for a user/group
Nodes don't have metadata
but in the api it has metadata
Node#getMetadata
That's eccentric
?
Well give me a minute, I don't know the entirety of the API all the time lol
Thing is, what you're presenting are different things
User/group metadata are MetaNodes
yea
Node metadata is different
i know its different i was just saying for the commands
As far as I know you can't "access" the node metadata
But again I think you're mixing two different things
What are you trying to achieve
nope Im not referring to the group and user metadata. i know its nodes for those.
Im trying to put metadata on prefix nodes
like actual metadata
ok so ill have to write a command to do it in my plugin i guess?
You are guessing right
ok
There are heaps of stuff not accessible from commands tbh
Like transient nodes
That would be neat to have tbh
Whut are those?
Data which expires automatically at the end of a session. (when a user logs off)
This data is never saved to the backend storage provider.
Oh thats nice
those actually sound really useful....
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
Player player = (Player) commandSender;
Main.getInstance().args.put(player.getUniqueId(), strings[0]);
LuckPerms api = LuckPermsProvider.get();
Inventory inv = Bukkit.createInventory(null, 18, "§8Set Rank");
int i = 0;
for(Group groups : api.getGroupManager().getLoadedGroups()) {
if(groups.getDisplayName() != null) {
inv.setItem(i, new ItemBuilder(Material.WOOL).setName(ChatColor.translateAlternateColorCodes('&', groups.getDisplayName())).setLore("§8§m------------------------", "§8» §7Prefix: " + Objects.requireNonNull(groups.getCachedData().getMetaData().getPrefix()).replace('&', '§')).toItemStack());
i++;
}
}
player.openInventory(inv);
return false;
}``` hey so i have this code to show all my ranks in a menu but i would like to put the ranks in order depending on their weight. Someone knows how to do it ?
You can use streams to sort them
@onyx blade
yes
yea then you need to code the comparator, so java know how to sort it
unless the group object already implement Comparator interface, not sure about that
i never used stream so how can i code the comparator ?
there are plenty of online documentation of it
tbh, I hate to say but just google how to use them
Heya,
We made a disguise plugin which allows you to disguise as a player.
I'm using the luckperms API to get the uuid of a user by name, and to get (or load if get returns null) a user, and then we get his group by doing:
User user = ColdDisguise.getInstance().getLuckPermsAPI().getUserManager().getUser(uuid);
This does in this case not return null, and if it doesn't return null I'm seeing what his primarygroup is (for now just a simple sys out):
System.out.println(user.getPrimaryGroup());
But when doing this it sometimes gives this error:
12.12 15:57:22 [Server] WARN java.lang.NullPointerException: value
12.12 15:57:22 [Server] WARN at java.util.Objects.requireNonNull(Objects.java:228)
12.12 15:57:22 [Server] WARN at me.lucko.luckperms.common.api.implementation.ApiUser.getPrimaryGroup(ApiUser.java:75)
12.12 15:57:22 [Server] WARN at me.nick.colddisguise.command.DisguiseCommand.lambda$setMetadata$2(DisguiseCommand.java:102)
to get (or load if get returns null) a user
Why not just load it? If it's already loaded it'll return it immediately
You don't want to load a user if he's already loaded I think
It sounds naughty
But you're saying that's completely fine?
So the get method is only if you're sure the player is online or something?
hello
I guess yeah, or maybe in a situation for example in an event where you can't wait for the data to be loaded so you just get it, if it's null you yeet
I got the player prefix using the API, but the result was null
Show us the money
my code:
Use hastebin pls 😬
oh
ok
but my code is very small
package com.meddiproject.meddiproject;
import net.luckperms.api.LuckPerms;
import net.luckperms.api.model.user.User;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.RegisteredServiceProvider;
public class nick implements Listener {
@EventHandler
public void onClick(PlayerInteractAtEntityEvent e) {
Player p = e.getPlayer();
Player entity = (Player) e.getRightClicked();
RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
if (provider != null) {
LuckPerms api = provider.getProvider();
User user = api.getPlayerAdapter(Player.class).getUser(p);
String prefix = user.getCachedData().getMetaData().getPrefix();
if (entity.getType().equals(EntityType.PLAYER)) {
ItemStack inv = entity.getInventory().getHelmet();
String clickedName = entity.getName();
if (inv.getType() == Material.CARVED_PUMPKIN && inv.getItemMeta().getDisplayName().equals("Маска грабителя")) {
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatColor.MAGIC + prefix + clickedName));
} else {
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(prefix + clickedName));
}
}
}
}
}
prefix is null
result: null playername
pls help
pastebin - https://pastebin.com/F1m2i4wd
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Well do you have a prefix in the first place?
Seeing a screenshot makes everything so much easier!
/lp user <user> info.
Server console: /lp info | Proxy console: /lpb info.
sec
im find the error
return the player who clicked's prefix
but i need the entity
prefix
but where colors?
U need to convert colors urself
Thx for all!
The question is not about the LuckPerms API: how can I stop the execution of a scheluder in my code?
my code:
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Messages are repeated cyclically, but I only need to check the time in the world to do this
sounds like something for #general
scheduleSyncRepeatingTask is a Deprecated as well, unless you are using an old bukkit api
Will API work on BungeeCord Server?
yes
hey, is it possible to give a player an temporary permission which just counts when the player is online?
thanks
wait isn't that the transient permission node stuff you were talking about, fefo
or am i misunderstanding
No, what they were asking is basically a temp node that only counts time when the user is online. Thing is, temp nodes aren't based on time, but on an expiration date
aaah i took what he said to mean that it only counts as true when they're online
by the way is there a spot in the wiki for transient nodes
i actually may have a use for them somewhere but i don't know where to even start learning about them 😦
"learning"? 
They are just like any regular permission but aren't saved to storage
Just add a transient perm node on user join. Can't you do that?
Yesn't, there still has to be a system in place to remove it after some time online
And for that matter you can just use a normal node 
Ah sorry I thought cerexus meant a node that is only added to the user when they join, and stays added to that user until they disconnect.
oooooh so they're just normal perms but you just don't save them?
How can I set user prefix ?
!cookbook
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
if you reset their prefix then it'll show the prefix from whichever group they're already in
so how can I set their prefix to group one
hello
this is again i
ny code doesn't work
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I think the problem is in "if(prefix == null)
pls help me
send the error @hollow yew
@hollow yew what's happening?
Like it's hard trying to debug code without knowing what's happening when you run it
how is it not working...? I suggest you start putting debug messages and see the output at various points of your code...
when I click on a player with the right mouse button the message is not displayed
Try to debug it with either a debugger or debug print statements @hollow yew
how do i listen for a user group change
NodeAddEvent i think?
ill try with NodeMutateEvent
not that one D:
NodeMutateEvent is not a callable event per se, it's just an interface for NodeAddEvent and NodeRemoveEvent (and I think NodeClearEvent?), and those are callable events
"group change" is just remove then add, so yeah you're wanting to listen to NodeAddEvent
how do I check if the added node is a group one
Check that the node type is of type INHERITANCE
!cookbook
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
those two questions were literally my first ones when I came into this channel lmao
Yeah the user UUID
thats what I need :)
this is what I have in my onEnable https://hasteb.in/ogatifix.kotlin
and i get a class cast exception right when I call searchAll
@nocturne elbow any idea?
Hey MrIvanPlays! Please don't tag helpful/staff members directly.
@frank drift can u please shut up
line 57 is exactly .searchAll(?
tbh I suggest you make methods for those lambdas and reference the methods instead
ok
i.e. put the code they do in a separate method that takes as argument what the lambda takes and the return value what it would return
will prolly make it easier to debug
yes i know
i have a lot of experience but i never had anything like that before
literally the same
doesn't even reference the method
wdym?
lol I should have read the error sooner, by the looks of it a regular Predicate won't do, you have to use a NodeMatcher
class [lambda blah blah] cannot be cast to class blah.blah.ConstraintNodeMatcher
oh so i need to force it to create a NodeMatcher
i can probably guess
yet another jvm optimisation
you know the jvm sometimes optimises
LP expects a NodeMatcher
inlining and stuff
yeah ik but why does the jvm try to use a predicate
it's not clear I admit, but those methods require you to use one of the matchers returned by the static methods in NodeMatcher
you can't create your own
(this is because under the hood these get converted into sql queries)
Hey MrIvanPlays! Please don't tag helpful/staff members directly.
you just pass NodeMatcher.key(InheritanceNode.builder(...))
instead of your predicate
aha smart boi
LP can then convert that into an SQL query: WHERE perm == "group.whatever"
but it can't if you just give a lambda :p
yeah then the process would be much slower
well yeah, would require loading the entire db into memory
which would be bad
there ya go - intellij ides will give a warning if someone else tries to do the same in future :))
hey, how can i set the parent group with the api and call a network sync?
Should be this or? User u = MineconomyWorld.luckPerms.getUserManager().getUser(p.getUniqueId()); u.setPrimaryGroup("test"); MineconomyWorld.luckPerms.getUserManager().saveUser(u);
!cookbook has examples, you also need to add the group itself not just set primary
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
!api
Learn how to use the LuckPerms API in your project.
so my code is wrong?
The primary group is pretty much irrelevant and only matters for things like Vault
By default it's the parent group with highest weight
What you want is to clear all the user's nodes of type INHERITANCE and then add the one you want (since users can have more than one parent group)
so i did that now `// Remove all other inherited groups the user had before.
user.data().clear(NodeType.INHERITANCE::matches);
// Create a node to add to the player.
Node node = InheritanceNode.builder(group).build();`
but the player is still in default group too
but i dont want that

