#luckperms-api
1 messages · Page 54 of 1
What did you do to define uuid
i think you need to get it as a UUID object first
Main.luckPerms.getUserManager().getUser(uuid) work for uuid string 😢
ho wait
string is only for username !
UserManager.getUser() accepts either a username as a String or a uuid as a UUID
getUser(@NonNull String username);
getUser(@NonNull UUID uniqueId);
i will try with UUID

you should be able to do UUID.fromString(string) to turn your uuid string into a UUID object
yes
thank you is done 🙂
i have a another question, if player is not online, it's possible to get the prefix?
user is null 😢
you have to load them first
Main.luckPerms.getUserManager().loadUser() ?
Evidently, yes
stop
No 
What does the error tell you
doesn't exist
does it compile when you try to actually build it?
Have you tried invaliding your caches
Can you share your pom file
Also what does it say when you try to run the package task?
Please use https://pastes.dev to send files in the future. I have automatically uploaded message.txt for you: https://pastes.dev/nj2JYFvgLG
What about this?
hm I just clear my cache and re download everything and it's working
hey, how do I compile LuckPerms and get the artifacts pushed to my maven local? ./gradlew publishToMavenLocal doesn't seem to put anything in my .m2
you might need to add this to the build.gradle's you want to install
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}
it's not setup to publish anything by default
The docs tell you how to make an instance of the luckperms api
🤨
Please use https://pastes.dev to send files in the future. I have automatically uploaded message.txt for you: https://pastes.dev/oKhGM0dQMK
anyone know the issue?
you know, I prob didnt do it right
oh
because its
null
OHHH I DONT HAVE LUCK PERMS INSTALLED!
Lole!
Read the docs. There is instructions in the cookbook for that
Hey! I have some problems. I want to get the role of a player in Luckperms API but it doesnt return something. I run the luckperms version for bungeecord v5.4.23
Do I have to install luckperms for each server?
are you trying to use the API on a backend server?
LPB is for managing proxy permissions, LP should be on all servers if you want to manage the permissions on that server
So i have a plugin. And everytrime a player sends a message, the prefix should be changed based on the role. And the Plugin is on the spigot server. The problem: I cannot get the group. Do I have to run the plugin on the bungeecord? And how i can get the message from the spigot?
If you're trying to access the api on the spigot server, you need to have LP on the spigot server.
but then i have locally permissions?
wait
If i install LP on the spigot. Are the permission the same as in LPB?
When synced to a remote db, you can share the same permissions/meta across all LP instances
!network
If you run a BungeeCord network, learn how to correctly setup LuckPerms on all server instances (including Bungee).
Syncing data between servers
thank you, i will try
case "npc-vaultkeeper" -> {
List<String> iRanks = new ArrayList<>(List.of(
"group.default",
"group.lite",
"group.elite"
));
if (iRanks.stream().noneMatch(player::hasPermission)) DonorVaults.open(player);
else {
send(player, "vault.insufficient_rank.open_gui");
pling(player);
}
}
);``` hi! I'm running this code on my server to only allow certain ranks to interact with an npc, and even after I opped myself *and* removed myself from all the mentioned groups, i'm still getting the insufficient ranks message.
You are running DonorVaults.open if you don't have any of those permissions, if you do have any you're sending the message
yeah that's the idea
And being opped (at least by default) means you would have them
i removed all groups from myself except group.developer
still wouldn't let me open
ah
so i would just check for not opped and has one of those?
I would use the LP API directly instead of Bukkit's but you can do that, yes
You would also need to make sure, in your permission setup, that developer group does not inherit from default (or any of those groups for that matter)
what's the lp api way?
the docs seem to recommend just using hasPermission
Well it's one way, but I'd check in PermissionHolder#getInheritedGroups
is it possible to register permission descriptions in luckperms?
nvm that doesnt exist eh
@Override
public void registerPermission(String key, @Nullable String description, PermissionDefault def) {
if (def != PermissionDefault.TRUE) {
return;
}
groupManager.loadGroup(DEFAULT_GROUP).thenAcceptAsync(defaultGroup -> {
Group group = defaultGroup.orElse(null);
if (group == null) {
try {
group = groupManager.createAndLoadGroup(DEFAULT_GROUP).get();
group.data().add(WeightNode.builder(0).build());
} catch (InterruptedException | ExecutionException e) {
Logger.getLogger().severe("Failed to register create and load 'default' group:");
e.printStackTrace();
return;
}
}
group.data().add(PermissionNode.builder(key).value(true).build());
});
}
Is this an alright way of essentially registering default permissions?
Also, nodes are completely immutable right?
I was just missing GroupManager#save(Group)
How do I register permissions in the permission tree?
can i get perms of luck perms
wut
does luckperms have groups cache? if so, how can I check if there is already cached group data before trying to retrieve it async from the database?
luckperms.getGroupManager()
how can I use Luckperms API with bungeecord?
Why does luckperms do the jarinjar thing?
Also is the plugin ID on bungeecord in fact LuckPerms ?
I have
softdepends:
- LuckPerms
and
@Override
public void onEnable() {
//...
BungeeCordServerHandler serverHandler = new BungeeCordServerHandler(
this,
audiences,
pluginPresent("LuckPerms") ? new LuckPermsHook() : PermissionHook.empty()
);
yet my onEnable seems to be called before luckperms
as shown here: https://mclo.gs/i1HyBxx
I checked LP's bungee.yml but idfk
do it in the constructor
i don't see how that would help unless to debug the line
the log shows that luckperms is loading after my plugin
private final GroupManager groupManager;
public LuckPermsHook() {
groupManager = LuckPerms…..
}
instance fields are initialized right before constructors
what i said should work
oh mb
its my static shit
regardless that doesn't change anything
LP is still being loaded after
maybe a whitespace issue in the yml
Hi! Can I use the LuckPerms API in a velocity plugin?
Getting Cannot resolve symbol 'LuckPerms'
i'm using maven and have added net.luckperms in dependencies
nevermind, LuckPerms api = LuckPermsProvider.get(); works just fine I just had to reload the maven project
Is there a ServicesManager alternative for velocity? I want to use LuckPerms API after it has loaded and simply adding it as dependency doesn't seem to do the trick. ideas?
soft depend on luckperms
then whatever the onEnable equiv is for velocity do luckPerms = LuckPermsProvider.get();
!api
Learn how to use the LuckPerms API in your project.
How to sort rank on luckperms?
wdym sort?
That’s your tab plugins responsibility
Try giving them proper weights & check your tab plug-in config
also, unless you are creating your own tab plugin, this isnt the channel
hey so does anyone know how to display the prefixes when you press tab like the guy above me did? if so prefferably without essentailsX as it causes problems with other plugins on my server
!tab
LuckPerms only acts as the source for prefixes / suffixes, it doesn't actually apply them. You need an appropriately configured chat/tablist formatting plugin for them to be displayed. If the values appear correctly when you run /lp user <user> info, LuckPerms is doing its job!
When doing this, players who have OP or * always return true... what's a way to check groups that doesn't have that caveat?
I've tried this method and now it seems that it doesn't even matter if they have the group or not
It just returns true 100% of the time
i think you also could’ve done isPermissionSet ?
ok so i have managed to get the tablist to display my color but how do i display my prefix in the tablist
Hi, I want to grab a meta value from a player.
I got this:
CachedMetaData metaData = user.getCachedData().getMetaData();
return metaData.getMetaValue("griefdefender:accrued-blocks", Integer::parseInt).orElse(0);
That works, but grabs the value from this server. As this metavalue exists on every server, I need to somehow tell LP the ServerKey of the server I need get the MetaData from.
How could I do that?
There's a getMetaData that takes a QueryOptions, you'd use the QO.builder and add to it whichever context set you desire
Thanks I am struggling when adding a ContextSet to that queryoptions though. How would I build a simple Context with just the SERVER_KEY?
Ah found it thanks!
hey there, i have this code for checking an offlineplayer's permission(s), but it doesn't seem to work, right before that there's a chunk of code that checks the same permissions if the player is online (if (online) {code} else {lp code}) and it works, but when the player is offline it doesn't
OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
UserManager userManager = lp.getUserManager();
CompletableFuture<net.luckperms.api.model.user.User> userFuture = userManager.loadUser(uuid);
List<String> permissionCountries = new ArrayList<>();
userFuture.thenAccept(
user -> {
QueryOptions options = lp.getContextManager().getQueryOptions(player);
CachedPermissionData data = user.getCachedData().getPermissionData(options); <--- also tried without options
// TODO FIX THIS
if (data.checkPermission("bteconosur.projects.manage.country.ar").asBoolean()) {
permissionCountries.add("argentina");
}
if (data.checkPermission("bteconosur.projects.manage.country.bo").asBoolean()) {
permissionCountries.add("bolivia");
}
if (data.checkPermission("bteconosur.projects.manage.country.cl").asBoolean()) {
permissionCountries.add("chile");
}
if (data.checkPermission("bteconosur.projects.manage.country.pe").asBoolean()) {
permissionCountries.add("peru");
}
if (data.checkPermission("bteconosur.projects.manage.country.py").asBoolean()) {
permissionCountries.add("paraguay");
}
if (data.checkPermission("bteconosur.projects.manage.country.uy").asBoolean()) {
permissionCountries.add("uruguay");
}
}
);
permissionCountries.forEach(country -> Bukkit.getConsoleSender().sendMessage(country)); <--- debug
return permissionCountries;
loadUser (and anything that returns a CompletableFuture) runs async to not perform blocking IO in, potentially, the main thread
By the time the user is loaded and the thenAccept action runs, your method will have had returned already long ago
Either .join/.get on the future to block and wait until it's completed (smelly code, bad, blocking) or return a CF<List<String>> instead, do thenApply and pass a function that returns the list (good, non-blocking)
then why is there a thenAcceptAsync() 🤨
that always ensures the action you pass runs on a different thread
because it exists the possibility that the returned future already completed, and if that's the case thenAccept will run in the current thread
the entire idea around CFs is that they are non-blocking and the "current thread" never stops to wait until the result returns
How do i find the weight of a group by a given prefix?
i did this but idk if its going to work
u.getNodes(NodeType.PREFIX).stream().filter(n-> n.getKey().equals(prefix)).mapToInt(ChatMetaNode::getPriority).max().orElse(0);
how to check if an offlineplayer has an X permission?
has 1.19 been released for luckperms?
hey guys
how is excatly determined which mysql driver is unloaded?
if other plugin loads other driver before luckperms may it be unloaded by mistake in this code above?
@hollow quiver
LP uses a relocated "version" to me.lucko.luckperms.lib.mysql, and that string right there is relocated as well so it won't clash with another mysql driver
@nocturne elbow are you sure?
Hey Cubixmeister! Please don't tag helpful/staff members directly.
Do you know what relocation is?
sure, but i see literal string in code, not an import - maybe i'm wrong
String literals are also subject to relocation
ok
You can easily check so by decompiling the compiled class for that file (from inside the relocated, final jar file)
Do i get an event, when a temp punishment expires?
LuckPerms has punishments now? 👀
probably referring to meta
I figured :D
oh
When a temp permission expires
server.getCommands().performCommand(server.createCommandSourceStack(), "lp user complacentsee group add great");
Trying to be lazy and interact with LuckPerms through the console - this works for say/gamemode but when running a luckperms command it gets unhappy with a very unhelpful log in the server console
[22:55:39] [Server thread/INFO] [minecraft/DedicatedServer]: Incorrect argument for command
[22:55:39] [Server thread/INFO] [minecraft/DedicatedServer]: ...lacentsee group add great<--[HERE]
Anyone know why this wouldn't work?
Having to do this as I can't use the proper LuckPerms api with Forge 1.16.5
why not 

Hello buys, I’ve asked for some api-help, so if you don’t mind, could I ping you here to ask for help?
!cookbook
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
I was told in support-1 I was getting classnotfounderrors due to Forge 1.16.5 not supporting permission apis
is this not true?
If so, any idea why I was getting those errors? Will grab message link with code, errors, and build gradle
Are you using the Sponge build of LP? Because the Forge build only works on 1.18.2 afaik so naturally there is no LP build using the "official" permissions API before then
Ah, in the message after that I mention that I'm using LuckPerms Bukkit & Arclight
Could that be why the command isn't being recognised from the mod, even though it's recognised through the console?
ah no clue about hybrids
Going to go run and cry into the Arclight discord now lol
i have this code to grab the primary group of a player, is there a way to get the display name of the group? I haven't been able to find one
User user = luckperms.getUserManager().getUser(uuid);
String pteam = user.getPrimaryGroup();```
!cookbook
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
ive looked through it and havent found something to get the displayname
to get the group i have to do getGroup() right? beceause i keep getting Cannot resolve method 'getGroup' in 'LuckPerms' when i use that
check the xookvook
*cookbook
thanks!
how to get days to group expire
Thanks
Hey guys, i copy, pasted and adjusted the code from the api-cookbook for registration of a NodeAddEvent, my problem is that the event doesnt get fired.
Source-Code: https://p.koboo.eu/show?p=58e32ee2-ce19-4dec-9a57-ca8ee5aad296
Bungeecord-Dump: https://p.koboo.eu/show?p=7872d4d9-af23-4f4f-9546-eeed4dd1a877
Someone has a clue why this isn't working?
I tested the same code on the bukkit-module of the project and that is working. Does LuckPerms for BungeeCord has another API than the bukkit-part?
Hi, I would like to query the following meta note from a player with that given context:
But this code returns 0
ImmutableContextSet serverSet = ImmutableCo
ntextSet.builder().add(DefaultContextKeys.SERVER_KEY, "pixelmon2").build();
var queryOptions = user.getQueryOptions().toBuilder().context(serverSet).build();
var metaData = user.getCachedData().getMetaData(queryOptions);
return metaData.getMetaValue("griefdefender:accrued-blocks", Integer::parseInt).orElse(0);
it's a ., not a :, lol
hm think I tried that. What about that backslash? Let me try again
wot
Whatever it is, it has to match
I believe that meta keys can have dot separators
you only need to query for the griefdefender.accrued-blocks
the backslashes are so LP can distinguish between meta, the key and the value
there’s such a thing?
yes look at the screenshot
interesting
the backslash is only for storage purposes, not something you should query for or rely on
Well I know that, didn’t realize LP would add the backslash though
Thanks!
was about to say as a \ is not a valid part of a string, at least when its not escaped
well it depends on how the reader (in this case, LP) interprets and represents it
I cant seem to find a event for when a group is changed?
Define "a group changed", like you mean a group's nodes are mutated? Parent added/removed?
mmk listen to NodeMutateEvent, filter if it's a user, and then check if the node is in the form group.GROUP_NAME.
(can easily filter for a specific group if you need that behavior)
Yea, well im using skript with skript reflect and im importing events to update my scoreboard when a user is added to a different group
so i really dont know how to filter it, but ill try it
yeah uh hacky skript stuff isn't really supported. Your milage may vary.
Do note that since LP is cross-platform, it doesn't use the Bukkit event system, so I don't think skript can even listen to LP events
yea it didn't seem to understand UserDataRecalculateEvent it says it isnt a bukkit event, so yea it prob wont
Its fine then ill just update it every x second instead of events :P
Thx for the help though!
🙃 seems like a performance hog but whatever they're gone
how would i add a permission node to a user?
!cookbook
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
hi
how can i add group to player
i couldn't find in the cookbook
I didn't understand :/
@sudden kelp good song, love Odesza 
Hm its quite basic.
You get the actual group by groupname. eg. "admin"
https://github.com/LuckPerms/api-cookbook/blob/master/src/main/java/me/lucko/lpcookbook/commands/SetGroupCommand.java#L46
you create a group node:
https://github.com/LuckPerms/api-cookbook/blob/master/src/main/java/me/lucko/lpcookbook/commands/SetGroupCommand.java#L62
you add ti to the user:
https://github.com/LuckPerms/api-cookbook/blob/master/src/main/java/me/lucko/lpcookbook/commands/SetGroupCommand.java#L65
save the user with getUserManager().getUser(user).save()
I tried something butt..
Hm seems like you need to learn some basic Java first. Please also read the Luckperms api wiki. Its linked in the channel description. It tells you how to access the luckperms api
Hello, is there a way to negate a permission for player?
/lp user <user> permission set <permission> false
I ment by using API.
But i found it, just didn't look properly at the wiki.
EDIT: For anyone wondering, its User#data().add(Node.builder("your.permission.node").value(true/false).build())
do i have to do anything else when promoting a play in a track using the API? Some reason the players are actually being promoted
so.. it works?

