#luckperms-api
1 messages · Page 55 of 1
private bro
LuckPerms api = LuckPermsProvider.get()
well this is up to you
no not in that way
and your preferences
well what should be the best
getting it as a local variable is not recommended
why
since this can fuck up things if you're working on different threads
not sure if luckperms has thread safety
goddamn it
AHHAHAHA
so many things
okay
and how should i get player rank for example
just read the api
it explains that very clearly
i will
ty for helping me out ❤️
I believe that's what you need
np
!extracontexts
Add contexts not supported by stock LuckPerms.
@fringe torrent Is there anyway can i get use of the DateMutateResult

R.I.P
!hack
Most certainly: no. In most cases a 'LuckPerms exploit' is a simple case of human error, which can be avoided easily. Look below for some tips to be on the safe side.
While this should be obvious, a lot of times a exploit can be traced back to faulty permission settings. You should always take your time with permissions and read the plugin documentations. In 99% of all cases the plugins have documentations explaining each permission, in the rare case that the plugin you are using does not have a documentation, you could still:
A: Ask the plugin developer for help
B: Use LuckPerms verbose functionality ( !verbose )
C: Select a different plugin with proper documentation.
If you are running your server or network in offline mode, hackers have it really easy to steal your, or any other admins identity. While the server is in offline mode, certain checks ( which exist to prevent exactly this ), are being skipped, and the server does not verify if the person joining actually is the person they claim to be. While there may be plugins which increase the security of offline mode servers by adding things such as admin codes, you should just switch it to online to prevent the issue in the first place.
You should never put anything on your server which has not been downloaded by yourself from official sources. Plugins can be infected with malware which injects itself into all other plugins, and thus is hard to remove. While it may look like a plugin has been hacked, you most certainly downloaded a modified version of it and it is not the plugin authors fault. In case your server has been infected by such malware:
- Stop the server
- Delete all plugins in your plugins folder, and just to be safe also the server jar file
- Re-Download all plugins and server jar files from official websites such as SpigotMC or official plugin websites ( luckperms.net for example ).
- Check if there have been any modifications to the permission system and remove unknown users and wrong permissions.
if you follow these steps you should have a clean server by the end, without exploits.
Hey guys
when i try to load a user
from LuckPerms
and the user is offline
it can't load it
it returns null
@Override
public @NonNull Group getPrimaryGroup() {
AtomicReference<Group> group = new AtomicReference<>(null);
this.toLuckPermsUser().whenComplete((user, throwable) -> {
if (throwable != null) {
throwable.printStackTrace();
return;
}
if(user != null) {
Group g = LuckPermsProvider.get().getGroupManager().getGroup(user.getPrimaryGroup());
group.set(g);
}
});
return Objects.requireNonNull(group.get());
}
does anyone know the issue ?
LuckPerms unloads offline users
ik , but im loading it bruh
this method shouldn't get it from the memory
Sure seems like it's unloaded still
it loads in a separate thread
and the operation might finish in the future
but you try to return immediately
i ain't putting that in the main thread 😛
how can i like sort the tasks
even if they're being executed in different threads
return a CompletableFuture<Group>
or block the main thread until the operation completes 
hell no
i was actually thinking of that
your call, not mine, i'm just giving you options
is there a way to make a future callback ?
you could also make that function take a Consumer<Group> instead of returning a future<group>
yeah that's what completable futures are for
thenAccept, thenApply, whenComplete etc
ye but like returns the value when it's completed somehow lol
nvm
if you return a Group, you need to wait until it's completed
either return a future or take a consumer which you call in whenComplete
is this fine @nocturne elbow
Hey Mqzen! Please don't tag helpful/staff members directly.
Apologies Mr Clippy
yeah that looks fine, what's the impl for getPrimaryGroup?
returns a completable future of the primary group object
still modifying the impl
why i feel there's something wrong
looks fine, I don't think user can be null but it's okay
ty emily i really appreciate your help
it worked !
loaded the use successfully
btw do you have any good resources to get more deeply into Completable Futures
Hello everyone! Im doing a plugin whitelist-like.
When i do the comparison from a COFNIG PERMISSION and a LP PERMISSION
As you can see from minecraft they are the same,
But "hasAccess" never turn on true, you know why?
Yellow = config
Green = Luckperms
java is so cool and intuitive
i would recommend breaking from the loop immediately when you assign the hasAccess variable
it would kinda improve performance
and skip unnecessary iterations
Yes i know
I have toggled the break just for test
Thanks anyway, awesome community
(apparently I left this message here since yesterday without sending it lol)
Mmh Baeldung's guide to CF's is nice https://www.baeldung.com/java-completablefuture and the javadoc can be useful too, although a bit too wordy https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/CompletionStage.html
There are a few conference talks online about how to use them, why they're nice etc etc, the ones from this speaker are quite good IMO https://www.youtube.com/results?search_query=venkat+subramaniam+completablefuture
#KotlinLove
Hello! I'm trying to connect LP to my server's site where users can assign themselves a LP group by clicking a button. So what the best approach to do something like this? Now I'm adding group.some permissions to the lp_user_permissions table. This works fine, but I'm curious how bad this practice is
Well in an ideal world, you'd add the node via our API, LP isn't really designed with external DB modification in mind. I suspect it'll mostly work, but you'd probably need to also send a message via whichever messaging service, or otherwise trigger a resync
Ah, I see, so the best way is to write a small plugin that can be triggered externally and send updates to the LP API?
that's the ideal method, yes
OK, thanks
it's ok
Thanks for these awesome resources
net.luckperms.api.LuckPermsProvider$NotLoadedException: The LuckPerms API isn't loaded yet!
This could be because:
a) the LuckPerms plugin is not installed or it failed to enable
b) the plugin in the stacktrace does not declare a dependency on LuckPerms
c) the plugin in the stacktrace is retrieving the API before the plugin 'enable' phase
(call the #get method in onEnable, not the constructor!)
at net.luckperms.api.LuckPermsProvider.get(LuckPermsProvider.java:53) ~[?:?]
at cz.gennario.minecraftdiscordsync.Main.onEnable(Main.java:49) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:599) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:298) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
at java.lang.Thread.run(Thread.java:833) [?:?]```
Anyone know what's causing this? I've checked depends and luckperms is installed and loads before this plugin
Have you checked all 3 things the error lists
I have yes
depend: [LuckPerms, LiteBans]
Is that the proper format?
Make sure you are not shading the LP API inside your jar file
I have no idea what that means haha, I'm not a dev just had this plugin made and the dev is now MIA. If any of you guys are freelancers I'd be more than happy to pay for you to take a look at it and fix whatever is causing that error
Not a marketplace
Open up your built jar with any tool that can open .zips, see if there's LP files in there (net/luckperms/...)
Yep, there is.
Yup ok you're shading LP (including it in your built jar)
folder called "api"
What build tool are you using?
I used winrar to look at it if that's what you're asking?
Nope, what tool are you using to build the jars? Maven? Gradle?
(put differently, how are you building jars?)
I am not, I had a developer make the plugin for me and they went MIA after payment, unfortunately.
wonderful...do you have the source code?
I do
ok root directory, is there any files pom.xml, build.gradle, build.gradle.kts?
None of those
could you show what is in the root project directory?
That's not source, that looks like the result of unzipping it
wonderful...all right long shot that may or may not work:
make a copy of the jar, and unzip it. Delete the luckperms folder in net (if there's nothing else in net, you can delete it too)
rezip the files and rename it back to a .jar.
I'm not 100% sure that'll work, but without source code that's the best I can really do short of having to rebuild the entire plugin
deleting the luckperms folder from the zip should work :]
you may also need to delete META-INF
ok good, wasn't 100% on that
Trying this now, I appreciate all the help
Starting the server now
Worked! Thank y'all
I appreciate it
??????????????????????
Have a bit of patience and don't crosspost, when someone who knows is available they will, if they want, help
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
lp user player parent info
that’s not api
yo i need help because i can't use luckperms in my plugin. i have it in project structure
well you need to get the instance first
also idk if adding that constructor works for bukkit plugins
and that error at the end of the ctor is you trying to set the luckperms variable to itself
Hello i have a question i updated my plugin from 1.16.5 to 1.18.1 and i had a luckperms code in it for my scoreboards. And now i updated the dependencies & everything and now it says that on the pic can anyone help me pls?
And on the server is the newest version of luckperms
that error gives possible causes, have you checked all of them?
have you shaded LP?
no bc i used it for my tablist and scoreboards and before i updatet it to the 1.18.1 version it worked fine
The error comes from this code
what build tool are you using?
maven, the luckperms version i have in my pom.xml is the 5.4 and the plugin version from the luckperms plugin is 5.4.35
in your pom do you have the LP dependency set to scope provided?
Idk what i can do know bc of the errors it doesnt load the tablist and sb
when are you calling updateRang
here
On my second server it works with errors so idk what i did false 😅 (the same errors i already sent)
and is 1to1 the same code
Anyone knows how to fix it?
Hello!
I have question, which event I need to use to get when user is demoted?
For example:
/lp user Norbiros parent settemp vip 30d
And when user is promoted, I can use UserPromoteEvent, but when that rank will expire, UserDemoteEvent will be executed? Maybe this code: https://github.com/LuckPerms/api-cookbook/blob/master/src/main/java/me/lucko/lpcookbook/listener/PlayerRemovedFromGroupListener.java will work? If no, please tell me how I can detect it
UserPromote/DemoteEvent should only be fired when they're promoted/demoted on a track according to the javadocs
