#luckperms-api
1 messages · Page 24 of 1
After you set the vip rank for 7 days and it runs out, if they don't have any other groups they just go back in default group anyway
Yes, they back in default when the user disconnect and connect
So what are you wanting to check?
Or what are you trying to do exactly.
ok i have the anwser: https://github.com/lucko/LuckPerms/issues/982
How can I get if player has permission with API of luckperms 5
!api pretty sure it's on here @steel edge:
Learn how to use the LuckPerms API in your project.
Have you tried asking in the right channel? @nocturne elbow
Learn how to use the LuckPerms API in your project.
Load the user and work with it like normal @nocturne elbow
You're welcome
Hello I use server.pro and the support says everything is set up but the prefixes don’t show up only [defualt] the prefix won’t change
@unreal mantle
Hey Lincoln! Please don't tag staff members.
!faq @idle drum read this:
Check out some of our frequently asked questions.
Prefix part
How I can get a group prefix, and detect if the group have a prefix?
!api @surreal comet pretty sure it's on the wiki, under usage
Learn how to use the LuckPerms API in your project.
I found, but don't know what QyerryOption to use to get the right metaData to get the prefix
nvm
java.lang.ClassCastException: me.lucko.luckperms.common.api.implementation.ApiGroup cannot be cast to org.bukkit.entity.Player
Group group = luckPerms.getGroupManager().getGroup(database.getLevel(player.getUniqueId()));
assert group != null;
QueryOptions queryOptions = luckPerms.getContextManager().getQueryOptions(group);
CachedMetaData metaData = group.getCachedData().getMetaData(queryOptions);
String groupName = metaData.getPrefix() == null ? group.getName() : metaData.getPrefix();
ping me
@surreal comet you can’t get query options for a group
Only for a player
Or the server
Hello, i use luck perms and my prefixes arent showing still. I contacted support via server.pro and they said everything on my side was correct but, some issue with luck perms. My prefixes don't want to show up. Could someone help me?
Btw it’s best to get the players prefix
@idle drum #support-1
Not the group’s prefix
i cant seem to be able to give permissions to my friend through luck perms here
No. The plugin shows the group prefix
I want to show under player name on the gui what group he gets when he is staff
So the playr can not have the group, or can have it
ok
Tanks
Tomorrow I'll take a better look
@idle drum how did you fix prefixes?
I fixed them using a different chat plugin
Instead of using essentials I use essentialsx chat @thorny tangle
ok then it wont work for me :/
Why
cuz i use essentialsx
Ok and your using the command /lp group (group) meta addprefix “(prefix)”
With the quotes
yes that's what i use
Ok then ask the admin they know everything
@azure latch i'm on forge :p
Hey guys lpapi.getUserManager().lookupUsername(UUID.fromString(uuid)).get() return the name without check the case of the name (example, Flashback083 become flashback083), any way to fix this ?
Does forge have an equivalent class?
If LP doesn't work, you could try making a Mojang API call to get the username
i already does it
but if lp work i would like to get the good name :p
and if doesnt work then get the mojang call
Hay, how can I interrogate the group?
!api @nocturne elbow pretty sure it's here:
Learn how to use the LuckPerms API in your project.
How can I interrogate the group?
@dark dock have you looked under 'Example Usages' on the api wiki?
I can't cause idk enough to be of any value. When someone is available to, they will for sure
you're sure you don't want this: https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#finding-a-players-group
No i only will Interrogate in which group the player is
How can i directly check this?
if(getPlayerGroup("Admin") {
e.setFormat ..........
For example
Hey everyone! Im trying to get use of the LuckPerms api for my plugin . my plugin counts player online time and i want a cool chat prefix that displays at the begining of the chat mesasge like seen in the image attached, but one that isnt based off of a role, just set the user prefix and set their current playtime in hours in it, also have it display along with their staff rank, how would i acheve this? (Instead of saying noob it displays a number that is the users playtime on the server/ like a level)
is there a way i acn add meta and add a second prefix
right now im using the config to do prefix stacking, is there another way to achieve this?
i was told to just directly interact with my chat plugin of choice (chatex)
@plush laurel I can't see how the LP API would be the best way to achieve this - I'd say try and find another plugin which counts playtime and is compatible with PlaceholderAPI or another API system, and just add a formatted chat prefix (which displays the hours played) directly into Chatex without using LP at all. Unless you want to assign LP groups based off of playtime?
It's a system for plugins to register placeholders that can be displayed in other, PAPI-supporting plugins
wait, so like i could register a placeholder for %level% and it could just be added to the chatex format, like %prefix% or %suffix%?
yep
w o a h
not sure exactly how, but it's possible
#support-1 unless this has to do with the luckperms developer api
!api Check out the example usages:
Learn how to use the LuckPerms API in your project.
Hello! I have programmed a CaseOpening plugin. I want to give a player a permission via the plugin.
I have implemented LuckPerms and now I want to distribute permissions to a player via the API.
I have a problem I set your prefix to & 0 [& 4 & lO & 0] but my name sticks to the prefix HELP
Hello i have bungeecord luckperms and everything works great but the prefixes doesn't show :/ any idea why?
!faq @modern brook read the prefix part 😄 [edit: sorry for the ping, just saw your other message in g1]
Check out some of our frequently asked questions.
how would i get all the groups that exist and their names?
Someone that haves a nice /shop plugin to my skyblock server?
tag me if you have
or recommends a /shop plugin
is it on spigot or bukkit? @void bolt
so can i convert my permissionsex rankk to luckperms??
Yes, with "/lp migration permissionsex"
Although you shouldn't ask that in #luckperms-api
Do I have to "commit" change to the user's data or something? user.data().add/remove
It doesn't seem to be adding or removing anything.
Nvm.
Apparently I can't read.
I need help with this?
Just ask your question
@cursive rain that worked btw. ty for the help
Not sure why you pinged me in here for help that isn't api related but glad you solved your issue.
jeeze dude. I thought I was in off topic. I suck
Could the api be updated to support getting placeholders for offline players?
@dire remnant the LP API supports offline players for ages
i just tried
papi parse me {offlineplayer} returns nothing
but for an online player it does
Yeah @crystal sonnet i just tried for an offline player then logged in and it suddenly worked
Hey Barnaby! Please don't tag staff members.
oops
If you have a question that's hasn't been answered, it's probably because we don't know :P
But Brain probably does and will answer when he can
Alrighty
Hey,
I dev a Spigot Plugin, and i want to test permission with inherits or none (like with the commande /lp user <pseudo> permission check|checkinherits permission)?
You could use the placeholder?
%luckperms_has_permission_<permission>%
if it returns "yes" they have it
My plugin has a option, is a bool this bool limit if check only the specified rank or the rank and the rank that greater than this rank
How can i do ?
Learn how to use the LuckPerms API in your project.
Hey guys, I am trying to demote a player when they die, for a certain event we are having soon.
When this code runs, I get the error "NOT_ON_TRACK", as the DemotionResult.
I have however checked if the player is indeed on the track; and it is.
Is there any faults in my code here?
Is the track called default?
Yep
papi parse me {offlineplayer} %luckperms_prefix% returns nothing
But it does for an online player
Can someone help because I was told it supports placeholders for offline players.
@crystal sonnet am i doing something wrong?
Hey Barnaby! Please don't tag staff members.
Hello, I have a problem with the prefixes that do not appear in the game I already have Essentials Chat as well as Vault
I'm using the bungeecord version
Edit : I Set add prefixes and suffixes true
@dire remnant Your using PAPI placeholders, I really don't see how this is a question for LP tbh, or is suitable for the dev channel. Go ask PAPI support.
No, PAPI is working absolutely fine
Based on what Barnaby is saying this looks like either an issue with LP or a misconfiguration on Barnaby's side
iirc, LP can't keep all offline users loaded, so you need to load the player before you try that
Papi implemented a feature so that on their extensions you can get the placeholders off offline players.
@rustic laurel is that correct
Hey Barnaby! Please don't tag staff members.
In the LuckPermsAPI (from bungeecord) what is the best way to check - if a player is offline, have they connected to the server before
Dude how many times is this feature going to be requested
i don't want any offline player info, just a Boolean yes/no to see if they have a group assigned (which they would have if they joined right, and won't if not found)?
Wouldn’t be possible until they implement offline players placeholders
!default @earnest ferry default group won't work like normal groups, all players that don't have a group will be in default when they join and then won't be when they leave
LuckPerms provides a group that every player is added to upon joining the server, called default. You can use multiple methods to change the default group or change the name of it.
Which supposedly they already have
@dire remnant open an issue on GitHub requesting it, see where it goes
Already done
Then if luck hasn't replied yet, all you can do is wait
If he has, there's your answer
It fluctuates between 0 and infinity
About a week tops, usually less though @dire remnant
Cheers kek
tbh it probably won't happen
LuckPerms is clearly specifically designed to only load player data when the player is online
No. There’s even specific methods in the API to load offline player data
Is there a limit on the size meta tags can be
But that won't happen on demand with PAPI, LP would have to load offline player data in advanced of PAPI calls, to ensure no database queries are run on the main thread
Which would mean essentially keeping offline player data eternally loaded – not something that's happening
If the plugin which requires the placeholders requested them in advance through the LP API it could work, but then the plugin wouldn't be able to rely on PAPI alone
Correct me if I'm wrong, I don't know if there are any PAPI methods which return CompletableFutures or allow for any sort of concurrent processing
That's a different story
!api Have a look here
Learn how to use the LuckPerms API in your project.
Thanks
Hey guys, I am trying to demote a player when they die, for a certain event we are having soon.
When this code runs, I get the error "NOT_ON_TRACK", as the DemotionResult.
I have however checked if the player is indeed on the track; and it is.
Is there any faults in my code here?
I have confirmed that the user in question is in fact on the 'default' track
Man I wish my codes looked like that. Wow
Is that good or bad lmao
Good
Well good looking code is useless if it doesn't work properly lmao
True true
I'd use the pattern of early termination
So instead of
if (condition1) {
// Do stuff
if (condition2) {
// Do more stuff
}
}
Use
if (!condition1) return;
// Do stuff
if (!condition2) return;
// Do more stuff
I see
Yeah, fair point
I'm still confused on the actual problem though, the user is in fact on the track, but I get the NOT_ON_TRACK when the event fires
I know why
Because let me guess, you have assigned them ranks of the group without a context, right?
Hmm, I actually only just migrated from PEX, after that I kinda just left it how it is
What context should I give it and where?
I've never really got the contexts much, I did take a look at the wiki, and ended up just doing this
Is that the static context you were talking about?
That's the current contexts the player has
Right.. and they don't have to do with the track does it
And in short contexts are restrictions on where or under what conditions a permission/nodes (group assignmets are just nodes) apply
I see
The thing is by default a group assignment on a track is in the global context
So if you pass any context the track looks for assignments of exactly the same context
Which there are of course none
Hmm, makes sense
Because the assigned group is assigned globally
So use the default context
Which defaults to the global context
I understand now, I'll give it a try and see if it works, thanks in advance!
You're welcome
Yep, that works! Thanks
You’re welcome
Wrong channel
Can I use context (i.e. servername) with the API?
what are you trying to do
Change tab name depending on meta tabprefix
But putting the context to i.e.
survival
Won't give me the new value if they're connected to survival
Cause the proxy =/= survival (the tab is handled on the proxy server)
Let me change my question
So
Can I pass a context (i.e. survival) to get the player meta from bungeecord
Hi
I am creating a Bungeecord plugin and I need to get the range prefix. Luckyperms IS NOT IN BUNGEECORD. It is connected via MYSQL. I understand that in order to obtain the prefix I have to connect my plugin to the luckyperms database. But in which table do I get the prefix of each range?
if you have phpMyAdmin, you can always take a look at the db yourself and infer some things
or check the LP source
i don't know if there's much documentation on this
@nocturne elbow of course you can
@balmy coral by installing LP on the bungee and using the API
@crystal sonnet could you provide me some kind of example/psudo example?
Hey Angery Nezuko! Please don't tag staff members.
Oh, I'm sorry for tagging
Learn how to use the LuckPerms API in your project.
how do i get luck perms prefix for bungee cord as coding a staff chat plugin trying to show their rankbut cant figure how to add a variable for that or how to get ir
!api @reef oasis
Learn how to use the LuckPerms API in your project.
Hey there,
So I'm using LuckPerms on my BungeeCord network. We've set it up so that a user only has their in-game ranks in that specific server. Right now, I'm working with the LuckPerms API on a Bungeecord plugin. But, when checking for their group/groups (which are only assigned to eg. "skyblock") it doesn't return (because it's checking for bungee or global permissions).
Is there a way to check if a user inherits a group that is not assigned to this server?
Tried this, but it returns as false even if the user inherits the group. (But on server=skyblock)
User user = api.getUserManager().getUser(player.getUniqueId());
if(user == null) return false;
return player.hasPermission("group." + rank);
}```
I don't know if that's the right explanation but I'd like to explain it more if needed.
@crystal sonnet ive looked at that it doesnt show how to do so
Hey DevKieran! Please don't tag staff members.
Yes it does
Check the usage page
@delicate marsh perform permission checks on the user
ok
@crystal sonnet how do i do that the best way?
Hey Gusuu! Please don't tag staff members.
oh sorry
Learn how to use the LuckPerms API in your project.
Allright, thanks
is there a feature to set a role to someone who joined a specific world?
when using i keep getting this any ideas https://pastebin.com/3pcZp5XR its running of a 1.8.8 network and latest bungeecord
Hey, how can I add someone to a group? ;D
!api
Learn how to use the LuckPerms API in your project.
Does anyone know when bungeeNPC is going to update to 1.15.2? and do they have a discord
ENGLISH?
@modest rivet Stop with the "SPANISH", please, we've already discussed this, and you're perfectly able to use a translator and not keep sending that.
Hey XxSr_DogexX! Please don't tag staff members.
Hello there, have a question.
I'm trying to use the luckpermsapi, so far i have a registeredprovider instance of the plugin in my project. Was wondering how i would check if a certain offline player has a certain permission node?
!api
Learn how to use the LuckPerms API in your project.
thanks a lot for the response!
You’re welcome
Hi guys, I have 2 plugins which the permissions aren`t found in editor , What i need to do or is something there?
The perms in the editor are just cached (meaning they have already been checked)
cached per server or world wide
Hello, how can i set a user in a group for example for a week?
Yes, with /lp user <user> parent addtemp <group> 1w
Hi, I read something about doing things with API with offline players. But I still get errors. Can it be because I am calling it in onDisable method? Make it some difference?
!api @jovial breach
Learn how to use the LuckPerms API in your project.
You can set the expiry in the node builder
@uncut onyx What errors are you getting?
And why do I need to ask for them?
I mean it should be abundantly clear that I can't see your screen, so I have no idea what on earth you are doing
@crystal sonnet Is there any way to use luck perms on cracked server or online-mode=false
Hey Vodexsus! Please don't tag staff members.
Sorry, my bad, my question was primary if I can use luckperms API during onDisable. Here is error with code where it happend.
error
code
@uncut onyx full error
Having half the error message cut off is not helping
But thanks for including line numbers
I'm impressed by how many don't think of that
full error with some lines before
Yes the issue is that your plugin shuts down after LP
Make sure you have a softdepend on LP
(Or a dependency if LP is required)
Then LP should shut down after you
Thats weird because I have already had it as dependency
But this is plugin on bungeecord side so I am not sure if it works the same as spigot does
@uncut onyx reach out to the bungee devs and ask them how you can make sure that your plugin shuts down before LP
Ok, thanks for your time.
You're welcome
if i create a method that returns one of the CompletableFuture<Boolean> from the plugin in a sync task, when someone runs a command
and i call a .get() on that method to wait for the result
will that block the whole server or only that command?
Depends on if the command runs sync or async
running it sync is bad right?
Running it sync will cause the server to lock up until you have the result
So yes
That is bad
hmm but if i put the whole command method in a bukkitrunnable, that makes it async i guess
but i can't send messages to players in an async task right?
if i remember
just general bukkit calls
This node with is new for me
How can i just add a player to a group which will then go away after a week again 🙂
figured it out, thanks for the help!
@jovial breach I linked you two pages
One of them explains it in detail
@grim flame how'd you do it?
So INHERITANCE is used for groups?
Yes
well i have an execute method for the command, i put the whole logic in a new async runnable and called the bukkit api in new sync tasks
But that sounds about right
yeah my head went boom but i figured it out 😄
👍🏼
@nocturne elbow #support-1
Sorry I moved it after I realised
How can I get a user's parent groups?
!api
Learn how to use the LuckPerms API in your project.
Learn how to use the LuckPerms API in your project.
im looking at that pages over a hour
then already looked javadocs
I want to get list of player's parent group
not a check that player is in group.
Get the nodes active in their current context and filter for enabled parent nodes
Stream api from java8 is the way to go
Yes
so you say, loop every parent for one player's parent group?
No
get the user's nodes, search for enabled parent nodes, done
Streams are magic
so is this okey? ``` StringBuilder sb = new StringBuilder();
for (Node node : user.getNodes()) {
Group group = luckPerms.getGroupManager().getGroup(node.getKey().replace("group.", ""));
if (group != null) {
String s = group.getDisplayName() + " ";
sb.append(s);
}
}
The use them
im asking for is it correct
I can't tell
here your lovely stream + collectors
user.getNodes().stream().map(node -> luckPerms.getGroupManager().getGroup(node.getKey().replace("group.", ""))).filter(Objects::nonNull).map(group -> group.getDisplayName() + " ").collect(Collectors.joining())
got it
so stream().filter(NodeType.INHERITANCE::matches).map(NodeType.INHERITANCE::cast).map(InheritanceNode::getGroupName)
https://javadoc.io/static/net.luckperms/api/5.0/net/luckperms/api/node/NodeType.html#matches-net.luckperms.api.node.Node-
@crystal sonnet thanks but, this one helped.
Hey kingOf0!! Please don't tag staff members.
You're welcome
thanks for the fast support is there a way someone can walk me through what he said though?
!editor you add the node in the editor
LuckPerms offers an easy to use, powerful Web Editor, with which you can add, delete and change permissions of groups and players.
ok thanks
@rustic laurel i am the stupidist 3 fingered kid in the planet (im really not 3 fingered) but it still doesnt work I added a higher priority and nothing still works could it be essentials chat?
Hey 3 Finger Kid! Please don't tag staff members.
!faq make sure to check the prefix part out here:
Check out some of our frequently asked questions.
thanks for the fast support is there a way someone can walk me through what he said though?
oh haha that was me
@harsh coral can you check /lp user <playername> info if the prefix is correct for this command's output?
thanks for the help guys IM SUCH AN IDIOT and realized i didnt have vault HAHAHA and you need that for it to work :((
How do i learn what a node holds?
node.getKey just holds a string
but how do i find out what that string will hold
does it hold the permission name?
What method do I need to use to get a user's current group/place in track?
!api I think it's on here somewhere
Learn how to use the LuckPerms API in your project.
@serene haven yes that’s the permission
LuckPerms lp = new LuckPermsApiProvider(?);
What do i have to put at the question amrk ?
*mark
Hello so Im having a problem with this plugin, so i have the worldedit set as true, so it'll work for a rank but it doesnt work. Same with another command
@stoic sail #support-1 unless this has to do with the API. The command you're running is not the right command, try lp group <group> permission set <permission>
Sorry I just joined and the discord is very confusing to me.
What's confusing about it? @stoic sail
I thought that general wasnt for helping cause of the chat name
That's why channels have a description
yeah but the name and categlory didnt help. It wouldnt be my first guess when I first join to go to general.
I wrote this method to check for a user's permissions on bungee, it keeps coming up with false even though the user's group has the permission set as true:
public CompletableFuture<Boolean> hasPermission(String permission) {
return Main.getLuckPermsAPI().getUserManager().loadUser(uuid)
.thenApplyAsync(user -> {
ContextManager contextManager = Main.getLuckPermsAPI().getContextManager();
ImmutableContextSet contextSet = contextManager.getContext(user).orElseGet(contextManager::getStaticContext);
CachedPermissionData permissionData = user.getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
System.out.println(permissionData.checkPermission(permission).asBoolean());
return permissionData.checkPermission(permission).asBoolean();
});
}
(ignore the sout, it's there for testing)
Can someone take a look at the logic for me please?
As soon as someone with the right knowledge is available, they will 🙂 I'd check it but I don't really know what I'm doing haha
haha, thanks dw
Hello o/
Where's the difference between user.data().add(node) and user.getNodes().add(node) ?
Thanks in regards 🙂
Hi how can i get all permissions added to a group with the luckpermsAPi
Hello, I have a problem with inherited groups where I want only one permission to be resolved from each group. So at each group I have added a new permission and made the node inherited from the previous group set to 'false' but my plugin still resolves the node that is false. How can I override the inherited permission, and prevent my plugin from resolving it.
So my group "Platinum" inherits from "Gold" and has matsuque.default.platinum true and matsuque.default.gold false, but my plugin still resolves matsuque.default.gold for players in that group, using the method resolveInheritedNodes(QueryOptions.defaultContextualOptions()
How can I stop the plugin from resolving the inherited node when it is false
vault's Permission class has method playerAddGroup(world, player, group)
what should I wrote there for global? -"GLOBAL" fixed.
@icy patrol filter false nodes
how i add permission to a player, in a spectify world/server
How can I do that using that method?
Hello my luckperms friends :)
Im using right now Nukkit (Bedrock Serversoftware) with Luckperms v5
And im developing on my plugin right now.
My Problem: I dont know how to give a temporary group to a user with the api. Already looked thru the wiki !
I just want to give a player a temporary group. Like... 3 Months. (Like this: /lp user NAME parent addtemp Premium 5mo)
My crap temp-solution: Do it via the cmd /lp user/group <user|group> parent addtemp <group> <duration> [temporary modifier] [context...]
i need help
With the developer API? ask here. With LP? #support-1. With non-LP? #general
Is there a way to get the servers current context?
With the API?
Check the ContextManager class
@spiral cedar
@hollow geyser node builds let you set an expiry
@icy patrol stream them and filter out the false ones
Can you explain me that like for dummies
*node builders
The API has node builders
That is explained in detail on the wiki
!api
Learn how to use the LuckPerms API in your project.
ok I will try
How can I filter the stream for negated nodes? I currently have ...stream().filter(NodeType.PERMISSION::matches)
Idea, thank you
java.lang.NoClassDefFoundError: net/luckperms/api/LuckPerms
at me.justugh.hopper.SCHoppers.onEnable(SCHoppers.java:36) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched.jar:git-PaperSpigot-"4c7641d"]
How do i stop the noclassdef error?
I'm trying to use the luckperms API rather than importing luckperms itself
probs because im trying to use api v5 when im using v4 lp
a more simple question
how do i get all of the nodes active on a player
I'm looking at the API which shows getDistinctNodes which only looks at the nodes on the user itself
what about the list containing their group permissions and user permissions
does that exist?
@serene haven
because im trying to use api v5 when im using v4 lp
Correct
The API was completely reworked between v4 and v5
is what im talking about resolveDistinctInheritedNotes?
ah so i gotta iterate through both myself
@serene haven what do you mean?
My plugin seems to be giving errors when trying to get permission data from users, it all worked fine before and I didn't update any plugins on the server. This is a bungeecord plugin fyi.
[22:21:28] [Netty Worker IO Thread #6/WARN]: Error dispatching event PermissionCheckEvent(sender=[removed username], permission=royalstaff.join, hasPermission=false) to listener me.lucko.luckperms.bungee.listeners.BungeePermissionCheckListener@58dea0a5
java.lang.IllegalStateException: No permissions data present for player: [removed username] - [removed uuid]
at me.lucko.luckperms.bungee.listeners.BungeePermissionCheckListener.onPlayerPermissionCheck(BungeePermissionCheckListener.java:65) ~[?:?]
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
at net.md_5.bungee.event.EventHandlerMethod.invoke(EventHandlerMethod.java:19) ~[FlameCord.jar:git:Travertine-Bootstrap:1.15-SNAPSHOT:9cdd70e:unknown]
at net.md_5.bungee.event.EventBus.post(EventBus.java:46) ~[FlameCord.jar:git:Travertine-Bootstrap:1.15-SNAPSHOT:9cdd70e:unknown]
at net.md_5.bungee.api.plugin.PluginManager.callEvent(PluginManager.java:384) ~[FlameCord.jar:git:Travertine-Bootstrap:1.15-SNAPSHOT:9cdd70e:unknown]
at net.md_5.bungee.UserConnection.hasPermission(UserConnection.java:504) ~[FlameCord.jar:git:Travertine-Bootstrap:1.15-SNAPSHOT:9cdd70e:unknown]
at space.guus.plugins.royalstaff.events.JoinEvent.onJoin(JoinEvent.java:25) ~[?:?]
Not using the API, but I don't think the other channels would be the correct ones. Just a player.hasPermission()
@delicate marsh check for previous errors (especially during startup). And this belongs in #support-1 (or 2)
Using the dev api? Or just in general?
With luckperms
That didn't answer the question
#support-1 (or 2)
?
This channel is for plugin devs working with the LuckPerms API
If you need help with using the plugin use one of the general channels
They are for LuckPerms support
how i add permission to a player, in a spectify world/server
!context @dusky wagon but #support-1 is the place to ask unless you mean with the dev api
You can set a permission or group on a per-world/per-server basis, through what we call "contexts".
Hello, can somebody explaint me how I can get the prefix / suffix from the group? I tried it with "getGroupManager().getGroup(user.getPrimaryGroup());" but there is only the "getDisplayName" method. Anybody can help m,e?
why not change the api to the following:
String prefix = LuckPerms.getApi().getUser(Player.getUniqueId()).getPrefix();
Much handier 🙂
Make a suggestion on the GitHub @uncut panther Luck might really appreciate it (also he loves PRs so if you're up to it and can do it yourself, and it makes the plugin better, he'd really appreciate it!)
@uncut panther Doesnt work. I think you are not using the newest API?
He's suggesting a change to the API...
oh lol, now i see it
@uncut panther API improvement suggestions go here: https://github.com/lucko/LuckPerms/issues/1926
I am making a plugin that allows users to be promoted along track.
The following error occurred.
`[07:07:25 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'promote' in plugin RankManager v0.1
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
(Omitted)
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
Caused by: java.lang.NullPointerException
at me.lucko.luckperms.common.model.Track.promote(Track.java:278) ~[?:?]
at me.lucko.luckperms.common.api.implementation.ApiTrack.promote(ApiTrack.java:94) ~[?:?]
at work.raru.spigot.rankmanager.commands.GroupUtils.promote(GroupUtils.java:27) ~[?:?]
at work.raru.spigot.rankmanager.commands.PromoteDemote.promote(PromoteDemote.java:78) ~[?:?]
at work.raru.spigot.rankmanager.commands.CommandManager.CommandExec(CommandManager.java:9) ~[?:?]
at work.raru.spigot.rankmanager.Main.onCommand(Main.java:71) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
... 15 moreHow can I solve this? The following is part of my source codeUser user = LPapi.getUserManager().getUser(UserUUID);
@Nullable
Track track = LPapi.getTrackManager().getTrack(trackName);
Main.logger.info(user.getUsername());
Main.logger.info(track.getName());
@NonNull PromotionResult result = track.promote(user, null); //row 27`
On the console, the track name and player name were correctly output
Use Google Translate
You obviously can't pass null for the context on line 27 @waxen yarrow
Use ContextManager#getDefaultContext
For that code, it only checks for the nodes attached to the user correct?
So if I want to check the user and the group I'd have to check both?
public static boolean hasPermission(User user, String permission) {
ContextManager contextManager = Main.getInstance().luckPerms.getContextManager();
ImmutableContextSet contextSet = contextManager.getContext(user).orElseGet(contextManager::getStaticContext);
CachedPermissionData userPermissionData = user.getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
CachedPermissionData groupPermissionData = Objects.requireNonNull(Main.getInstance().luckPerms.getGroupManager().getGroup(user.getPrimaryGroup())).getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
return userPermissionData.checkPermission(permission).asBoolean() || groupPermissionData.checkPermission(permission).asBoolean();
}```
That's my fix for it to check both
@serene haven no. The resolved methods include inheritance
But to check permissions, use User#getCachedData and use the checkPermission methods there directly
They include inheritance
!api @nocturne elbow look here
Learn how to use the LuckPerms API in your project.
The api works with bungee LuckPerms too?
If so, How I set the services manager on bungee?
Same way as bukkit?
Wait what?
[Ping me]
@surreal comet just use the singleton
How to get the prefix of a group specifying the players goup name? using api?
I can't follow you
Do you want the player's prefix (which includes prefixes from groups they inherit) or do you want a group's prefix?
group's prefix (check g1)
Are you sure you don't want the player's prefix?
99/100 cases when people ask for the group prefix they actually want the prefix the player has (including inherited ones)
to get the SERVER_KEY context of something, would I need LuckPerms API for this? Sponge API doesnt seem to offer SERVER_KEY
Can you elaborate?
Sorry
Some screens
I'm trying to add a permission to a Player. I'd like the context to be SERVER (the server they are currently on)
Sponge only offers these options under Context
I need SERVER_KEY as shown here
Was wondering if I have to depend on LP to get/set a permission with a SERVER_KEY
If the Sponge API doesn't offer it, you need to use the LP API
But be aware that you need to use completely for that
Like there's no Context Keys you can suddenly use
@crystal sonnet if my argument is for example "owner" I want it to return the prefix of he owner group
Hey TeAm6_AZLIK! Please don't tag staff members.
@lucid lodge Use the GroupManager to get the Group instance
And then get the prefix like normal
!api
Learn how to use the LuckPerms API in your project.
Check the javadocs that are linked on the first page
Use the GroupManager to get the Group instance``` that I have already done
but than I'm stuck
Get chached data and then get the prefix
Where in the LuckPerms's source code can I change the credit messages?
For what purpose?
Can't change this color the green and blue http://prntscr.com/s1bjqn
That's not the credit message, but ok
but where can I change it cause I can't change in lang.yml
BrainStone possible to help?
I don't know where to change it
Brain, do I need this? queryOptions
Yes
I can't find how I need to use this getMetaData
Like what argument does it need to have
hey guys who can configure my lucky perms.. all i need is for it add the prefix to the chat. im willing to pay..
hey does anyone know how to work the prefixes
Hi. Any bukkit/spigot discord server where I can ask some questions? This was the closest I could find. Anything official?
https://www.spigotmc.org/threads/official-spigotmc-discord-server-—-join-now.426794/ Spigot has a discord with iirc a dev channel
Perfect. Thank you.
@nocturne elbow what do you mean with “work the prefixes”?
yeah @nocturne elbow i cant get my prefixes working
my prefixes are showing the name of the world and not the prefixes i set
@nocturne elbow what chat formatting plugin are you using? Towny and Multiverse can both do that, what you need to do is pick a chat formatter and disable the chat formatting everywhere else, and use the correct placeholders to show prefixes. Also, please respond in #general since I don't think the prefix showing the world has anything to do with the Luckperms developer API. If it somehow does, feel free to correct me and carry on here
I need help
I have a mod that makes me be in op 2 use it
How do I make a role 2 change that
!api follow these links and see what you can learn from em
Learn how to use the LuckPerms API in your project.
is there a way to clear a user's group and set a new one? I see User#setPrimaryGroup(String) but i dont think this clears other groups
i have a group name that I want the user to have, and they should only have this one group
Sorry for the stupid question, but how can I add permission to a player? I know how to create nodes but not how to apply them to the player.
nope nope this is the dev channel I can’t help here
need we to add the luckperm.jar to the plugin or just a "import"
!api
Learn how to use the LuckPerms API in your project.
@surreal yacht @nocturne elbow
@umbral bough add the new inheritance node and remove all others
Hello Guys! I just started to work with LuckPerms API. I've already read the documentation but I am having a hard time here understanding the node structure.
I know what a node means but I am not being able to create a perm group with a suffix ( for example )
I am creating a node with Node.builder().builder() but it only creates the node. I was looking for the SuffixNode but I didn't understand how to link it to the first node I created.
I know this is a noob question but I would like having some help to understand how to make it work 🙂
@scarlet juniper what do you mean "link it to the first node you created"?
You make a suffix node with SuffixNode.builder()
thank you for you answer.
I meant if I want to create a simple group and add a suffix and a prefix for it? the prefix/suffix nodes would be sub-nodes of the simple one, right?
but can a node have nodes under it?
What?
I'm starting to doubt you understand the node structure
What would a sub node even look like?
for example, I would like to have a group in my server like VIPS
I have a node for the group VIPS ( I imagine this is a node )
and I would like this group have a prefix [VIP]. would this data (prefix) be another node?
Groups aren't nodes
They are groups
Group assignments are nodes
But that's different story
Prefixes and suffixes are nodes
ok, I am understanding my misunderstood. I thought groups were nodes as well.. That what I meant with "link it to the first node"
I was actually trying to add a node to a group
That's how it is being done
gotcha. let me try to read the documentation again having it in my mind. thank you very much!
You're welcome
Is it possible to create my own migration for another plugin?
is this the right way to ensure that a user only has the group "rank" and none of the other groups in "configRanks"
well its a string
I thought you were using a rank object or smth
im more wondering about the add and remove
well it may work but idk if its the most efficient way
honestly
it shouldn't make any difference
as its a simple for loop
unless you have thousands of "configRanks"
Also just a question, why are you adding "group."+rank permission to a user?
That seems kinda pointless as you can literally get the groups using the api
pretty sure thats how you add a group to a user
idk
There should be a function for it
and i dont want to remove ranks that are not in the config to be tracked by time
I mean this should do?
You're looping through the ranks you wanna check
If its not the one you want, remove it
yup
In theory it should work
@meager moat sure. Why wouldn't that be possible
I doubt the API is enough though
You probably need to hook into the plugin itself
Take a look at how the other migrations are implemented
And then try to mirror that
You could either make your own extension plugin or make a PR
Are what automatically detected?
migrations
or do I need to register it somewhere
also for now I'll have it in my servers plugin to migrate, after that if its working I can consider contributing it
Okay yeah looks like they're pre registered
I'd need to try and hack the migrations parent command and somehow insert it
Wait why am I trying to do it through luckperms itself
I can literally write a script to use both plugins apis
Well, I'm pretty sure you can register another migration later
No need to hack anything
Or fork LuckPerms as is to add the migration
Why can't you straight up get the groups from a User object
You gotta loop through all nodes and check if its the group you want
I just loop through all groups and check if the player has it
Then add it to a list
https://github.com/lucko/LuckPerms/issues/1926 @meager moat
Nice
Just add your suggestion there
guys
is there any way to make rankup with money on luckyperms
Is this not how you set a user's primary group to owner?
LuckPerms api = LuckPermsProvider.get();
...
api.getUserManager().getUser(p.getUniqueId()).setPrimaryGroup("owner");
Make sure you save the changes
Setting the primary group selects which of the groups the player has is the primary one. It doesn’t assign any groups @nocturne elbow
Have a look here
!api
Learn how to use the LuckPerms API in your project.
Oh I see, thanks
So to add a group to a user it would be
DataMutateResult result = user.data().add(Node.builder("group.owner").build());
?
@nocturne elbow use the inheritancenode builder
How do I retrieve '2' from the permission nucleus.home.set.limit.2 when I've got the PermissionData of a user?
Or do I need to use MetaData?
Realistically, you need MetaData, yeah
So would I need to use getSuffix() after I get the MetaData?
or does that method return the player suffix?
It returns the player suffix
I’m pretty sure nucleus stores the permission data in meta directly
Oh wait I think I got how this works now, thx. Figured out what I needed.
I need help! How can i copy my Perms from PEX to LuckPerms?
Is there an event for when a parent of a user is updated?
I'm having trouble with the events
eventBus.subscribe(NodeAddEvent.class, this::onNodeAdd);
eventBus.subscribe(NodeRemoveEvent.class, this::onNodeRemove);
the events dont fire
still needing help
@surreal yacht you can't have a method inside another method
I'd recommend you learn Java basics first
Minecraft plugins are not easy to make and go beyond what you can achieve with copy-paste
@crude laurel is the eventBus the LuckPerms even bus?
Hey, what does this have to do with the Developer API?
Can someone help with how to give players permissions? I want to make a plugin that will give a specific player a permission when they do something
thanks
!api probably has what you need
Learn how to use the LuckPerms API in your project.
nah
Perhaps be more specific on what you need?
Hi everyone. Is there a way to get the weight of a group? I'm currently looking for a way to get a group with highest weight so I can show normal player when their group is expired.
Currently. I have these group. rank and rankplus
The rank group have 1000 weight
The rankplus group have 800 weight.
Why the getPrimaryGroup() return the rankplus instead of rank?
!api check out both of these links, they may help you
Learn how to use the LuckPerms API in your project.
Thanks I already check but I cannot figure out how I can get weight of a group
Hello, if someone does not know what to do and he wants to help me with the plugins he will be welcome
@surreal yacht if this has to do with the Luckperms Developer API, be more specific. If not, but you need Luckperms help, use #support-1. If not Luckperms at all, use #general
I would like a plugin to buy grades for virtual money (vault) I use spigot 1.14.4
Why its not off-topic It's with Luckperm api
Luckperms API has nothing to do with finding another plugin that will provide grades (ranks?) for vault money. There is literally no conceivable relation.
is there a way to make it so a person only has access to a command in a certain world
!api
Learn how to use the LuckPerms API in your project.
eventBus.subscribe(??, event -> {
System.out.println("users parent got changed");
});
Is there any event to check if the users parent got changed? (lp user %user% parent set %group%)
Is there an event for when a parent of a user is updated?
@fallow blaze Did you find it?
I did not in the end
I worked around with different logic instead for what I needed it for
If you do ever find it though, please let me know xD
Just asked but I think it doesn't exist
@fallow blaze
Nametagedit uses this, maby this works
public HookLuckPerms(NametagHandler handler) {
this.handler = handler;
LuckPerms api = LuckPermsProvider.get();
EventBus eventBus = api.getEventBus();
eventBus.subscribe(UserDataRecalculateEvent.class, this::onUserDataRecalculateEvent);
}
private void onUserDataRecalculateEvent(UserDataRecalculateEvent event) {
User user = event.getUser();
Player player = Bukkit.getPlayer(user.getUniqueId());
if (player != null)
this.handler.applyTagToPlayer(player, false);
}
I guess, this covers every time someone's data is changed
Rather than just when a parent is changed (as far as I know)
Uhhg 😫
@fallow blaze I did it 😄
eventBus.subscribe(LogNotifyEvent.class, event -> {
if (event.getEntry().getDescription().startsWith("parent set")) {
String username = event.getEntry().getTarget().getName();
System.out.println("users parent got changed (" + username + ")");
}
});
@charred shell use the UserDataRecalculateEvent and filter it in the same way
so I'm new to this...
is this somehting bad or just conflicting pluggins?
[13:34:34] [Server thread/WARN]: Legacy plugin NoCheatPlus v3.16.0-RC-sMD5NET-b1134 does not specify an api-version.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by me.lucko.luckperms.common.dependencies.classloader.ReflectionClassLoader (file:/Users/mac/Desktop/MineCraft_Server/minecraft/plugins/LuckPerms-Bukkit-5.0.72.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of me.lucko.luckperms.common.dependencies.classloader.ReflectionClassLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
That's an error we know about, and you can safely ignore it if everything is working
woot
Also this is the wrong channel
And even if not everything is working, you can ignore this
How can i obtain the prefix of a group/player?
!api it's on here, pretty sure, take a look!
Learn how to use the LuckPerms API in your project.
Does User#getDistinctNodes() return group nodes as well?
or how i can get a list of groups a player belongs to
Yes that includes them
How can I get the player group prefix etc. ?
!api it's on here
Learn how to use the LuckPerms API in your project.
how can i create a context that checks if the player has enough money using lp and vault?
!api
Learn how to use the LuckPerms API in your project.
ye i tried but i don't know java very well and my code ended up having a lot of errors
so i was wondering if someone could make that for me
Can i use it with forge 1.12.2 mod?
i need to add permissions for commands from my mod
Hi, I am new to java development so please try to be patient.
I have added the dependecy for Maven in my pom.xml, how can I get the prefix of a user? I know I can use String prefix = metaData.getPrefix(); but where do I get the metadata from?
I also found this post
How would I get the user in the first place, and what are the "contexts"
@obsidian helm use the forge permission API
You’re welcome
I have the same problem, on bungeecord
Hello, I am trying to understand your API, but I still cannot understand how I can get the prefix of some group.
!api has good resources
Learn how to use the LuckPerms API in your project.
both links too
I'm on that site, but I still don't understand, xd, I think I'm retarded.
Well I'm not too knowledgeable on this side of the plugin, but if you ask a detailed question, I'm sure someone that knows will answer when they can
I'll try, I don't speak English, I manage with the translator.
I want to know how to get the prefix of a range, to save it in a variable and use it later for other things.
since the prefix itself already has details it is better than obtaining the name of the rank that the player has.
achieved xd, these things are hidden in the api, I had to experiment with the wiki and the code.
User user = plugin.getApi().getUserManager().getUser(player.getUniqueId());
String prefix = plugin.getApi().getGroupManager().getGroup(user.getPrimaryGroup()).getCachedData().getMetaData(QueryOptions.defaultContextualOptions()).getPrefix();
User user = plugin.getApi().getUserManager().getUser(player.getUniqueId());
ContextManager contextManager = plugin.getApi().getContextManager();
String prefix = user.getCachedData().getMetaData(contextManager .getQueryOptions(user).orElseGet(contextManager::getStaticQueryOptions)).getPrefix();
@vagrant cape
I have a question
Do the placeholders from luckperms work in strings (Java)?
like if I do sender.sendmessage("%luckperms_prefix% Is you current prefix")
No
So i have to create a variable?
Oh boy
I highly suggest you learn Java first
Else this will be nothing but a frustrating struggle for you and everyone you ask for help
I started 2 months ago
I know Python and HTML
but I guess thats not something you could be proud of 😄
I started 2 months ago
Programming or Java?
Java
Its a bit confusing, but I am starting understanding the whole thing
(But I am still stupid)
Placeholders are nothing built it
You need to call the right APIs to replace them with their content
ok
So how do I access the players prefix?
(I dont speak English well so I have a bit trouble with the Github page)
Quick question how do i check if a player have a certain permission
if(player.haspermission("permission"))
I guess you use "sender" as "player"
I have a question too, how do you change the players parent
I mean, obviously with LuckPerms...
In java
Should be smthing like Luckperms.Changeparent ?
Btw can someone send me the download link of the dev api, I think I got the wrong one...
it is the file called api-5.0.jar , right?
and
Learn how to use the LuckPerms API in your project.
Quick question:
i want to make a random color system
ist this right:
int r1i = r.nextInt(17) + 1;
int r2i = r.nextInt(17) + 1;
Color c1 = Color.fromBGR(r1i);
Color c2 = Color.fromBGR(r2i);
ok got it
What Is the platform method?
How would I query a player's metadata? The API has a usage but is there something I'm missing because my IDE does not see MetaData as a valid variable type
@hardy badge Can't remember the exact specifics but there's a CachedMetadata involved somewhere, think you need to grab the metadata for a specific context set and it'll give you cached metadata
The wiki has a guide on it though
Im iterating over every server and player inside them
And filtering ProxiedPlayers with certain permission
I did ProxiedPlayer#hasPermission
But didnt work for inherit permissions
Are the groups server specific?
Im unsure about that
If they are server specific you need to apply them differently for it to work on the bungee too
Oh i see
There is any way to check it with nodes so i dont rely on global perms?
Just in case
The context is set as none
I mean the group assignment @real gulch
And you can check with /lpb user <user> info
No
that sucks,. hope you feel better stone
Thank you
Need help: I created an inventory shop GUI and it works good, for example if you click on the sword it'll remove 100.000$ from you and you'll get it. But if you do a shiftclick, it'll give you the sword twice if you have the money, and once even if you don't have the money.
Any Ideas?
sorry
"You need to cancel inventory move events."
How do I do that???
OK ill just google it 😄
sorry for being stupid and annoying
Hey,
I want to get all group of a User with LuckPerms's API.
?
how do you add/remove a user from a group in the api? Any example I'm finding are using the old api
!api @earnest zodiac @opal snow
Learn how to use the LuckPerms API in your project.
yeah i've searched those pages
Those are up to date
but they don't answer my question
but a group is a Group object, not a Node
But they are represented by nodes in the data
I want to get a list of the user groups
so I have a User object and a Group object, I want to add User to Group. I don't see anything in the docs that tell me how to do that.
You need to make an inheritance node and add that. You can create one using the group name as a string or a Group object: https://javadoc.io/static/net.luckperms/api/5.0/net/luckperms/api/node/types/InheritanceNode.html#builder-net.luckperms.api.model.group.Group-
How can I have dual prefixes through the API (basically setup a group that I create to be an additional prefix rather than replacement)
Hello. It's going LuckPerms to support nukkit 2.0?
Hey, are there javadocs for the V5 api yet?
!api Yes they are, a link should be on one of those pages:
Learn how to use the LuckPerms API in your project.
Official branch: https://github.com/NukkitX/Nukkit/tree/2.0.
Tested and compiled succesfully.
I maked a PR for 2.0 Nukkit
LuckPerms uses Gson ?
not sure what you really mean. Best to ask luck through the GitHub issue
Yes, it uses. I checked the code
In the luck editor is there a way to check everything instead of going one by one?
!rank
Sorry! I do not understand the command !rank
Type !help for a list of commands.
!help
!advanced
!api
!argumentbased
!bulkupdate
!bungee
!cauldron
!colours
!commandequivalents
!commands
!config
!context
!default
!downloads
!editor
!errors
!essentials
!extensions
!faq
!helpchat
!install
!locale
!meta
!migration
!notworking
!nowildcard
!pasteit
!permissions
!placeholders
!selfhosting
!stacking
!storage
!switchstorage
!sync
!tracks
!upgrade
!usage
!userinfo
!verbose
!whyluckperms
!wiki
!api
Learn how to use the LuckPerms API in your project.
plugin.getLuckPerms().getUserManager().getUser(target.getUniqueId()).setPrimaryGroup("admin");
Is not setting the player to administrator, am I doing something wrong?
No errors
UserManager userManager = plugin.getLuckPerms().getUserManager();
CompletableFuture<User> userFuture = userManager.loadUser(target.getUniqueId());
userFuture.thenAcceptAsync(user -> {
user.setPrimaryGroup("vip");
userManager.saveUser(user);
});
Tried doing it that way, still no result.
!api
Learn how to use the LuckPerms API in your project.
!permissions
A list of permissions used by LuckPerms commands.
What are ya looking for my dude?
with the developer api?
yes
it's on one of the two api links you summoned
I need to set a specified permission for a player and take the same player or player offline.
or a bit from both haha
i not found ; -;
then say exactly what you need to do and someone who knows will help when they can
In this same chat?
yep
Help
Import luckpermsapi
i have a question about making a plugin not with LuckPerms api in #general 😐 someone pls help 🙂
how do i set it up to where i have spawn protection but people can still interact with things like chests
How can I give sombody a role in a plugin?
@jaunty pecan Sorry for tag
Hey NycuRO! Please don't tag staff members.
I just wanted you to know i created a PR for Nukkit-2.0
I saw it, thank you
I don't really want to merge it though until the 2.0 version becomes the main release
Yeah, i was wondering about making a new file maybe with nukkit-2.0?
if we can do it without duplicating the whole nukkit source then sure 😉
I'm trying to get the Luckperms placeholders to load on NukkitX although even with the PlaceholderAPI plugin it doesn't recognise LuckPerms placeholders.
Did you download the Luckperms expansion? papi ecloud download luckperms and papi reload
@rustic laurel papi shown as an unknown command.
Hey Hazard! Please don't tag staff members.
Learn how to use the LuckPerms API in your project.
!api
Learn how to use the LuckPerms API in your project.
I'm trying to give a user permissions using this bit of code
final LuckPerms lp = LuckPermsProvider.get();
NodeMap nm = lp.getUserManager().getUser(uuid).data();
nm.add(Node.builder("essentials.kits.PermKit").build());
but when I do nm.add(...).wasSuccessful(), the result is false
and the player in question does not have the permission
am I missing something?
@severe plaza you need to save changes to the player
thanks!
Hello I have a problem can you help me?
Maybe
I download and add to server Luck Perms
and that dont join me and that write
Permissions data foryour user was not loaded
Please help me
during pre login
do you know that problem?
Hello, I opted for LuckyPerms because Artenos support advised me to manage the permissions of / sethome so that people do not have op can also access it. How can I configure Luckyperms with aternos? Thank you for answering me.
!usage follow this
Here's a guide to help users understand and use LuckPerms for the first time.
Aternos is irrelevant btw
What is BTW i'm french, i can't use LuckyPerms with alternos ?
You can, it's Luckperms, and ask in #support-1 or #support-2
Ok
Where i can request help ?
How would I do the following
user.clearMatching(n -> n.isPrefix() && n.getPrefix().getKey() == weight);
On luckperms v5 api?
I wanna clear all prefixes with the same weight as the weight variable
Is there a option to obtain the api in a bungeecord server?
Learn how to use the LuckPerms API in your project.
Actually saw it 😄
I want to get the UUID from the username of an Offlineplayer.
This causes nullpointer
return LuckPermsProvider.get().getUserManager().getUser(username).getUniqueId();
}```
And I want to check the permission from an offline player
This causes nullpointer too
LuckPerms lp = LuckPermsProvider.get();
User user = lp.getUserManager().getUser(uuid);
ContextManager contextManager = lp.getContextManager();
ImmutableContextSet contextSet = contextManager.getContext(user).orElseGet(contextManager::getStaticContext);
CachedPermissionData permissionData = user.getCachedData().getPermissionData(QueryOptions.contextual(contextSet));
return permissionData.checkPermission(permission).asBoolean();
}```
@jagged ember check the javadocs NodeType. That should help
Someone can help me ? xD
I need that fixed today
Thanks BrainStone, ended up installing the extension for now 👍