aren’t * mb
Are you saving the user with the usermanager?
i figured it out, thank you though
Yo, any easy way to check if user has permission if i have only UUID?
Hi, does luckperms api works in bungee plugins?
yea, u got same api
yes
Hi, i’m currently creating a fake player, using differents bukkit events. When i use luckperms, my fakeplayer cant connect on the server because there is this error:
anyone know how to fix that ?
are you creating a Player or a HumanEntity?
because a Player should only really represent an actual player with an actual connection to the server
while HumanEntity can be used to make it look like there is a player somewhere
How do i? i dont see any thing like Player.hasPermissions and idk how to use these nodes
its exactly what i do because i just want to represent real player, so i create à player
edit: find cause, thx for ur help
at io.github.divinerealms.utils.Helper.getPlayer(Helper.java:34)```
line 34 is `final UserManager userManager = getLuckPermsAPI().getUserManager();`
```java
public User getPlayer(final UUID uniqueId) {
final UserManager userManager = getLuckPermsAPI().getUserManager();
final CompletableFuture<User> userFuture = userManager.loadUser(uniqueId);
return userFuture.join();
}```
and I added luckperms in my main class like
```java
private LuckPerms luckPermsAPI = null;
// inside onEnable logic..
if (!setupLuckPermsAPI()) {
// disable plugin ..
}
private boolean setupLuckPermsAPI() {
RegisteredServiceProvider<LuckPerms> lpp = getServer().getServicesManager().getRegistration(LuckPerms.class);
if (lpp != null)
setLuckPermsAPI(lpp.getProvider());
return getLuckPermsAPI() != null;
}
https://github.com/DivineRealms/LeagueManager added it on github to make it easier
Problem is that you instantiate the Helper class before setting up LP, so in the helper constructor, LeagueManager#getLuckPermsAPI will return null
Thank you!
Hey, how can i get a Group object from user?
!cookbook
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
How do you get a user's group using a web request
like make your server send the user's luckperms rank when a request is made
make a web server in your own plugin for that
i have a question how do i add more commands to the luckperms since i want admins to be bale to tp and chage gamemode
wrong channel
for the api i saw you can get the players top prefix but i was wondering if you can Set the players prefix to smth and it will ignore the priority values and not rename. / mess with anything. Or if there is a way to set a users prefix in their personal value but not just replace that one.
I mean you can set a prefix node on a user and crank the weight higher than any of the normal prefixes
I know that was what i was going to do but is there a way to re edit that same one without adding a new one ( Did i miss it when looking through api )
wdym edit?
I was going to make it add it the the user personally and make the weight higher then every other one but didnt see the method for changing it, ik how to get it
like if i want to rename the prefix to smth else
is there a method for renaming or just delete and remake
yeah afaik you can only delete + replace nodes, no editing
hello, how get player permission without parent groups?
why would you want to do that? 
How can I check if target has a permission and ignore inheritance?
And how do I check if group has a permission?
is there a 1.19 release?
You can download LuckPerms for Bukkit/Spigot/Paper, BungeeCord, Sponge, Fabric, Nukkit and Velocity.
also do you know if essentials work in 1.19?
Still the wrong channel
!moss
Make sure you are using EssentialsX and Vault for prefixes. For any other issues with Essentials, you should seek support in either #general or the official EssentialsX support Discord.
How can I check if player has a permission and ignore inheritance, and how do I check if some group has a permission?
Yep, I managed to do that with a group. How can I ignore inheritance when checking permissions for a player? My staff rank has * and if I check permission for them it will always be true.
!nwc
Some plugins are created in a way which results in odd behaviour when the root '*' wildcard is used.
Try to steer away from assigning *
I add a permission to a player via api. Now how can I give this permission context like "server: Lobby-1"
Solved these, thanks.
Can someone tell me how to add a parent group to a user using the LuckPerms API?
// loop through String[] permissions and give them to the player
for (final String permission : getHelper().getPermissions())
getHelper().addPermission(target.getUniqueId(), permission.replace("%team%", teamName));
// getHelper().addPermission()
public void addPermission(final UUID uniqueId, final String permission) {
getUserManager().modifyUser(uniqueId, user -> user.data().add(PermissionNode.builder(permission).build()));
}
For some reason this doesn't give all the permissions all the time (there are 7). Should I do something else?
Any way to fix this other than just making a group and assigning permissions to it and just setting that group to the user?
why wouldnt you just make a group?
No reason, I'm just asking for alternatives so I don't have to rework the current way I'm doing things.
but if you have a group, you dont need to manually assign multiple permissions to a user at a time
I know.
because i didn't think of it when i first started working on the plugin? 🤣
also without reworking anything, you can just give a group.<groupname> node, which is how luckperms handles tracking which groups a user or other group inherits from
thanks, I will need to rework a lot of stuff because I want to make those groups via commands with meta and permissions instead of just giving meta and permissions to users
Hi, trying to get the prefix from a specific rank. ```java
Group group = luckPerms.getGroupManager().getGroup(rankName);
if (group == null)
return null; // this does not trigger
group.getCachedData().getMetaData().getPrefix();```
This returns nothing despite of the editor showing it has prefix.97.&6&lHelper and /lp group helper meta info also displays -> 97 - 'Helper' (inherited from self)
After some more testing, the following also returns null java group.getCachedData().getMetaData().queryPrefix().result()
This is what I'm trying to fetch
what does lp group helper info show?
No prefixes
does the node have any contexts applied to it?
No it's a rather naked group
then something is misconfigured in the config file that is ignoring global stuff, care to share it?
The config? I believe it's default: http://pastie.org/p/6uZHxg8F0LJfWWNlnsonhs
Just in case I'm missing out on info
yeah so it's the meta-formatting settings that are affecting it
yeah if you're not gonna make use of those settings just change the format entry back to highest which is the default

