#luckperms-api
1 messages · Page 20 of 1
API docs are linked in the header, the API usage guide also covers how to use the API for various things
So
I am missing a lot of functions for the api
For example parent clear, group remove and add
Also the possibility to get a editor link via api is missing
Read the docs on working with nodes, can't really say what you're missing other than expecting methods which do it for you
web editor also likely isn't considered API, but take a look at how the editor commands work
And rename
Well i solved the issues that i had, in a other way 🤔
Read the log file, and execute commands
Or you learn how to manipulate the nodes properly...
Nah
My solution works kinda fine, only the feedback is kinda buggy, but i solve that problem to
@long moon I tried but i don't know how to get player rank with the highest weight
I need help with the API. I'm trying to get a user's set prefix for a chat plugin I'm making. I'm first testing this and then moving to vault.. I can't seem to find any methods for this tho.
Ref the api usage docs on the wiki
Contexts contexts = LuckPerms.getApi().getContextsForPlayer(e.getPlayer());
String prefix = cachedData.getMetaData(contexts).getPrefix();```
@kind crystal
Ahhhh I see.
Welp I'm stuck. I'm getting so eu compatible types in my IDE
Says required me.lucko.luckperms.api.chaching.UserData
Found: me.lucko.luckperms.api.User
Don't know why since I even got it imported.
Let's me cast to api.caching.UserData
Change the var cached Data to api.User or migrate to api.User
That worked! Thanks
how can i get a users group to a string?
get the users group nodes by filtering them out of their own nodes, then create a string with their names
how would i get the user group nodes :/
The API docs go over interacting with nodes
I may have misslooked i will try again xD day 4 at figuring this out lol
On the wiki, see the sidebar, there is a usage API which has examples on how to toy with the API and stuff
I'm stuck on a severly underpowered laptop, so I'm somewhat limited in tryna lookup stuff myself \o/
ohhh
Finding a players group
🤦
Thank you for your help 😄
Gonna have to figure out this if (player.hasPermission("group." + group)) {
Hey there i need help because im a beginner in dev...!!
String query = "SELECT expiry FROM luckperms_user_permissions WHERE uuid LIKE '416a0bf3-5682-475d-9da5-8d96bd55ae98' AND permission LIKE 'group.donate'";
i cant get the right answer
the data value are corret and the sql answer is good so i get the unix_timestamp
but in java i get only this
com.mysql.jdbc.JDBC42ResultSet@49e78d6a
is any body here...??
What are you doing with the query? Why are you reading data directly from the database?
hello, little question, my plugin has tons of commands and each one has a permission, do i need to add specific implementation to every single permissions plugin or is the basic implementation of permissible#hasPermission(permission) enough?
or should i use Vault as an abstract layer?
(please ping me if you reply)
hasPermission is enough imo
(With LuckpermsAPI)
Hi all !
you have already tried to block the use of a mod with luckperms, because I can not find an id to block its uses ... (it's for the mod customnpc) ??
i need help with something plz anyone
Me me me
.
@charliestenslay#2769 just ask
How do I check if a player has a certain permission?
User#hasPermission(Node node)
Don't know how this Node works
Should work with a String, but it doesn't
???
Yup that would work
@normal hedge the question is, why do you need that?
Just use the permission check of the platform
Only exception would be for offline players
Im making a level system based on permissions
There are also ops or * users
so thats why the Player#hasPermission(String permission) doesn't work
Well it works now lol
It's kinda funny that yo learned why you're not supposed to use * or OP @normal hedge
😛
any way to get the users parent groups that are shown when running /lp user info
i used the example from the documentation using nodes but that also returns inherited groups
Hey, im trying to make a staffchat plugin currently and wanted to incorporate luckperms into it to setup permissions, how would i go about doing that?
elaborate
so im new to setting up luckperms on plugins, i made a custom staffchat plugin for bungee but want to use luckperms to assign permissions to groups for the plugin
i read that i have to put in the luckperms api dependency, but then what?
@nocturne elbow there are a few different methods to get player nodes
One of them returns only the directly assigned nodes
@brave oak so you want to give people certain permission when a command is ran?
yeah basically i have a command /sc <message> which allows the user to talk in a "staff chat", i want to setup permissions so only staff can use that command and view it
but im not sure how to setup luckperms in my plugin
its a custom made bungee plugin
Do you want to give people permissions or check permissions?
check for permissions
ok sorry let me start from the beginning, so i made a custom staffchat plugin for bungee and i want to implement luckperms into it to give certain players access to the command which is /sc
Now to make it very very clear:
Do you want to:
- See if a player has permission to use the staff chat?
- Give the player the permission to use the staff chat?
give the player permission to use staff chat
So you have an extra command for that then?
no i do not have a command to give players permissions currently
Then how are you planning on giving the permissions?
Though in any case it's typically better to let server admins just set permissions instead of doing it for them
Oh okay I’ll check out the docs, thanks @crystal sonnet
Hey zbk! Please don't tag staff members.
fine
Is there a way to give people access to a group? I only see a way to set the primary group, but can't seem to find a way to actually add a group to them.
@hybrid dawn /lp user (nickname) parent add (groupname)
Through the API I mean. I'm making a plugin and I want to be able too manage the permissions alongside LP
@hybrid dawn you need to look at the docs. Look at the NodeFactory
NodeFactory doesn't help me, as far as I can tell there's no way to add a user to a group using the api
Adding a user to a group is the same as adding a group.<groupname> permission node
I thought doing group.groupname was the equivalent of perm inheritance Turbo
I see
How do you guys give players permission to teleport and for the other person to /tpaccept or /tpdeny
Do I need a a extra plugin for that with luck perms or luck perms can do that
isnt that essentials?
Hey T-rex! Please don't tag staff members.
do I need luck perm for it?
Essentials is a plugin that does loads. Luckperm just handles permissions
So essentials has like, essentials.tp (i think) and you would add that to luckperms
So I need luck perm to give my players essential commands
Yes
and the command that I type is essentialx?
The plugin is called EssentialsX
Do i need luck perm for Skyclaim ?
Guys luckperm just handles permissions that other plugins have
Why Skyclaim don't work when luckperm isn't here
are you using sponge
Yes
Ah i think sponge stuff with luckperms is a bit different
im not sure as i know nothing about sponge
:paperclip: https://github.com/lucko/LuckPerms/wiki/Usage
for super lobby for the leader board how do i put my rank is it %rank%?
Mal eine Frage. Was sind die dependencys für die luckperms bungee api?
Für die luckperms Bungee API braucht man doch bestimmt andere maven dependencies also für die luckperms Bukkit API
Und ich bräuchte die maven dependencie von der luckperms Bungee API
Spittin facts
Hoffe dass das der richtige Chat dafür ist. Weiß jemand was ich eigebenen muss damit jemand nicht abbauen kann ( z.B. Visitor Rolle )
Meinst du mit der API?
Dich
Ach so :D mit welcher API 😬
Ah
Ne eigentlich nicht
Kann sein dass es der falsche Chat war
Ja..naja trotzdem danke
@idle seal es gibt nur eine platformunabhängige API
Und die ist standalone
Also ohne weitere Abhängigkeiten
Was auch völlig normal für eine API ist
Ja okay, weil bei der einer Methode ein Fehler kommt wenn ich sie ausführe. Auf den spigot Server habe ich die gleiche Methode und da geht sie
Und welcher Fehler?
Ja schicke ich gleich ich hatte vorhin noch keine Zeit um an PC zu gehen
ach egal habe den fehler gefixt
Hello ! 😄 How can I check if a player has an permission , by the User object ( for using in the LoginEvent* ) ? I got the syntax <User>.hasPermission() but i ask me a "Node". What is this Node , and how can I get it ?
A node is a permission. You can make Nodes using the NodeFactory
@blazing pewter pretty sure the player has their permission data already loaded at that stage and you can just use the platform permission check
I can't because I haven't the ProxiedPlayer object at this stage (LoginEvent) , so I doesn't have the hasPermission method of ProxiedPlayer
I will try to understand how NodeFactory works Tobi , thanks you ! 😄
And.. I'm sorry I forgot to say that it's for BungeeCord and not Spigot
I think you can get it, but yeah
Nah. During the regular old LoginEvent you only get a PendingConnection. You want PostLoginEvent for the ProxiedPlayer
Building a regular old permission node is fairly simple. https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#creating-new-node-instances
im very confused and prolly just being stupid bc its early but how do I check for a players group with
for (String group : possibleGroups) {
if (player.hasPermission("group." + group)) {
return group;
}
}
return null;
}```
Do I do like
getPlayerGroup(player, something);
?
Well, you should check if the player has a group with
Player#hasPermission("group." + AGroupName);```
I dont want to check them 1 by 1
Well, what do you want to achieve?
i want to check what rank the user has
Well, can't you just use Player#hasPermission then?
I don't want to check for each group individually
Get their own nodes
Then, filter out their group nodes
(Pretty sure this is covered in the API usage guide on the wiki)
yes I was asking how to use that and they all just told be to use has permission
thank you
Can we pleeease have the API usage guide in the channel description or something? People seem to gloss over it far too often and ask questions which are already answered in that guide
I've been trying to use the luckperms placeholder for prefix with EssentialsChat, but it just isn't work
#luckperms-api is for people trying to use the programmer API of LP
It seems like you're justr trying to configure EssentialsChat, am I right @brazen pewter?
can i check alreay has permission on NodeAddEvent?
Is it possible to obtain the players rank via the bungeecord?
?
I created a plugin that installes other of my plugins as APIs. The Problem is, LuckPerms does not find the permissions of the plugins. (ik, i can search for the perms manually but luckperms is easier). When I install the other plugins, I use the pluginmanager and load them. Reloading/Restarting does not help, because the APIs get reinstalled to have always the newest version. Any Ideas how I can reload the system that recognizes the permissions with the luckperms API? If it is kind of hard, please private msg me to not spam this chat :)
NOTE:
I enable the APIs after the server has loaded and before the server is done enabling
@magic anchor permissions that have been checked end up in LP’s list of known permissions
So you can just go around and make sure the plugins check their permissions
And I’m 99% sure that is not exposed in the API
Alternatively I think you can tell the API directly what your permissions are
@crystal sonnet but how?
Hey DasBabyPixel! Please don't tag staff members.
I’m not sure how the method is called. But check the Javadocs
I’d take a look in the permission manager
I think I found something...
the InjectorPermissionMap
but I have no Idea how to get the instance ._. probably will require deeper researching
I hate to do stuff like that, but I'll probably insert the new permissions via reflection API. The PermissionRegistry class is as far as I can tell not implemented in the API. Thats kind of unfortunate, but oh well
@magic anchor that’s what an API is
The implementations are in the actual plugin
And yes the PermissionRegistry class sounds exactly like the class you need
Get an instance and use it
Is there an event when you set the parent of a player?
?
?
why is NodeAddEvent not firing?
is it supposed to fire when i set a permission for a player/group?
why is that event handler throwing errors?
@nocturne elbow and how can I obtain the player from the 2nd event
@eternal bloom LP events aren't called from the regular annotation iirc. Have a look at this: https://github.com/lucko/LuckPerms/blob/master/api/src/main/java/me/lucko/luckperms/api/event/EventBus.java
Hi i have a question.
i have just set up a server using Spigot, with the luckperms plugin installed. However i cant seem to get the permissions for the groups right. Everytime i try to set it so that certain players in a group can not change gamemode, it doesnt work. I have tried a lot of different commands.... Its probably a very easy thing, but i cant seem to figure it out...
!verbose
:paperclip: https://github.com/lucko/LuckPerms/wiki/Verbose
Use that to find the right permission to set
thanks~!
yo thanks so much!!! its all fixed thanks to the github!
I'm trying to get the prefix of a player but it is not working.
https://paste.themelvin.nl/oCd0jv => Code
https://paste.themelvin.nl/xY0gyn => Error
I can't get the prefix from metadata, but why idk.
@drowsy moon 2 things
a) you code doesn't match with the errors
The lines are way off
b) Is the player offline? (never mind)
is there an example for a listener for LuckPerms custom events
@eternal bloom I'm not sure if I get what you are asking for but I am using this in my class constructor
LuckPerms.getApi().getEventBus().subscribe(UserDataRecalculateEvent.class, this::onUserRecalculateEvent);
and the method that I put inside there:
private void onUserRecalculateEvent(UserDataRecalculateEvent e) {
}
Question: I am using user.inheritsGroup(group); to check if a player is inside a specific group but this seems to not check temporary groups/parents. How can I achieve that?
why is this not working: ```
@Override
public void init() {
LuckPerms.getApi().getEventBus().subscribe(LuckPermsBridge.class, this::event);
}
private void event(LuckPermsEvent e) {
// do stuff
}
whats org.checkerframework.checker.nullness.qual.NonNull
@eternal bloom the first parameter needs to be the class of the event you want to handle
does the class need to implement anything?
Question: I am using
user.inheritsGroup(group);to check if a player is inside a specific group but this seems to not check temporary groups/parents. How can I achieve that?
Do you know how, BrainStone?
@eternal bloom no. It's the event you want to listen to
@atomic sapphire I don't. But have you checked the Javadocs?
it says i need to cast LuckPermsBridge.class to @NonNull Class<T> but org.checkerframework.checker.nullness.qual.NonNull doesnt exist
Ignore the nonnull
LuckPermsBridge is not an event
LuckPermsEvent is one on the other hand
@eternal bloom
i think i get what your saying
It says
Check to see if this holder inherits another group in the global context.
"Global context" simply means an empty context set.
This method only checks for direct inheritance - one hop up the inheritance tree.
for #inheritsGroup(Group) so I would assume that it includes temporary groups. Because when I don't make it temporary the method returns true of the group
Hi! I am trying to get prefix of a group?
Still haven't found a way.
How can I get MetaData of a group and get prefix from it?
Edit:
Found that but I no idea how to get contexts of current world/server? https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#the-basics-of-cacheddata
You can get the global context using Contexts.global(); or use Contexts.of(...)
Thanks!
is the API for luckperms the same from spigot to nukkit? (Ignore question in #support-1 )
@ionic smelt yes it is
Hey is there's any way so I can get the same permission result as this?
Currently using this code and I didn't get the same result
I've parented my self to a group called Hello and that group has a permission csl.limit.vip
using my code it shows the permission
but when I check it using the permission info commands on luckperms it didn't show the csl.limit.vip
nvm
fixed by using List<LocalizedNode> permissions = new ArrayList<>((Set<LocalizedNode>) user.getEnduringPermissions());
how can i get all members from a specific group?
i need a list from everyone who is for example in "vip" group
@nocturne elbow online or online and offline players?
both, everyone who is in the group
okay
You'd need to load every known player and check if they are in that group
i have a temporary group, how can i check the duration with the API?
I've got a question, been setting everything up for the first time, switched over from group manager and I think I got everything all set up right. I got the default group switching over to the group I want as the default, Beginners. That's working fine so far but there's some commands and other things that they can still use that I don't want them to.
For instance creating a essentials warp sign or using the gamemode command.
I don't particularly know what's happening here or how to fix it so they can't.
@nocturne elbow iterate over the nodes the player has, check if it
s the node you want and get the remaining time from it
@fossil trench that belongs in #support-1
Oh sorry. Re-post it there?
Yes
what event should i use to get the group when someone does /lpb group admin setweight
getGroupManager() first
then get the group
LuckPerms api is not working for me. This code does not effect (does not give rank or send log message) and does not give any errors:
Main:
public static LuckPermsApi luckPermsApi;
public void onEnable() {
RegisteredServiceProvider<LuckPermsApi> provider = Bukkit.getServicesManager().getRegistration(LuckPermsApi.class);
if (provider != null) {
luckPermsApi = provider.getProvider();
}
}```
Other class:
```java
private void setPrimaryGroup(UUID user, String rank){
User LPuser = Main.luckPermsApi.getUserManager().getUser(user);
LPuser.setPrimaryGroup(rank);
Main.luckPermsApi.getUserManager().saveUser(LPuser);
}```
Also in plugin.yml:
```yml
depend: [Vault, LuckPerms]```
@marble fulcrum setting the primary group does not give a player a group
It only determines which of all the groups the player has is the primary one
Check the wiki for examples on how to add or set a group
Why this is not working?
private void givePerms(UUID user, String perm){
User LPuser = Main.luckPermsApi.getUserManager().getUser(user);
Node node = Main.luckPermsApi.getNodeFactory().newBuilder(perm).build();
LPuser.setPermission(node);
Main.luckPermsApi.getUserManager().saveUser(LPuser);
}```
You're getting the user, creating a node (read you are creating an object that says "If given to a player they have that permission") and then don't add that node to the player and then save it
when getting the users parent group inside of NodeAddEvent it will return the value before the node was added. is there a way around this?
ex user gets admin added, getParentGroup() will return default in the event
How can I make that work?
@nocturne elbow can you show us the code? If your doing anything asynchronously, that will also do this. Even if you use a BukkitRunnable, this will occur since they are scheduled for the next tick as a minimum
nothing is asynchronous in the listener
@marble fulcrum there's a method on the user to add a permission node
nvm i was calling something async, is there a way to delay the async task until the event has "finished"?
it has to loadUser unfortunately
is there an event for when an user switches groups? like on parent add/remove
Node add event maybe?
so i should check if the permission starts with group.?
I believe that will work
Not a Java developer so I've never used the API, there could be a better method but that's all that comes to mind
To know if a user has a permission, it must be done like that ? :
return this.lpUser.hasPermission(SaoArms.luckPermsApi.getNodeFactory().newBuilder(permission).build()).asBoolean();```
That should work yeah
Okay thanks
Oh its working but why it does not send any log message lol
private void onUserPromote(UserPromoteEvent event) {
ProxiedPlayer player = event.getPlayer(event.getUser().getUuid()); //how do i do this correctly
if (player != null) {
player.sendMessage(new TextComponent(ChatColor.GOLD + "Your group has been moved from " + event.getGroupFrom().get() + ChatColor.GOLD + " to " + event.getGroupTo().get() + ".");
}
}```
Is there a way that I can get the ProxiedPlayer? I'm quite new at all of this so I'm not sure if i am even doing this right lol
I am trying to send a message to the user letting them know they have been promoted, so I need a way to get the player. Also making this as a bungee plugin
^ please @ me if you reply thanks
@left badger There's a Bungee method to get the player from the UUID
Just google it
ok
so i just got back from school, so i can actually look now, but are you recommending using the default way of getting the player uuid, and then getting the bungee player from that?
private void onUserDemote(UserDemoteEvent event) {
Player player = Bukkit.getPlayer(event.getUser().getUuid());
if (player != null) {
player.sendMessage(ChatColor.GOLD + "Your group has been moved from " + event.getGroupFrom().get() + ChatColor.GOLD + " to " + event.getGroupTo().get() + ".");
}
}```
This is the way that is outlined in the API docs, so wouyld I have that and then using that get the bungeecord player from that uuid?
@left badger keep in mind you’re on bungee. Not bukkit
So use the bungee API to get the proxied player
Should be very similar
ok thats what I thought
sorry I was confused
also are there events for when a user gets added a rank, or their rank gets set? I couldn't find those anywhere
User LPuser = Main.luckPermsApi.getUserManager().getUser(user);
Group group = Main.luckPermsApi.getGroup(rank);
Node node = Main.luckPermsApi.getNodeFactory().makeGroupNode(group).build();
LPuser.setPermission(node);
Bukkit.broadcastMessage(group.toString() + " ja " + node.toString()); //debugged and it got right node but it's not giving it
Main.luckPermsApi.getUserManager().saveUser(LPuser);
}```
Hmm... Its getting right node but it does not give that to player
Can somebody help me with that?
parents:
- ii
- king:
expiry: 1574681226```
How to get this contents in java?
pd.getStringList("parents") returns only "ii"
?
King isn't a string
isSet("- king") returns false
This channel is for questions about the LP api, not bukkit; But, basically, that's a MapList
This is from lp yaml configuration, so is related
So how to get contents of "king" when I check for "parents"?
actually, am not 100% sure that's a maplist; best option I got at this point is to iterate over the parents list and see what the heck the configuration system considers that
(Also, if you /reaaaallly/ want relevance to the API, why are you not just using the API?)
I want to migrate from luckperms automaticly, luckperms offers only migrate to luckperms
Use the LP api to pull all the info?
I got all users as yaml, and will add permissions/ranks by yaml
Then I would need to have 2 permission plugins in the online server
Only while migrating
You'd migrate and then remove LP
Migration can take time
You can't actually have a live production server with two permission plugins, they'd conflict
Reading the data files directly won't change anything there
Will
Then server can be only, and players that want to get back their permissions/rank can do that by a command any time
This way server will have only 1 permission plugin, and everything will be done by my plugin
Basically, if that's yourr oute, best advice I've got is to load up the config in a plugin and use a breakpoint or something to dive into the configuration so you can work out how the crap bukkit represents that
I think I got it
why would you want to migrate away from luckperms 🤔
@proud crypt LuckPerms loads data on AsyncPreLoginEvent without checking, if the player was allowed to join. When getting 1500+ bots per second, this crashes the server
Hey AsVaidas! Please don't tag staff members.
Having another permission plugin, that keeps in memory or loads player information after confirming, that he can join, will benifit the server
Now i had 5 crashes today, it is not acceptable with 50+ players online
why not contribute to LP instead of making something else?
If I would know how, I would do that
Now I know how to code, not how to use github
Or maven
Or these things
you need to learn git as a developer
I will
version control is super important
But learning and using 1 time is two different things
especially if you want to make a career out of it
If I try now to make changes, I succed and after that won't use it for a long time, what would be the benifit?
suceed*
English is not my language...
When I will need github daily, then yea, my priority will be to learn how to use github. For one time it's pointless
the reason LP loads data regardless of the cancellation status of the event is:
once an event is cancelled - that's not necessarily permanent
we've had issues in the past with plugins which cancel events early on in the event handling, only to uncancel them later
the result of which is that the player connects to the server but doesn't have any of their permissions data loaded
obviously bad ^
Yea, but can't LuckPerms recheck that on PlayerJoinEvent?
the current compromise is that LP will load data for players regardless, and then unload it later if it turns out the player didn't actually join
by the time the PlayerJoinEvent is called, the data is already loaded
the data has to be loaded during the asyncprelogin event
because that's the only asynchronous login event - basically a requirement if you want to load stuff from a database before a player actually "logs in" to the server
Well that crashes the server, 1500+ connections to the H2 database is too much for luckperms
my suggestion would be to address the root cause
i.e. enable online-mode
or get a bot protection plugin which blocks connections before the server begins to handle them
Yea, then the server is dead, after the first week only 2-3 players would log in
This is the main our contry problem
or get a bot protection plugin which blocks connections before the server begins to handle them
Maybe you know one?
Tried searching for at least code part that does that, didn't find anything
Those, which was suggessted by staff, denys join on asyncprelogin
And I think all antibots does that
It's the esiest way
Yea, after switching had bots again, zero effect
Sad to go away from luckperms
Now luckperms-gui will be abandoned
How do I get the prefix of a group of a player.
Please dont send met the github docs. I've read them and they alle dont work for me
okay no reaction
I can link you to the JavaDocs: https://javadoc.io/doc/me.lucko.luckperms/luckperms-api/latest/me/lucko/luckperms/api/caching/MetaData.html
I'm trying to use lucko's helper to download a lib and it always throws me NoDefClassFoundException. How does luckperms do that without giving a single error?
hello can someone help please
@fierce dew what class is not being found?
here's my main class (ignore the name im doing tests) https://hasteb.in/uxobedic.java
and here's TestCommand (again, tests, ignore the names and stuff) https://hasteb.in/ufeyuruc.java
and I get a NoDefClassFoundException at com.mrivanplays.icf.ICFCommand
@crystal sonnet u here
Hey MrIvanPlays! Please don't tag staff members.
So are you downloading the jar that contains that class?
have you seen the code? of course i do
Nothing ever said it would inject them in the class path/ClassLoader
it doesn't even make the plugin load because that error is being thrown at load
You gotta make sure to not reference that class directly until it has been downloaded and injected
That's not the lib's fault
That's how Java works
then mister java master, explain, how can the program inject it before the class was loaded ?
You inject it before it is loaded
how you do that while that class is the first loaded by the system
The easiest way to do it is to use a helper class that then actually references the class
that helper class will also get loaded before the lib was loaded
@MavenLibrary(
groupId = "com.mrivanplays",
artifactId = "icf",
version = "1.1.2",
repo = @Repository(url = "https://dl.bintray.com/mrivanplaysbg/mrivanplays/"))
public class MainClass extends ExtendedJavaPlugin {
@Override
public void enable() {
Helper.enable();
}
private class Helper {
public static void enable() {
TestCommand testCommand = new TestCommand();
CommandManager commandManager = new CommandManager(this);
commandManager.registerCommand(testCommand, "testcommand");
}
}
}
And no. It won't
It's not like I know how that shit works or anything
So clueless about everything
Can someone help me retrieveing the preif xof a players group..
I tries ceveral times
but wont work
public class ChatListener implements Listener {
public Main plugin;
private LuckPermsApi luckPermsApi;
public ChatListener(Main main,LuckPermsApi luckPermsApi) {
this.plugin = main;
this.luckPermsApi = luckPermsApi;
}
@EventHandler
public void onChat(AsyncPlayerChatEvent e) {
Player player = e.getPlayer();
MetaData metaData = user.getCachedData().getMetaData(player);
String group = luckPermsApi.get
e.setFormat(group[0] + " " + player.getDisplayName() + "§7: " + e.getMessage());
}
}
I wnat to format my chat for players
This is what I have ( does not work and I know there are errors..)
Okay I have it fixed
kind off
@EventHandler
public void onChat(AsyncPlayerChatEvent e) {
Player player = e.getPlayer();
User user = luckPermsApi.getUser(player.getUniqueId());
UserData cachedData = user.getCachedData();
MetaData metaData = cachedData.getMetaData((Contexts.allowAll()));
String prefix = metaData.getPrefix();
e.setFormat(prefix + " §8" + player.getDisplayName() + "§7: " + e.getMessage());
}
but after a reload or restart. it says my prefix is 'Null' and i need to regive me the group.
any solutions?
The only thing I can think of is that UserData is null, but then MetaData would throw an NPE
The only way I can think of doing this without an NPE is by getting the players highest group, then getting it's prefix. However, are there any errors in the console when you reload @uncut panther?
I know what went wrong. When i created the server i transdered the confog from luckperma aswel. As so the paremt group that everuone gets aswell. And since im running a new databse that group does not exist. Therefor the null
@uncut panther Hi xD
Will this also remove temp perms? .unsetPermission(node)
How can I remove temp permissions / temp groups?
How do I grab a players prefix, with ProxiedPlayer? I am using bungeecord.
I'll send my code in a minute
@marsh flame
@EventHandler
public void onChat(AsyncPlayerChatEvent e) {
Player player = e.getPlayer();
User user = luckPermsApi.getUser(player.getUniqueId());
UserData cachedData = user.getCachedData();
MetaData metaData = cachedData.getMetaData((Contexts.allowAll()));
String prefix = metaData.getPrefix();
e.setFormat(prefix + " §8" + player.getDisplayName() + "§7: " + e.getMessage());
}
BrainStone, Can you help me with my question above?
No it doesn’t.
The easiest way to remove temp permissions is to iterate over the given permissions and check if the node has the permission you want and is temporary. Then pass that node to the unset function
Alternatively check the Javadocs if it indeed does also remove temp permissions if you just pass a node with the permission
Hey! 🙂
I wanna change a users group via the LuckPerms API.
But the group new is not set.
My code: https://hasteb.in/diguyuze.lua
What is my mistake?
Hey thanks for your reply. But I fixed itt 🙂
Is there an official API I could use in my standalone application (LuckPerms storage set to mysql) to check groups'n stuff?
@atomic sapphire no there is not
ok thanks
How I set someone group?
I want to make a plugin that switch the player beetwen their rank and staff
There's a developer guide on the wiki @surreal comet
!api
Learn how to use the LuckPerms API in your project.
Why the javadocs doen't have a search bar, find something in there is pretty hard.
what repository do i have to add so that intellij can find luckperms api?
I copied the maven
<groupId>net.luckperms</groupId>
<artifactId>luckperms-api</artifactId>
<version>5.0</version>
<scope>provided</scope>
</dependency>```
and it says
alright I changed the version to 4.4.31 and it still is not able to resolve it
@spare torrent what happens if u add this
to ur POM
<id>luckperms-repo</id>
<url>https://repo1.maven.org/maven2/me/lucko/luckperms/luckperms-api/4.4/</url>
</repository>```
still does not work
it does for me?
Should I just share all my maven code?
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>VertX</groupId>
<artifactId>InvitationPromotion</artifactId>
<version>1.0-SNAPSHOT</version>
<repositories>
<!-- This adds the Spigot Maven repository to the build-->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>luckperms-repo</id>
<url>https://repo1.maven.org/maven2/me/lucko/luckperms/luckperms-api/4.4/</url>
</repository>
</repositories>
<dependencies>
<!--This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!--This adds the Bukkit API artifact to the build -->
<!-- Do not include this in the pom.xml file if the Spigot API is already added -->
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.luckperms</groupId>
<artifactId>luckperms-api</artifactId>
<version>4.4.31</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
yep it works
Someone should update the api tutorial to use me.lucko.luckperms and version 4.4 and to show what repo url they need to include
this includes a broken link to their maven repo
but thank you so much for your help!
Cuz, if you just follow that tutorial it wont work
you see it?
5.0 is never released
That's because the API v5 isn't released just yet
The page is prepared for that
Though tbh unless it's urgent to implement it, wait until v5 is released
The API is very different
And better
how much work will it take to rewrite it for the new api if i write my plugin with the old one?
About as long as you took to write it originally
oof
You essentially will need to start over
when is v5 coming out?
!api
Learn how to use the LuckPerms API in your project.
@dire atlas have a look at the API documentation here
yeah i found this
Be aware that some things might not work at this very moment because the docs are being prepared for the v5 release which should be later this week
Yup that looks right
Not sorted by weight, but else, yes
This will give you all meta data that applies to the player with the given context
alright
Are there some events like PlayerChangeGroup event?
?
Is there a way to get the priority id from an Prefix in Luckperms???
http://stu.pidme.me/p?id=M8Q5QUC Api isn't found, unless I have the wrong repo its simply not there
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<dependency>
<groupId>me.lucko.luckperms</groupId>
<artifactId>luckperms-api</artifactId>
<version>4.4</version>
<scope>provided</scope>
</dependency>
does work though, but with this version the example usage doens't work http://stu.pidme.me/p?id=FvDSs9S
@storm zephyr 5.0 isnt published yet
so the 4.4 is what I should use?
yes
He was planning on releasing it this week I believe. The wiki only just got updated.
Yeah I saw it was changed 2 days ago
the wiki kinda confuses people rn
I only needed to simply add a player permission, server-specific which I was able to find by simply looking at the jar maven downloaded, so I got everything in the end
private void addPermission(Player player, String serverName, String permission) {
System.out.println("adding permission `" + permission + "` to user " + player.getName() + " on server " + serverName);
Node node = LuckPerms.getApi().buildNode(permission).setServer(serverName).build();
System.out.println(LuckPerms.getApi().getUser(player.getUniqueId()).setPermission(node).wasSuccess());
}
I have this simple method, passing correct arguments and it prints "true" in console indicating that #wasSuccess() returned true, and the permission works until the user relogs. Am I forgetting something? Are there api docs for v4.4, if so where can I find those because the wiki is documented for v5
@storm zephyr you need to save the changed being made
how do I do that?
I think it's called save on the user object
Or similar
though in any case, I'd highly suggest you do not work on this right now
As the completely reworked API v5 should be released this week along the plugin v5
This can be a temporary solution, I just migrated from UPerms to LP and need to update my core plugin, before I can go online again
can't find any save method, looking in the javadocs
Ok I found UserManager#save(User), trying that now
Yeah that did it, awesome
👍🏼
A few notes
While the v5 API will be drastically different, there's an extension for v5 that will bridge the old API to the new one. So you'll be able to upgrade the plugin, and don't have to worry about updating your core plugin at the same time
Awesome, though I can roll both updates out in the same restart
Alright, thanks for the help, 'appreciate it
Why nobody is helping me???
@prime glacier i think people dont read all messages
@prime glacier yes you can. I don’t know how exactly but you can
question. is it possible with the API to set the chatformat
rip
Your chat plugin takes care of the chat format @misty hinge
^ thats the point. Im gonna make them myself
Then your custom chat plugin is in charge of formatting the chat @misty hinge
LP does not format the chat
I need help for LuckPerms, how do you do LuckChat and the Chat Prefix ?
For nukkit
i need help i got an null pointer exeption when i try to get the group of some body
LuckPerms.getApi().getUser(p.getUniqueId()).getPermissions() does this return all permissions for a player, or only permissions specifically set to them?
but i need the group for a tab plugin and chat
when will V5 api be public
ur a god Thanks!
@storm zephyr check the Javadoc of the method
Also I'd recommend you use API v5
Much better
yeah I will be upgrading soon
The package changed @misty hinge
It's now net.luckperms
As you can see in Luck's link
update wiki
¯_(ツ)_/¯
https://gyazo.com/da7b2f76587ecd54c508ace1f16ac8a9 leads to the old one
@ripe thorn the wiki guy to the rescue
the link should be updated to > https://search.maven.org/artifact/me.lucko.luckperms/luckperms-api
;p
no
ok wait
my brain farted for a moment
@crystal sonnet huh?
update wiki
tells me a lot
this new api makes my brain fart
@misty hinge There you go. PRs are made.
https://github.com/lucko/LuckPerms/pull/1816
https://github.com/LuckPerms/wiki/pull/24
thanks andre xD
also can someone help me out
how am i supposed to get the API now with v5
i had luckPerms = LuckPerms.getApiSafe().orElse(null); but that is obv not working anymore
!api
Learn how to use the LuckPerms API in your project.
@misty hinge ???
Be aware that everything changed
All classes are now in a different package
i noticed that
i think i just need to redo this line of code
// Get LuckPerms API
try {
luckPerms = LuckPerms.getApiSafe().orElse(null);
} catch (Throwable e) {
getLogger().emergency("Unable to get LuckPerms API! Disabling...");
getServer().getPluginManager().disablePlugin(this);
return;
}
thats my only issue im facing rn ;p
(i use nukkit btw)
idk if that rly matters
nvm solved it
How am i supposed to return both prefixes of a player as a string?
i'm using the track rank stacking thing
Thts DeluxeChat's fault, they didn't update the API yet,
so i should say use the older version of LP till DeluxeChat fixed it or make an issue towards Deluxechat.
@ashen remnant
oh ok
@wispy harness @ashen remnant or use the compat layer, as explained in #647869503576997918
Is there's any replacement for Contexts.global(); ?
Trying to obtain an instance of the api, but when I use the Bukkit ServicesManager, it says that LuckPermsApi can't be resolved to a type
Using LuckPerms 5.0.3
RegisteredServiceProvider<LuckPerms>?
thanks
On the api page, it says to use this code to check if a player is in a group
return player.hasPermission("group." + group);
}```
But is there a way to check if they are in a particular group, not using permissions but if they actually are in a group
Being member of a group is represented by a permission group.<groupname>
So this function does actually check if they are a member of this group
Yeah, but the permission "*" would make this redundant, as it would say you were in that group, even if you weren't
I'm not sure whether it would. Even so, it's not recommended to use "*".
But yeah, you're right, giving "*" permission also extends to group.anything. It's not treated specially in that regard.
If a user has multiple suffixes active, what will metaData.getSuffix() return for that user?
@fiery fossil @tight brook did you actually check that? I think there’s an exception for internal/functional nodes
And the reason it’s recommended to do it like that is because the code to cleanly check if the player is in a certain group is around 20 lines
Yeah when I checked it didn’t matter when I was opped or had the * permission
I just installed LP and I am having an issue with players not being able to break/build in world? I can't find the source of the problem
Do you have EssentialsProtect/Anti-Build installed?
how do you assign multiple groups using the api
Learn how to use the LuckPerms API in your project.
Yes obviously
did you try a loop
I mean all you do is add multiple group nodes to a player
Seems like everything in !api is kind of outdated for v5.0 (some classes don't even exist anymore), I'm just doing super simple things (just adding a player to a group, getting a player prefix, and getting a player suffix) so I'm just wondering how I could do that in v5.0?
This is what I used pre-v5:
https://pastebin.com/u27JFrii
Any ideas on how I could port this to v5? Thanks :)
!api
Learn how to use the LuckPerms API in your project.
@bright tapir i agree
nothing in https://javadoc.io/doc/me.lucko.luckperms/luckperms-api/latest/me/lucko/luckperms/api/LuckPermsApi.html is the right version for v5.0 there needs to be an updated javadoc
thanks :)
If you were running luckyperms with spongeforge on a singleplayer world how would you give yourself access to it ?
I'm curious, why would you need a permission system on a single player game?
Also, wrong channel #support-1
Hey
is it possible to update bulk though the API?
Trying to reset everyone who has a rank from b-z
(is a prison server)
Howdy.
public static String getPlayerPrefix(Player player) {
User user = Objects.requireNonNull(luckPerms.getUserManager().getUser(player.getUniqueId()));
QueryOptions queryOptions = QueryOptions.builder(QueryMode.NON_CONTEXTUAL).build();
CachedMetaData metaData = user.getCachedData().getMetaData(queryOptions);
return metaData.getPrefix() == null ? "" : metaData.getPrefix();
}
I've got this little method that's returning null no matter what. What am I doing wrong in terms of the API?
I'm using v5 API though, you can only pass in QueryOptions for getMetaData.
ooof
We don't even have Contexts anymore ;p
The wiki isn't much help because that's outdated too, I'm trying to mash it together using the Javadoc however I'm not really sure the intended usage.
I'm going to bet the QueryOptions is invalid or something
Learn how to use the LuckPerms API in your project.
Uh yeah so Uh like I was asking any quick way though the api / commands to remove users who have groups b-z
@crystal sonnet take a look at https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#the-basics-of-cacheddata
Hey TehBrian! Please don't tag staff members.
Oh, whoops, sorry.
But uh just take a look at that, you can see there's a CachedData#getMetaData(contexts) but in v5's API, #getMetaData doesn't accept contexts, it only accepts QueryOptions.
Hm. I see
I haven’t used the new API yet so I can’t help
I’d suggest raising an issue on the Wiki Repo
Alright, thank you.
Alright, I submitted it here: https://github.com/LuckPerms/wiki/issues/28
For example, https://github.com/LuckPerms/wiki/blob/master/Developer-API:-Usage.md#the-basics-of-cacheddata. In the Obtaining PermissionData and MetaData you can see this line: MetaData metaData = ...
👍🏻
how to get prefix of player in a bungeecord plugin? (for join/leave messages at proxy level)
I found how to do it, but weirdness is, using same code in a spigot server outputs different prefix than using same code in bungeecord
it gets player's personal prefix in bungee, not the group's
while it gets group's in spigot.. really weird
Is the output the same for both /lpb user <user> meta info and /lp user <user> meta info?
Hello, how can i give temporary rank through api? Is there a method for that?
I mean, there is something like JAVA @NonNull DataMutateResult setPrimaryGroup(@NonNull String group);
But i don't know, how can i handle it with temporary things, do i need to store the time that it was given, to the time i want to remove it? (ping me if you know answer)
Hi there. Until the wiki is updated with the new API, is there anyone who could help me update this little tiny method?
public static String getPlayerPrefix(Player player) {
User user = Objects.requireNonNull(luckPerms.getUserManager().getUser(player.getUniqueId()));
QueryOptions queryOptions = QueryOptions.builder(QueryMode.NON_CONTEXTUAL).build();
CachedMetaData metaData = user.getCachedData().getMetaData(queryOptions);
return metaData.getPrefix() == null ? "" : metaData.getPrefix();
}
I'm pretty sure the QueryOptions are wrong but I'm really not entirely sure how to use them.
Thank you.
Also, if anyone responds, please ping me :)
Learn how to use the LuckPerms API in your project.
When building a node, you can make it temorary
Okay thanks
I'm using a translator. Can I ask you a question here?
My Folder
Enter the server and enter /lp help or command.
Hi, looking into 5.0 and got some of our plugins adapted, but what would be the replacement for this one?
node.get().getSecondsTilExpiry()
I can get the instant but no idea how I would easily get the remaining seconds
Also getAllNodes got replaced by resolveInheritedNodes? But how would I use that one. I need all nodes that a player has(+ inheritances)
Learn how to use the LuckPerms API in your project.
Also it should be easy to google how to get the time difference between an instant and now @sudden kelp
These API changes are killing me :(
is the wiki fully updated with the 5.0 stuff?
because this is not working how I expected it to and the return values of the methods are different types
CachedPermissionData doesn't even have getPermisssionValue
so far I've got this but no clue how to continue
I gave up x)
Winners never quit
So, how can I use "QueryOptions" ?
well hopefully someone will either update the wiki or tell me the solution 🙂
What's the 5.0 equivalent of User#inheritsGroup()?
was the api remade recently or what happened
v5.0 changed the API from v4.0
There is a compatibility expansion but I'd rather just upgrade my API methods
unfortunately I can't figure out what I'm doing wrong and still haven't gotten a reply or any help 😦
would someone mind helping me add luckperms API to a plugin?
i want to change the way it checks for permissions to use permissionData.getPermissionValue("some.permission.node");
which as i see is a luck perms only thing, and i would need to import the api, but i dont know how to do that, and the tutorials i see are of no use to me really, cause its not my plugin from scratch
@karmic seal why?
idk if this should be here, but for some reason commodore doesn't want to work for me at 1.14.4
here's my code
public static void inject(JavaPlugin plugin, PluginCommand command) {
System.out.println(CommodoreProvider.isSupported());
if (CommodoreProvider.isSupported()) {
Commodore commodore = CommodoreProvider.getCommodore(plugin);
commodore.register(command, LiteralArgumentBuilder.literal("test")
.then(RequiredArgumentBuilder.argument("123", StringArgumentType.string()))
.then(RequiredArgumentBuilder.argument("bool", BoolArgumentType.bool())));
}
}
and when I run tab completion does nothing
(should open that link in browser as gifs doesn't get displayed in discord because discord is stupid and checks link endings and not content types)
@jaunty pecan sorry for ping, any idea what's wrong?
Hey MrIvanPlays! Please don't tag staff members.
In the new API, does the GroupDataRecalculateEvent get thrown when a group is deleted?
Hey, I am trying to create a rank expiry command for my players, but I can't find how to get the expiry date in the API. Thanks sincerely 
Try to get the node object the player has (by iterating over them until you find the right one) and then you get the expiry time from that node @remote salmon
but how do I get the expiry time from the node
As a tip. Make sure to include the source or javadoc jar in your IDE
Then you get Javadocs on hover
guys has anyone had issues with dynmap v3.0-beta-5-218 with the luckpermsapi cause i am getting NoClassDefFoundError?
[Server thread/ERROR]: Error occurred while enabling dynmap v3.0-beta-5-218 (Is it up to date?)
java.lang.NoClassDefFoundError: me/lucko/luckperms/api/LuckPermsApi
at org.dynmap.bukkit.permissions.LuckPermsPermissions.create(LuckPermsPermissions.java:26) ~[?:?]
at org.dynmap.bukkit.DynmapPlugin.onEnable(DynmapPlugin.java:848) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.14.4.jar:git-Paper-233]
Did you try adding the legacy api extension?
yes that doesn't help
Then i don't know, did you tried the Dynmap support? (If they have one)
There support form is a weight loss program filled peace of garbage
see for yourself
https://forums.dynmap.us/viewforum.php?f=3
@hushed condor how did you install the legacy api extension?
as stated above "yes that doesn't help"
How did you install
what lol download from the spigot page??
Erm no
oh sorry cant read lol
this form
You put the jar file in that new folder, right?
yes
I’m asking because it appears as the adapter isn’t loading
Not that I’m aware of
There’s a newer one
And weird. The link points to 1.0.0. I’ll check if there’s an update
When I’m on my computer
feature request add the command to check loaded extensions
dnymap works now lol thanks for the help on another plugin i also messaged the owner about the api update
how do you check if a user has a node with the new api?
before it was just user.hasPermission(node)
are you supposed to use user.getNodes().contains(node)?
Is that method gone?
yes, LP does no longer have that method
Is this not supposed to work?
LuckPerms luckPerms = LuckPermsProvider.get(); Node permission = luckPerms.getNodeBuilderRegistry().forPermission().permission("permissionhere").build(); luckPerms.getUserManager().getUser(player.getUniqueId()).getNodes().add(permission); luckPerms.getUserManager().saveUser(luckPerms.getUserManager().getUser(player.getUniqueId()));
I am having trouble adding luck perms api to my gradle build
i have
mavenCentral()
dependencies {
compile 'net.luckperms.api:5.0' ```
I'm unable to get a luckperms instance:
[22:13:19 ERROR]: Error occurred while enabling MyPlugin v1.0-SNAPSHOT (Is it up to date?)
java.lang.NoClassDefFoundError: net/luckperms/api/LuckPermsProvider
RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
if (provider != null) {
luckPerms = provider.getProvider();
}
I also have a softdepend on LuckPerms and I've observed LuckPerms loading before my plugin:
softdepend:
- LuckPerms
And LuckPerms are added to my plugins folder with my plugin:
net.luckperms:api:5.0
And my pom:
<dependency>
<groupId>net.luckperms</groupId>
<artifactId>api</artifactId>
<version>5.0</version>
<scope>provided</scope>
</dependency>
Update your luckperms ingame
@turbid solar you respond to me or the one before?
You
What do you mean by updating ingame? I just downloaded a fresh copy of luckperms jar from spigot resource page.
🙃 thx, I'll check that
@tropic jewel I don't know if im doing it right but I am using the following:
if (user.data().contains(node, Node::equals) == Tristate.TRUE) {
user.data().remove(node);
luckPermAPI.getUserManager().saveUser(user);
}
for groups do forInheritance().group("group.[group-name]")
instead of /forPermission().permissioN()
huh actually I think the group builder adds the "group." part for you
so just put the name
I ended up just collecting all the groups and checking if the group is in the collection
as I couldn't figure out how to check for temporary groups in the new API, it was already a hassle to do it in the previous one
I am having trouble adding luck perms api to my gradle build
i have
mavenCentral()
dependencies {
compile 'net.luckperms.api:5.0' ```
though this doesn't work if the group is inherited from a different one
how did you check temporary groups in the old one?
I never figured it out
does your collection method work on temporary groups for the new API?
also for anyone wanting to support both:
private IPermission selectLuckVersion(Plugin plugin){
String versionString = plugin.getDescription().getVersion();
String[] parts = versionString.split("\\.");
double totalValue = 0;
double valueMult = 100;
for(String part : parts){
double partValue = 0;
try {
partValue = Integer.parseInt(part) * valueMult;
} catch (Exception e){
//do nothing
}
totalValue += partValue;
valueMult *= 0.1;
}
return totalValue >= 500 ? new Permission_LuckPerm5() : new Permission_LuckPerm4();
}
I wrote some logic to get the current version
it does, just not for inherited groups
ok so for the old API I have to check two nodes.
for the new one should I use this:
return user.data().contains(node, Node::equals) == Tristate.TRUE;
or do I need to do something else to get temporary groups as well?
user.data().contains(node) didn't work for me with temporary groups
huh
maybe it has something to do with the node
I bet I have to check two different nodes
it also didn't work the old way because it was comparing the expiry time
but expiry time didnt matter in 4.0?
yes, you only had to set a expiry so it creates a temp node but the time didn't matter
what I didn't look into yet is how to collect the parent groups too like if group2 is a parent group of group1
Node node = luckPermAPI.getNodeBuilderRegistry().forInheritance().group(troop.getGroup().toLowerCase()).build();
Node tempNode = luckPermAPI.getNodeBuilderRegistry().forInheritance().group(troop.getGroup().toLowerCase()).expiry(10L).build();
return user.data().contains(node, Node::equals) == Tristate.TRUE || user.data().contains(tempNode, NodeEqualityPredicate.IGNORE_EXPIRY_TIME) == Tristate.TRUE;
use user.data().contains(tempNode, NodeEqualityPredicate.IGNORE_EXPIRY_TIME))
ah thanks, I will try that out
I assume that ignore expiry time just means it will not compare the time but still respect if the assigned group has expired
is there a way i can give a player a permission through another plugin?
@sour basalt use the api or run the command
use the api
like say i wanted to give a player "luckperms.*" how would i do that through the api
should be explained on the github wiki
its not and if it is is there a way for you to show me where (if it is there i cant find it)
i cant find it
look up in this chat
I wrote out the code for removing a node
just replace .renove(node) with .add(node)
thank you very much
np
@nocturne elbow just tried the data contains but it doesn't work for inherited parent groups either
so It wont recognize a group node check if the user has a group that inherits the permission of the target group?
will the inherited group show up under the parents list when you do /perms uer [user] info?
sorry im not too familiar with how luck perms works
it doesn't show up there but under the group itself /perm group [group] info
ah. Well I guess for how im using the plugin, I dont want it to check
I think your best bet is to check all the groups nodes for children
im getting an error 'cannot resolve getNodeBuilderRegistry in LuckPermsApi
me?
im using intelijso i dont know what version im using
huh. I am also using InteliJ, but I usually download the jar then add it to my project as a provided dependency.
I dont really know the other ways of accessing the classes, but your imports should start with net instead of me
if they start with me then your using the old api
oh ell there is a plugin you can get on it which add all the dependencies
I am having trouble adding luck perms api to my gradle build
i have
mavenCentral()
dependencies {
compile 'net.luckperms.api:5.0' ```
"3rd time ive tried getting help with this now"
Here is my exact gradle build
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '4.0.4'
}
group 'HyskiesPrison'
version ''
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/sonatype-nexus-snapshots/' }
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.11.2-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT'
implementation group: 'org.slf4j', name: 'slf4j-simple', version: '1.6.1'
compileOnly fileTree(dir: "jars", include: "*.jar")
compile 'net.luckperms.api:5.0'
} ```
@crystal sonnet No error just wont compile the api
Hey Milkmaid! Please don't tag staff members.
well it wont include it
How can you tell?
when i try and use the api in my source code its erroring out bc the api is not there but i will try compileOnly
Is it throwing errors in the IDE or when compiling with gradle?
compiling
the name of the class?
@crystal sonnet would u like to see the error when i try to build it?
Hey Milkmaid! Please don't tag staff members.
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find net.luckperms.api:5.0:.
Required by:
project :```
There you have an error.....
It’s net.luckperms:api:5.0
xD thanks
* Where:
Build file 'C:\Users\zachx\floobits\share\zachx\HyskiesPrison\build.gradle' line: 22
* What went wrong:
Could not compile build file 'C:\Users\zachx\floobits\share\zachx\HyskiesPrison\build.gradle'.
> startup failed:
build file 'C:\Users\zachx\floobits\share\zachx\HyskiesPrison\build.gradle': 22: expecting '}', found ':' @ line 22, column 30.
compileOnly net.luckperms:api:5.0
^
1 error
Put it in ' of course...
jesus you got me confused
Or " if you prefer
whats the best way to get a users group + the prefix
for a AsyncPlayerChatEvent method
how can I get the prefix for the new api?
Did you get it? I also need to know @dusky wagon
uhm someone have a current expantion for PlaceholderAPI? seems to be acting funny, I was on 4.4.16 Spigot had 4.4.1 as the latest build
LuckPerms-Bukkit-4.4.1
PlaceholderAPI-2.10.4
expansion 5.0
Hi, I tried to remove a Node on a player with user.getNodes().remove(node) and I got this error thread :
https://pastebin.com/ESyvrqNs
What should I do if I receive a node for a user and I want to delete it
@swift portal there should be a method on the user to remove a node
user.getNodes().remove(node) ?
what should it be ?
Don’t you have tab complete in your IDE?
I do, but I already tried those :
user.getNodes().remove(n);
user.data().remove(n);
user.getData(DataType.NORMAL).remove(n);
I'm maybe dumb, and that's a thing that we have to consider
So it is here
But what should I do ?
user.removeNode?
As I’ve mentioned four times now, try finding the remove method on the user object directly
And delete?
same here
No problem, I think I should sleep so maybe someone would know when I'll wake up
@crystal sonnet do you think you can tag someone to help me ? ^^"
Hey Bakalexis! Please don't tag staff members.
@jaunty pecan
Is there a way to modify the prefix with the api like "&6VIP" -> "&l&6VIP" (or reverse to "&l&6VIP" -> "&6VIP"? I want to modify the key without touching metadata and context.
With LP4.x I used:
api.buildNode(n.getPermission().replaceAll("&l|&o", "")).copyFrom(n).build();```
But with the recent changes I don't see a good way to do that.
can nobody help me?
Do luckperms contains Player Group Change Event? or Player Permission Change Event
Yes they are
But setting the primary is pointless because it is automatically calculated (except under very very rare conditions)
I'm gussing you want to either add or set a group
set
Remove all other group nodes and give them the new group node
As I said the primary group is calculated
So setting it does nothing
Setting the primary group does not equal to giving the player the group
It merely selects which group the player has
is there like a GroupNode class or something
this is confusing
where the docs at
!api
Learn how to use the LuckPerms API in your project.
I already read that