Learn how to use the LuckPerms API in your project.
I only have dependencies
what?
oh
you don’t need the repository block for luckperms
it’s on maven central
!cookbook
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
they're cached if they're online, for commands if the user isn't loaded it'll be loaded from storage (and unloaded right afterwards I believe)
Because I'm very confused why UserDataRecalculateEvent is not called
The only event it calls is UserLoadEvent
I'm running my made standalone version
I would expect it to call this
is your server based on an existing server software?

is it not called on bukkit/velocity/etc.. too?
that's not what I'm asking
can you read my question
Oh
Sorry
Lemme have a look
what are you using LP in a standalone java application for 
im sure you have good reason, im just curious
well our server architecture is that we have a "master controller"
that controls the network
So I didnt want to make redis calls to proxy to check for permissions
multi-proxy server?
Yes
whats wrong with redis then? 🤔
Well having to make calls to check for permission seems a little bit a waste of redis
tbf ive never used redis, but isnt that kind of thing what it was made to do?
redis is for messaging yes
But it adds delay
We utilize redis to communicate between servers, but for checking permissions it's a little bit too much overhead
Okay lets see if proxies call Recalculate event
Also where are you doing that logging?
Okay so recalcualing on proxies do seem work
Does Luck perms check if the player is online?
Cause well on standalone there's no players 'online'
Wdym where
No, it doesn't check that
Where did you put the logging statement things
in the code
so how exactly does your standalone thing solve the issues redis causes for you? 🤔
Right - some events are not dispatched if there are no listeners for them
Cause the master can directly check LP for permissions? 😄
specifically everything-postAsync and perhaps a few other ones but every event dispatched asynchronously is checked for subscriptions first
So I need to override
so your backend servers ask your standalone application?
is it Bus#shouldPost?
No, the master controller is the standalone application
yes that's what that's used for
Well I cannot overwrite bus without reflection
I guess imma have to reflect
Or actually nvm I don't need to
There we go, works like a charm, thanks!
so wait, how do your backend servers check permissions then? 🤔
Yes
yes
Cause joining is handled in the master controller, so it needs to check for permissions 2fa, etc and before you would need to send proxy a message saying HEY! I need to check if the user has permission, wait for the response then deny or allow the join, now I just directly call the LP api
I mean you still need to wait for the user object to be loaded from storage
Yea but the same would happen on proxy
right, and you still need to cross-communicate somehow, and there will be a minimum of latency anyway
Not anything noticeable by player
neither is... waiting for storage loading? which still needs to happen on the proxy and on the servers too, if anything you're adding an extra layer 
and I rather have less redis messages since luckperms ain't linked to our redis discovery service
couldnt you just use a second redis instance?
im making a velocity chat plugin so how would i set a players prefix
also how do i get an instance with bungee
From the LuckPermsProvider class
Well, you get it from LP, see https://luckperms.net/wiki/Developer-API-Usage#the-basics-of-cacheddata
How and where you actually make use of it is up to what the velocity API offers
hi i have problem with api becose LuckPerms api is null
Send your code.
@night pier
Hey PlayDev! Please don't tag helpful/staff members directly.
did you add luckperms as a soft depend
Could someone explain to me how contexts.json works?
!context
You can set a permission or group on a per-world/per-server basis, through what we call "contexts".
wrong channel though probably
How can I place more than 1 server?
can someone help me
^
Yes
I am making a bungeecord plugin and i want to use your api, but i do not know how to import it in my plugin
!api
Learn how to use the LuckPerms API in your project.
when i try to use api version 5.4 it says that it does not exist but allows me to use version 5.3\
did you try building it
screenshot
screenshot of what
your pom/build.gradle and the error
Please use https://pastes.dev to send files in the future. I have automatically uploaded message.txt for you: https://pastes.dev/h28XTej64n
did you run mvn clean package?
how
terminal
ok i did it. but now i still cannot import it in my bungeemain.
it cannot find the package and so when i try to add this:
getLogger().luckPermsApi = LuckPermsProvider.get(); it doesn't can anyone help?
...wat
Please use https://pastes.dev to send files in the future. I have automatically uploaded message.txt for you: https://pastes.dev/3TJ1Yn7fSC
i swear i keep reading luckyperms even though people are putting luckperms 
Unless that getLogger() method is returning something very weird though, that isn't valid code
can you send full code and any errors?
Please use https://pastes.dev to send files in the future. I have automatically uploaded message.txt for you: https://pastes.dev/BnnQ1kr9lS
!paste pls
Seeing a paste of the problem makes everything so much easier! Use https://pastes.dev/ for easy pasting!
Pastebin any relevant segments of the console log. If it's a startup error, this includes the entire startup log!
Pastebin the entire LuckPerms config file (passwords removed) as well as any other relevant files!
ok
or whatever clippy upload can do iti
!paste
Seeing a paste of the problem makes everything so much easier! Use https://pastes.dev/ for easy pasting!
Pastebin any relevant segments of the console log. If it's a startup error, this includes the entire startup log!
Pastebin the entire LuckPerms config file (passwords removed) as well as any other relevant files!
yeah ok this is just plain and simple invalid code
why are you trying to set luckpermsApi on your logger?
but that's not valid code
like regardless of if LP is working or not, that code will never work because it's invalid java
It's highly encouraged that people know java before trying to interact with the LP API, it makes everyone's lives much easier
ok but i do not understand how to add the luckperms api in my plugin cuz it is on the pom file
and in the bungeemain i cannot use it.
we cant fix your lack of java experience
!cookbook. me
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
Do CoextCalculators absolutely need to provide the context to the ContextConsumer?
LuckPerms appears to still be checking for contexts sometimes while the server is shutting down, and this of course leads to errors because my plugin is already shut down.
Please ping me if you reply 😉
unregister your calculators when your plugin disables :)
Im going to ask again, how do i get the weight of a group if i have its prefix
the prefix that i have is from user.getCachedData().getMetaData().getPrefix()
does getPrefix() return the string?
if it does, im not sure what you would do, but if returns something else it might have a reference to the group/player it belongs to
It return the string
Hey user.getCachedData().getPermissionData(QueryOptions.defaultContextualOptions()) should return permissions for the default context right?
define "default" context
you shouldnt need to worry about contexts unless you are trying to add a new context
thats used to automatically add contexts to permission nodes when you do commands. so for example if you did /lp group default permission set my.cool.perm in game, with that config it would automatically add the server=opsb context to the permission node it adds
not sure why you want to check perms in that context though
hi i am making plugin for chat that use luckperms prefixes and suffixes but i get an error that says LuckPerms api that I set to provider is null
your gonna have to share code
Because we have seasonal ranks which are opsb_s9, which you can get for free in game. For rank upgrades it should only be allowed as a permanent rank
I don't wanna define per gamemode what the name is, so I thought I can use something to get the default context
And look on that
you can add as many static contexts you want in the section above that
How do you get the default defined ones using API then, I wanna check their perms on whats inside default-contexts
Is that possible?
so you could, for example, give your seasonal ranks with a context of season=9 (assuming that s9 means season 9) and have "season": "9" in your static contexts, and then when your season 10 starts, change the 9 to 10 and then anyone who has the rank with season=9 wont have any of its permissions anymore. no api usage needed
or you could register a context in your plugin with the api if you dont want to change that config file manually
That's not the question, I get that I can just change the season and the old ones will be removed yes. But the problem I have right now is once you own a rank on opsb_s9 context and some have opsb, when you purchase a rank upgrade it checks if you have the previous rank, so lets say group.rank1, this returns true if you just check hasPermission(), I want the check to only look for opsb for that group, and not on the seasonal context we defined.
Each gamemode has their own short name as default context so I am trying to find a way to check a user his perms on the default contexts and not the other ones
Is that possible
user.getCachedData().getPermissionData(QueryOptions.defaultContextualOptions()) I did this but that doesn't work, just says no perms no matter on what context you have it
defaultContextualOptions does return a QOpts for those default contexts yes
so no one can help me with the prefix thing?
why do you need the weight of the group that has the prefix?
im making a stafflist bungee command, that with a message listener gets the primary prefix of a specific player in all servers, and i want to compare all the prefixes of the player for the one with the most weight to stay
so you want to sort your staff ranks?
no
so not like the tablist would be?
no

Im just trying to get the prefix with the most weigth in all servers for a player
like for example, you have mvip in survival with weigth 90 and helper in factions with 100
then since the factions rank has the most weight, the factions one is the one that stays
the prefix from CachedMetaData#getPrefix may not correspond to a single group, it can be from multiple (see meta-formatting in config) or none at all
so what should i do instead?
to get the prefix and the weight
how did you plan on getting the prefixes from other servers?
im using a pluginMessageListener
and it would be in all the servers that have my plugin
and they send the prefix back to the bungee plugin
if your servers are connected to the same db you can just use contexts
you can do per-server ranks with a db
let me check just in case
and if you did have a db you could use a meta value thats context independent that has their highest prefix
or just its weight
its not using the same db
Im the server manager so its not my server 
I could try getting the group instead
hello. i am making a bungeecord plugin. I have added the luckperms api. The plugin shows no errors. Then i load it on my bungeecord server and it shows this error:
quite literally gives you 3 reasons
are you doing any of those things?
Hi, how can I use the api to get a list of all permissions from a player, including the once inherited
You can get the permission map for a player from their cachedData/cachedPermissionData
I'll see
any idea how to load my plugin after luckperms?
Assuming Bukkit-based platform, add it as either a dependency or a soft dependency in your plugin.yml. (Soft dependency means optional)
oh sorry its bungeecord....
and i've tried using depends: ["Luckperms"]
but then the plugin doesn't load at all
It's LuckPerms, capital P
cuz i am trying to find the cause on this error
how are you building your plugin? maven, gradle... ?
maven
can you share your pom xml please
Please use https://pastes.dev to send files in the future. I have automatically uploaded message.txt for you: https://pastes.dev/fqK8ms9c5V

?
Are there any errors during startup?
no
mmh could you share the uh
logs/latest.log from the proxy
or if you're using plain bungeecord instead of waterfall I think it has a proxy.log.0 because.. idk why
Please use https://pastes.dev to send files in the future. I have automatically uploaded message.txt for you: https://pastes.dev/idzDBeGXNs

the failed loading luckperms api idk it is accurate
cuz i am using this piece of code
try {
LuckPerms api = LuckPermsProvider.get();
getLogger().info(ChatColor.GREEN + "Loaded LuckPerms API.");
} catch (Exception e) {
getLogger().info(ChatColor.RED + "Failed loading LuckPerms API.");
}
}
which i got online
'tis weird; your pom file seems correct but can you check you don't have LuckPerms classes inside your own jar?
i have the lp classes in my own jar
also i have also download the api.jar
and imported it on my project as well
okay there's the problem
what are you doing step by step to get a jar for your plugin?
huh
I mean what are you doing to compile the project into a jar file
can you not spam please
file -> project structure -> clicked on artifacts then i added it to jar from modules and dependencies
then clicked on build -> build artifacts
and then build.
okay that is indeed not how you do it when you're using maven
go to Project Structure and remove the api-5.4.jar from the libraries/dependencies section
you want to build with maven, it manages dependencies, compilation etc - intellij has a tab on the right side for maven, you compile and package your project into a jar by running the lifecycle -> package task
otherwise you can run mvn package from a terminal in the project dir
let me see
i run mvn package on terminal
and it exported
but in the plugin
there is no longer the luckperms classes
yes that is how it should be
luckperms provides the luckperms api
not your plugin
ok
as i see in console as well
there is no error no more
01:10:41 [WARNING] Plugin listener me.lucko.luckperms.bungee.listeners.BungeePermissionCheckListener took 50ms to process event PermissionCheckEvent(sender=AA12Pro, permission=bungeecustomcmds.staff, hasPermission=false)!
01:10:41 [WARNING] Plugin listener tk.aa12mc.BungeeCustomCommands.StaffChat took 50ms to process event ServerConnectedEvent(player=AA12Pro, server=net.md_5.bungee.ServerConnection@2b449d99)!```
thanks for your help!
i have to go now.

Is there any benefit to using the LP api to check if a player has a permission, rather than using Vault's API?
i need to check permissions for a potentially offline player and want to cover as much ground as possible
for online players you can just use bukkits hasPermission method, but no idea how vault handles offline players
Vault can do offline iirc, you just need to ensure you do so async, otherwise LP will refuse to load the data (to prevent a lagspike)
Well there are two situations ("I need this permission check right now" (like cancelling or modifying an event) or "I can wait for a Future to return" (like responding to a command or reacting to some event without modifying it)) but bearing in mind the player may be offline (and the LP User unloaded), if it happens to be that case, LP's Vault implementation will complain (if you're on the main thread)
Either way there are no downsides to using the LP API directly, since you can load the User ahead-of-time if needed for the first situation (and you can cancel LP's user unload event), and you can also chain things with futures for the second situation
Is there a standalone api for LuckPerms? Either official or community?
as in? Thatit can be used w/o something a bukkit server?
If so, no public ones that I know of
Yeah, something that doesn't require a server to use
what are you trying to do with it?
We've got a microservice that dishes out some stuff, and I would like to modify the stuff that it dishes out based on the meta of a user. So, yeah, just want to access the API without the need for a server basically
Hi
I've used the api in bukkit before, and used this line to get the LuckPerms reference
LuckPerms luckPerms = Bukkit.getServer().getServicesManager().load(LuckPerms.class);
does anyone knows a similar method that works on bungee?
!api
Learn how to use the LuckPerms API in your project.
use the static thingy
very confused, should be 99h but it gets removed immediatly? https://i.imgur.com/Qo3wSa0.png
It does get set since i can see it on the scoreboard
update: Doesn't actually have anything to do with expiry, it gets added (shows on scoreboard & prefix in chat) when I do /lp user powercas_gamer info it gets removed
thanks
im very stupid
Hey, how can I get the LuckPermsAPI on Bungeecord?
!api
Learn how to use the LuckPerms API in your project.
first link
How can I get color of Group?
groups dont have colors
how can i get the primary group with the api?
Get the user, then use getPrimaryGroup()
User user = luckPerms.getUserManager().getUser(uuid); // Gets the LP user instance
user.getPrimaryGroup() // Returns the users primary group
How can I remove groups by weight from a player? I don't want to remove the primary group, but the group with the x priority (weight).
Best way would be to get all the players groups, loop through them checking for the weight node, and then comparing that to the value you want, and if it matches, then remove the group
Thank you.
Ello, what event is called when a User's Prefix Metadata is changed?
There's a UserDataRecalculate event, it's probably fit best for that
We were using NodeMutateEvent but it seems to be unreliable.
Is there an event in the API to be able to tell when a player's parent group has been changed?
yo, i want to add a luckperms rank prefix, but i dont know how... any ideas?
!cookbook
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
do context calculators have to be typed with the type associated with the platform you're on? can they just be User instead?
i wanna make a calculator cross platform and just wonder if i need to bother with making it generic or not
yes. no
based ty
Just out of curiosity, how would you make use of a User in a calculator? 
Like usually contexts are created from the platform's Player state, and getting some things from the User in there can lead to some funny stack overflows lol
in my particular case the context is just based on env vars in the server
so i don't even care about the user
why not use static contexts?
oh - maybe a ^
ngl, did not know that was a thing
dope - thank you!!
Hello, the plugin i'm working on is struggling with reloading permissions.
Basically i have a reload command for my plugin which reloads the config files and adds/removes permissions based on the config.
Every time i call the reload command, the time spent on readding permissions is increasing, has to be something with bukkit permission api.
getServer().getPluginManager().addPermission(); and getServer().getPluginManager().removePermission(); are taking longer each time they are called.
I add permissions with this function:
private void addPermission(PluginManager pm, String perm, PermissionDefault permDefault, Map<String,Boolean> children, String description) {
if (pm.getPermission("magicspells." + perm) == null) {
if (description == null) pm.addPermission(new Permission("magicspells." + perm, permDefault, children));
else pm.addPermission(new Permission("magicspells." + perm, description, permDefault, children));
}
}
And remove them with the plugin manager:
PluginManager pm = getServer().getPluginManager();
pm.removePermission("magicspells.grant.*");
pm.removePermission("magicspells.cast.*");
pm.removePermission("magicspells.learn.*");
pm.removePermission("magicspells.teach.*");
I was wondering, how does LP handle this stuff, are there any better ways to handle this to remove the memory leak after reloads?
If i reload the plugin over like 5-10 times, the server hangs up and i have to restart it, each reload increases the time spent by a sec or more and its only the permission part, checked with timings and internal debug.
Here are the load and unload functions which setup the config, objects and permission stuff if needed:
Load: https://github.com/TheComputerGeek2/MagicSpells/blob/main/core/src/main/java/com/nisovin/magicspells/MagicSpells.java#L215
are you... using /reload?
i have a reload command for my plugin which reloads the config files and adds/removes permissions based on the config.
Literally second line explaining i have a custom reload command not the /reload unsupported one.
sorry i missed that
But from what i've checked today LP only manages permissions instead of adding/removing it to the plugin manager
so i guess there is no fix to that atm, maybe something will change once paper overrides it
SimplePluginManager is the bukkit extension of PluginManager interface
issue lies within permission recalculation
which is done each time someone adds a perm
Its even mentioned in the docs that it shouldn't be run often by a plugin
A problem with the PluginManager#add/remove etc is that it forces a full recalculation of all existing permission attachments each time you call it - while LP's overriding of Permissible tries its best to mitigate that, it's... still not good
ngl ive dont think ive ever seen that addPermission method before
is that like supposed to be the "proper" way to register permissions if you dont put it in the plugin.yml?
Yeah, thats the whole issue
It is
Any particular reason why you're registering them in the PluginManager tho?
I guess defaults
Because the permissions are created from objects during plugin initialization
you can make entirely arbitrary permission checks
I would like to rework the entire system but not plans for that yet
Yeah but it's not like neither any plugin nor the server cares about permissions registered in the PluginManager, you can just player.hasPermission(UUID.random().toString()) and it will work fine
Hmm what about auto completion?
does LP use whats registered? or only what it knows it has checked for before?
what's been checked before
LP auto completes permissions registered in the plugin manager
not necessarily
LP has no issues auto completing permissions that are not registered properly as long as they have been checked with LP at least once
it adds what's been checked, if that also happens to be what's in the plugin manager then well yes, but LP doesn't check in the plugin manager directly tho
i use js scripts to do permission stuff all the time and LP autocompletes that and i just do player.hasPermission calls with no setup
There was an issue on GitHub regarding this exact same thing, the performance degrading, I wasn't able to reproduce it locally even after thousands of calls but maybe it's to do with player count? Idk
Didn't know about that
side note, is https://jd.papermc.io/paper/1.19/org/bukkit/permissions/Permission.html just useless?
declaration: package: org.bukkit.permissions, class: Permission
Not really, happens to me when im alone on my test server
you can use the PermissionDefault stuff if you're interested in that
cant you do that with a plugin.yml though?
yeah but you can't use the plugin.yml if you're doing perms dynamically
yeah but if making js scripts i could just pick a plugin and edit its plugin.yml lmao
uh no, that is not reflected during runtime unless you reload the full plugin
plugin.yml is read only once during load
i mean for like static permissions in js
ig
hacky solutions go brrrrrrrr
Hi, has anyone use the luckperms api in forge ? It doesn't work for me, the provider return null (my mod load aftter luckperms), if you have an example that could be good :).
There is another solution with the user capabilities i can use this (i think) but with the jarinjar i can't refer to "UserCapabilityImpl" just the interface
PS : for better understanding i want to use the api to request prefix and suffix and some permissions
Update : No problem at all :D, just an issue with my code, all is 👌
is luckperms bungee just Luckperms as a dependency?
luckperms bungee is for handling permissions on bungee itself, like the /server command
how do i make this bungee ```java
Player player = (Player) sender;
// Get a Bukkit player adapter.
PlayerAdapter<Player> playerAdapter = this.luckPerms.getPlayerAdapter(Player.class);
// Get a LuckPerms user for the player.
User user = playerAdapter.getUser(player);
// Get all of the groups they inherit from on the current server.
Collection<Group> groups = user.getInheritedGroups(playerAdapter.getQueryOptions(player));
// Convert to a comma separated string (e.g. "admin, mod, default")
String groupsString = groups.stream().map(Group::getName).collect(Collectors.joining(", "));```
You'd use a bungee ProxiedPlayer instead of a bukkit Player
groups.toArray()? that's a very vague question though, what's the context?
Caused by: 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!)
LuckPerms api = null;
getServer().getServicesManager().load(LuckPerms.class);
RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
if (provider != null) {
System.out.println("isint null");
api = provider.getProvider();
}
plugin in 1.19
are you depending on luckperms in your plugin.yml?
yes
and you can see in the logs it enabled happily before your plugin?
the error is in the asynchatevent event not that I do not have papera
it may be api's fault because in 5.4.30 they added 1.19 support and you can not download this version of api only 5.4
That's nothing to do with that
How are you building your plugin? Maven/gradle..?
gradle
can you send the build script
can you send the build script
dependencies {
compileOnly 'io.papermc.paper:paper-api:1.18-R0.1-SNAPSHOT'
compileOnly 'net.luckperms:api:5.4'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
implementation 'eu.okaeri:okaeri-configs-serdes-bukkit:4.0.6'
implementation 'org.projectlombok:lombok:1.18.24'
implementation 'eu.okaeri:okaeri-injector:2.1.0'
implementation 'eu.okaeri:okaeri-configs-json-gson:4.0.6'
implementation "io.papermc:paperlib:1.0.7"
implementation 'eu.okaeri:okaeri-placeholders-bukkit:4.0.3'
implementation 'com.iridium:IridiumColorAPI:1.0.6'
}
my dependencies
ok
is run
dont use /reload
!reload
Using Bukkit's /reload command causes issues with many plugins, including LuckPerms. If you are adding or removing plugins, you should always fully restart your server.
Plugman causes all of the same issues as /reload as it is fundamentally doing the same thing as /reload
Yo guys
I would like to hide a prefix from a group
Just for the user who select to hide it
Is that possible with lp api?
that seems more like some sort of advanced chat formatting plugin option
how are you formatting chat right now?
Give them an empty prefix with a higher weight
the problem is
i'm using this
lpc
I hope you got what i'm using right now Marti
oh yea marti has a good idea
why not a group in all tracks “hidden” with a prefix at the highest weight “” @mental terrace
that sounds like it’d work, a little hacky but not that bad imo
Hey guys!
I added the luckperms api to my project using maven and imported the API using the singleton method,
But how can I add a player to a group?
Oh wait 😂
I should use the permission
But how can I add a permission to a plaayer with the API?
I found it!
But what's the user variable though?
I need to add a permission to a player,
But how can I get the user variable the method needs?
!cookbook
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
yes but i want to hide the vote rank prefix
and there're 20 different ranks
with everyone its custom permissions
oh i just make the no prefix group with the highest weigh
and add it to the player
yes
you just create 1 group named hidden and add it to all 3 tracks at the highest position, along with an empty prefix at the highest weight for the new group
is there a similar method, or a way for UserManager#searchAll to also include the user' groups nodes?
hm?
like applying inheritance? I don't think that's possible
well, you could load every single user and check manually lol but that's not gonna be pretty
well it only needs to be online people
i guess i can loop thru loaded users, their nodes + inherited groups?
yeah
Good Evening,
i have a question to the LuckPerms API.
I use this Code to get the Prefix:
public String getPrefix(Player player) {
User user = getLuckPerms().getPlayerAdapter(Player.class).getUser(player);
return ChatColor.translateAlternateColorCodes('&', user.getCachedData().getMetaData().getPrefix());
}
But i get the result on the screen:
Sry for my broken english.
I don't understand, what you mean with toStringing
your calling toString on a Component somewhere
.
as it doesn’t have anything to do with LP
I only put it into the AsyncPlayerChatEvent:
@EventHandler
public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
Player player = event.getPlayer();
event.setFormat(plugin.getPermissionUser().getPrefix(player) + player.displayName() + " §8» §f" + event.getMessage());
}
use player.getDisplayName
you can’t mix legacy and components
deprecated as of when..?
If they're using paper, why are they using AsyncPlayerChatEvent, and not AsyncChatEvent
¯_(ツ)_/¯

Because i dont understand how to use AsyncChatEvent xD
I know thats stupid xD
A little question. Can i make a sorted tablist with luckperms?
!tab
LuckPerms only acts as the source for prefixes / suffixes, it doesn't actually apply them. You need an appropriately configured chat/tablist formatting plugin for them to be displayed. If the values appear correctly when you run /lp user <user> info, LuckPerms is doing its job!
LuckPerms api = provider.getProvider();
User user = api.getUserManager().getUser(player.getUniqueId());
assert user != null;
Track track = api.getTrackManager().getTrack("ranks");
assert track != null;
track.promote(user, ImmutableContextSet.empty());
api.getUserManager().saveUser(user);
I use this logic to rankup players but I had some issues with 3 players that ended up having lots of previous ranks after ranking up
A player for example had rank4, rank5 & rank6
Am I doing something wrong?
Is there an easy equiv to checking for the group.group_name permission when just working with a User instance?
yee found it on the wiki nvm
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "lp user "+ player.getName() +" promote ranks");
I guess this will have to do.
Hello there!
Let me to burst in with a big enough question "to think about".
I'm fighting troubles with BungeeTablistPLus and LuckPerms.
(But as I realized describing this issue in BTLP support, the problem is in my plugin code working with LP API)
I'm not sure why, but when updating the LuckPerms player's group VIA MY CODE, the BTLP !switch message is not applying correctly. It applies only when re-join the server. BUT!!! The permissions work kinda fine, because I also have hew holograms set up for different groups of players, and they (the holograms) switch exactly when the permissions are changed. But BTLP message - not. Another BUT: BTLP nickname format - changes well to.
So, BTLP works 50/50 correctly.
Here is an explanation in screenshots:
Step1: https://ibb.co/py315hV
Step2: https://ibb.co/x5ZJ0zP
Step3: https://ibb.co/8gr8w2x
BUT:
I thought about trying to test with the regular /lp command.
and you know what? **It works fine! **TAB message changes simultaneously.
So, both: tab-message and tab-nickname are changed to the right group.
The conclusion is that BTLP and LP work fine, the only shitty developer here is me.
So here are my main question: what do I do wrong in my code using LP API to update the player's group?
So here is my function that changes the player's group. Part of it I've just copy-pasted from LP API examples (lines 26), part of them - my own shitty code:
https://pastebin.com/P77aPFvj
To be honest, I wrote that code for 1.17 (but only a few months ago), and not sure does I have the same issue at that time. Anyway, here we are.. and I need to solve that issue.
Could someone help me with that? 🙂
if someone cares,
using vault_primary_group in expression instead of luckpermsbungee_primary_group - solved the issue.
So.. I guess there are some issues with luckperms and luckpermsbungee relations...
both (from waterfall and from paper servers) are connected to the same DB so.. I do not know what is the root of this issue
im trying to get a group with weight but idk how to do it with api
I think the weight is in the nodes of each group
check pins @red violet
this one?
am I correct in what should I check?
hey so i put the luckperms api as a dependency in my pom.xml.
and for some reason it shows up as red???
i did what the site told me to do and it wont be a normal color,
"it shows up as red" what is "it"? Could be a bunch of things
ik im sending a ss chill
Have you reimported since adding it? Should be a little reload icon with the maven M
(for the record whenever you make any change to your pom.xml besides comments or whitespace changes, you'll need to reimport)
ah ok ty
the thing is right, i never used maven until today.
( since id just manually import the stuff. )
all good!
but yeah once again tysm for your help and sorry if i seemed a bit harsh earlier 😅 wasn't trying to be
one more person using a build tool instead of IDE for dep management is always a good thing
true
nah it's fine, I've been on your side of convos like that many times
still, sorry >_<
not trying to bother anyone but how can i get the users prefix???
bc like the lp api doesn't have LuckPermsAPI with in it... apparently
!cookbook iirc this is one of the things in the cookbook?
The cookbook is a working example plugin which shows how to get/change data for users and groups, listen to LuckPerms events, and more.
!api read how to get an instance of the api
Learn how to use the LuckPerms API in your project.
(top link)
yeah ive been using the sites api link
and the luckPerms part isn't an existing thing apparently
I think i might of gotten it hold up
i got it
we gud now
hey, im using the luckperms bungeecord plugin. I want to check in my spigot plugin if a player have permissions. So i tried with hasPermissions("") but this is always false. What can i do?
Hello there guys!
I'm not sure I really understand this PINed message which I was advised to review.
So I have this part of code in the end of my function where I'm changing players parent group:
// Load, modify & save the user in LuckPerms.
api.getUserManager().modifyUser(player.getUniqueId(), (User user) -> {
// Remove all other inherited groups the user had before.
user.data().clear(NodeType.INHERITANCE::matches);
// Create a node to add to the player.
Node node = InheritanceNode.builder(group).build();
// Add the node to the user.
user.data().add(node);
// Tell the sender.
if (debug) {
Logger.info(user.getUsername() + " is now in group " + group.getDisplayName());
}
});
Where should I put advised code from the PINed message (to which I also reply with this message)??
I'm out of ideas or doing something wrong. How can i get the player group (context) that their currently in. player's group is is spartan with context server=skyblock, i'm doing this on the proxy and i can't get this to work correctly lol
server= or world=? on the proxy world is for what backend server the player is on and server is which proxy they are on for multi-proxy setups
is that from /lp or /lpb//lpv?
but your plugin/whatever is on the proxy?
oh wait are you trying to get what the player group would be on the backend server?
yep
oh ok
okay so it sort of works
for 1 player (temp rank w/ context) it works, other p[layer (perm rank w/ context) it doesnt
....nvm
hello, could you comment i can add all the commands of a plugin like "true" directly a group?
I have a question
if I would use BungeeCord
and have luck perms directly on Bungee
Would it be still possible to use lpb?
on a server
cuz I have a plugin for my item shop
and it would execute commands
no, servers executing commands can't ever reach the proxy
just install luckperms on your server too and sync them using one of the sync options
Ok
Can someone help me using LuckPerms API ?
i added it as dependency to my POM
but i still cant Use LuckPerms in my main class of my spigot plugin
Hi , i have a question, is it possible to add a group to a player using the api ?
cuz i can't seem to know how
!api
Learn how to use the LuckPerms API in your project.
DataMutateResult result = user.data().add(Node.builder("group.WHATEVER").build());
@fringe torrent
i never understood the nodes thingy
anyways thank you bro
I have no idea about this shit
Nodes are permissions
who knows
Someone
oh
When they are available they will help
maybe he added the wrong artifact name
@muted acorn any errors ?
HAHAHA
there cant be any errors
since it cant be used
ill send ss wait
Don't we have a cookiecutter
Sorry! I do not understand the command cookiecutter
Type !help for a list of commands
!advanced
!api
!argumentbased
!ask
!bedrock
!bulkupdate
!bungee
!bungeecheck
!cauldron
!colours
!commandequivalents
!commands
!config
!context
!cookbook
!default
!downloads
!editor
!editorsafety
!errors
!essentials
!extensions
!extracontexts
!faq
!forgepermissions
!formatting
!hack
!helpchat
!inheritance
!install
!libsdir
!locale
!meta
!migration
!notworking
!nowildcard
!offline
!pasteit
!permissions
!placeholders
!reload
!selfhosting
!spongeseven
!stacking
!storage
!suggestions
!switchstorage
!sync
!testingperms
!tracks
!translationprogress
!translations
!tutorial
!upgrade
!usage
!userinfo
!verbose
!version
!weight
!whyluckperms
!wiki
trying just writing LuckPermsProvider.get() @muted acorn
it should work
my IDE doesn't read it among the completions too
i can use it but how should i save it as variable
that can be accessed
much easier
well it is much easier to call it as variable rather than writing it 100 times


