#luckperms-api

1 messages Β· Page 11 of 1

fast delta
#

from what i can see, the dependencies object in the manifest is comprised of entries in the form of "group:name": "semver range of supported versions"

#

the lp api itself doesn't really change all that much so you could just do "LuckPerms:LuckPerms": "*"

magic granite
fast delta
#

i mean, that looks fine.. that is not directly related to luckperms however
what error/stack trace does the server crash with?

magic granite
# fast delta i mean, that looks fine.. that is not directly related to luckperms however what...

[2026/01/19 051757 SEVERE] [PendingLoadJavaPlugin] Failed to load plugin G:\git\com.github\my\hytale\plugins\WorkbenchRepair\official\build\resources\main
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:74)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:483)
at com.hypixel.hytale.server.core.plugin.pending.PendingLoadJavaPlugin.load(PendingLoadJavaPlugin.java:48)
at com.hypixel.hytale.server.core.plugin.pending.PendingLoadJavaPlugin.load(PendingLoadJavaPlugin.java:15)
at com.hypixel.hytale.server.core.plugin.PluginManager.setup(PluginManager.java:215)
at com.hypixel.hytale.server.core.HytaleServer.boot(HytaleServer.java:345)
at com.hypixel.hytale.server.core.HytaleServer.<init>(HytaleServer.java:303)
at com.hypixel.hytale.LateMain.lateMain(LateMain.java:54)
at com.hypixel.hytale.Main.main(Main.java:43)
Caused by: java.lang.IllegalArgumentException: String does not match <group>:<name>
at com.hypixel.hytale.common.plugin.PluginIdentifier.fromString(PluginIdentifier.java:97)
at com.the7legions.hytale.plugins.WorkbenchRepairPlugin.<init>(WorkbenchRepairPlugin.java:23)
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
... 9 more

#

Boggles the mind because my entry is definitely in the format Group:Name lol

#

interestingly this only seems to be happen when debugging. i put my mod on a normally installed server and it loads with LuckPerms as an optional dependency just fine. must be an issue with my project debug configuration, thanks, checking that now.

last rune
#

how can i fix that

cold wing
#

For Hytale how do i use the luckperms api to work with a /rankup function to take my luckperms ranks a-z

<dependency>
<groupId>net.luckperms</groupId>
<artifactId>api</artifactId>
<version>5.5</version>
<scope>provided</scope>
</dependency>
theres no docs so idk how to use this

unreal mantle
#

!api

frank driftBOT
silver hornet
#
User user = luckperms.getUserManager().getUser(uuid);

        commandContext.sendMessage(Message.raw(user.getUsername() + " is rank " + user.getPrimaryGroup()));

        user.setPrimaryGroup("b");

        luckperms.getUserManager().saveUser(user);

        commandContext.sendMessage(Message.raw(user.getUsername() + " is now rank " + user.getPrimaryGroup()));```
#

its not saving for some reason

unreal mantle
#

Add another test message before you save the user to see if it updates it.

unreal mantle
silver hornet
#

nvm i figured out how to do it

solemn saffron
#

Hi, is there any way I can find out when a player's permissions or groups expire? Are there any database changes that I can monitor, for example, or is this only checked again when the data is retrieved?

unreal mantle
solemn saffron
gleaming pulsar
#

From what I know:
The event does fire for online and offline accounts as long as the user data is loaded into memory at the moment of expiry.

If the user is never loaded, LuckPerms may expire their nodes internally during a background task and then save - in which case the event may still be sent, but only if the backend scheduler loads that user into memory.

#

Otherwise you could technically create a VIEW or TRIGGER in your database and check the expiration date/timestamp.

unreal mantle
#

There is also the node getExpiry and has hasExpired methods you could possibly use.

solemn saffron
#

I just need something I can listen to and don't have to check

#

My goal is this: I have a list of many players and information about them in MySQL. I can retrieve and display this list. But I want players who no longer have a certain permission to no longer be displayed there. Ideally, I would like to insert them into another table. When selecting players, I don't want to first have to query the API for all players to see if they still have that permission. Do you understand what I'm trying to do?

gleaming pulsar
# solemn saffron I just need something I can listen to and don't have to check

Something like this doesn't "just" exist. If you would load every single user just to check the expiry, that could cause an overhead (depending on the amount of users are registered).
What you are searching for is a custom-solution which doesn't come from LuckPerms by default.
So you would have to create a plugin (or a scheduled task querying the LuckPerms database) which as access to the LuckPerms database and create a query to return the users and its expiry timestamp - if available.
For the users that are loaded into the memory, you could still use the mentioned NodeRemoveEvent.

I still could be wrong and if so, please correct me!

solemn saffron
#

Hmm, okay, so the most sensible thing to do would probably be to just query the database

steel frost
#

Hello ! I want to use luckperms in my hytale mod. What I need to write in the manifest.json please ?

I tryied "luckperms:luckperms": "*" in the dependencies section, but it doesn't work

Thanks !

fast delta
#

it should be "LuckPerms:LuckPerms": "*"

#

inside the dependencies/optional dependencies block of course

steel frost
#

But... I put it in dependencies

#

And when my mod start, LuckPerms is not ready, so I have my debug message saying that LuckPerms is not ready

#

Is this something else to do in the manifest.json ?

#
  "Dependencies": {
    "LuckPerms:LuckPerms": "*"
  }
steel frost
#

Okep, I found something.
Using BootEvent before calling LuckPermsProvider

south summit
#

When calling LuckPermsProvider.get().getUserManager() in hytale I get a java.lang.NoClassDefFoundError: net/luckperms/api/LuckPermsProvider the mod is loaded and working, has anyone encountered this?

jaunty pecan
#

you need to add LuckPerms as a dependency in manifest.json

#

and the API is only ready during the start() lifecycle, not setup()

south summit
#

damm, I was trying to add the dependency but I was getting a cycling dependency error, aparently if you add a mod in the mod folder it automatically adds your dev mod as a dep

jaunty pecan
#

sorry I don't follow what you mean

#

is this with a gradle plugin or something

south summit
#

I meant that if you add mods into your run/mods folder the game automatically adds the plugin/mod you are developing as dependency in their manifest, making a depedency loop when hytale loads the game

jaunty pecan
#

add mods into your run/mods folder

#

on the server?

#

or somewhere else

#

I haven't come across that

#

how does the game know which mod "you are developing"?

magic granite
# south summit damm, I was trying to add the dependency but I was getting a cycling dependency ...

what does your build.gradle file look like? that's probably because you're passing the --mods argument to the server when you run it. the sever will automatically load mods copied to your mods folder that is in the working directory used in the command to run the server even without the --mods flag, so if you add the --mods flag, even if it points to the same folder, you're going to get the server trying to load the plugin twice.

wild whale
#

They've left the server, thanks for trying to help though

magic granite
#

heh shrug, np πŸ™‚

jaunty pecan
#

:)

tough geyser
#

Hi, I'm adding a temp group in this way

    .builder("group.bedwars_champion_division")
    .expiry(60, TimeUnit.DAYS)
    .withContext(ImmutableContextSet.of("server", "bedwars"))
    .build(), TemporaryNodeMergeStrategy.ADD_NEW_DURATION_TO_EXISTING);
if (add.getResult().wasSuccessful()) 
    LuckPermsProvider.get().getUserManager().saveUser(user);```
And removing it (even when days passed) like this
```DataMutateResult remove = user.data().remove(Node
    .builder("group.bedwars_champion_division")
    .withContext(ImmutableContextSet.of("server", "bedwars"))
    .expiry(60, TimeUnit.DAYS)
    .build());
if (remove.wasSuccessful()) 
    LuckPermsProvider.get().getUserManager().saveUser(user);```
but the removal doesn't work
jaunty pecan
#

does remove.wasSuccessful() return true?

#

it looks ok to me

gleaming pulsar
jaunty pecan
#

you do - the expiry time doesn't need to match exactly, but it needs to be a temporary node

gleaming pulsar
#

oh I see

tough geyser
#

well it seems asking here fixed the issue after 4 months of doubts

#

thanks for the fix

narrow scarab
#

@jaunty pecan There is a serious bug in Hytale on servers, and you can easily remove it with your plugin, thus improving several servers and helping them protect themselves. If you want to submit a support ticket, that would be better.
I'm looking for someone to create a mod so I can protect myself. You would create it and I would pay!!

frank driftBOT
#

Hey zebasenpai! Please don't tag helpful/staff members directly.

little vault
#

Is it memory safe to load an user from db just to check if it has a permission?

gleaming pulsar
little vault
#

Cached forever? Or it expires?

#

Ah just found it on the gh repo, cached for 5min

lost night
#

Hello, trying to configure the API in another plugin of mine I create the dependences and also add the compileOnly("net.luckperms:api:5.4") in gradle. However an error apears when I'm trying to import the net.luckperms.api.LuckPerms, it says that cannot resolve symbol "luckperms". Anyone could help me?

#

C:\ME\ServidorHytale\OlympusPlugin\src\main\java\com\apicolin\Olympus\OlympusPlugin.java:6: error: package net.luckperms.api does not exist
import net.luckperms.api.LuckPerms;

gleaming pulsar
# lost night C:\ME\ServidorHytale\OlympusPlugin\src\main\java\com\apicolin\Olympus\OlympusPlu...
  1. The latest version is 5.5 (the wiki is not up-to-date)
  2. Did you add add LuckPerms as depend in your plugin.yml?
  3. How are you calling the API in your code?
  4. Sometimes the Gradle cache is kind of scuffed. You can try hitting "Sync all Gradle Projects" and/or "Download Sources" within the Gradle window in IntelliJ

You can also share your build.gradle, plugin.yml and your main class for further help πŸ™‚

lost night
#

@Override
protected void start() {

    LuckPerms api = LuckPermsProvider.get();

}
#

Where is the plugin.yml?

#

you mean the manifest.json? I'm creating it for hytale

#

oh men, i didn't press the sync all gradle projects

#

thank you a lot

gleaming pulsar
frank driftBOT
gleaming pulsar
#

I didn't know you were on hytale πŸ˜…

lost night
#

No worries, you help me

wary violet
#

hi, i have the luckperms rest api docker container set up
https://luckperms.net/wiki/Standalone-and-REST-API

now, i cannot seem to find documentation on how to configure messaging for this
i haven't looked at the container files, but i would prefer not to fiddle with that and configure it using environment variables instead
where can i find info about this?

#

if this container doesnt support messaging services, then i am a bit confused because i am missing some meta keys that i recently set on request results.
i was assuming they didnt sync to the rest api yet, because i can see them in lp editor and also in other commands, but they are simply not existent in responses from the api container

#

yes it seems it was a caching issue, after restarting the container the meta values now show up

drifting ridge
#

If i use /lp user <player> permission settemp <permission> true 10s it will just remove the permission after 10sec instead of it going to false how can i fix this?

wild whale
drifting ridge
#

Owner/developer

#

Im trying to use skript to detect when player gets a permission

#

From false to true

wild whale
#

If you were using Java to interact with our API, you could listen to the various node related events to detect such a change. However on Skript, I don't know if any of those are an option for you, at least not without some sort of third party adapter or such

wary violet
wary violet
#

πŸ˜•

#

wondering if the cache control header has any effect on this... But taking a glimpse at the rest api code, I kinda doubt it

jaunty pecan
#

just to make sure I understand your question, you want to configure your standalone/rest instance to connect to a messaging service like Redis, so you can use the /messaging/ routes?

#

if so, you can indeed use environment variables, as documented here: https://luckperms.net/wiki/Configuration#environment-variables (sorry I admit not the easiest to find!)

#

might look something like

LUCKPERMS_MESSAGING_SERVICE: redis
LUCKPERMS_REDIS_ENABLED: true
LUCKPERMS_REDIS_ADDRESS: host:port

or similar, depending on which type you are using

wary violet
#

omg yes exactly that

#

do you happen to have an example at hand for rabbitmq?

#

although i suppose .. it would be just LUCKPERMS_RABBITMQ_URI

jaunty pecan
#

replace REDIS with RABBITMQ in examples above

#

not sure we support setting as a URI, think it just expects host/port, one moment

wary violet
#

address makes more sense, i would have actually checked plugin configs for the config key

#

was just a hot guess

jaunty pecan
wary violet
#

alright, thank you very much! highly appreciated

jaunty pecan
#

np!

wary violet
#

hm, it seems its having a bit of trouble with rabbitmq uris

#

i have my docker-compose.yml like this, but on startup i get an error message saying something about the uri. i suppose YML is having a hard time parsing the :// part of the uri
putting it in double quotes doesnt seem to help

#

this is weird. why would it expect a number πŸ€”

wary violet
#

usually, i'd assume rabbitmq expects a uri scheme like amqp://user:pass@host:port

#

oh i see in the MessagingFactory it does it with separate keys for username+password in

#

been a while since i configured the plugins haha

jaunty pecan
#
LUCKPERMS_RABBITMQ_ENABLED: true
LUCKPERMS_RABBITMQ_ADDRESS: host:port
LUCKPERMS_RABBITMQ_VHOST: /
LUCKPERMS_RABBITMQ_USERNAME: guest
LUCKPERMS_RABBITMQ_PASSWORD: guest
#

think you got there by the time I typed it out :D

#

but yeah

wary violet
#

yup, i found it ^^ its easy once you know where to search πŸ˜„

#

thanks for pointing this out, i would have been looking for a while anyway

#

\o/ victory

#

on a side note, it seems to me that either the image's healthcheck configuration may be a bit screwed up or i misconfigured something about that

#

either way - it seems to be working now - thank you very much

unique harness
#

Hello, I was wondering if luckperms standalone can be launched in Spring app so I can check user permissions without additional rest api? I know that there is a option to add an extension but idk if this would work with Spring eco system

tepid patrol
#

Hello, i am adding Luckperms context for my claim plugin. However when i want to know what chunk a player is currently in, (Location#getChunk) Luckperms seems to get stuck trying to reach something in Cache.

If i do not use Location#getChunk(), there are no errors

Am i missing something ? Thanks !

[00:59:26] [Paper Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH  - 1.21.4-194-ce30016 (MC: 1.21.4) ---
[00:59:26] [Paper Watchdog Thread/ERROR]: The server has not responded for 10 seconds! Creating thread dump
[00:59:26] [Paper Watchdog Thread/ERROR]: ------------------------------
[00:59:26] [Paper Watchdog Thread/ERROR]: Server thread dump (Look for plugins here before reporting to Paper!):
[00:59:26] [Paper Watchdog Thread/ERROR]: ------------------------------
[00:59:26] [Paper Watchdog Thread/ERROR]: Current Thread: Server thread
[00:59:26] [Paper Watchdog Thread/ERROR]:     PID: 48 | Suspended: false | Native: false | State: BLOCKED
[00:59:26] [Paper Watchdog Thread/ERROR]:     Stack:
[00:59:26] [Paper Watchdog Thread/ERROR]:         me.lucko.luckperms.common.cache.ExpiringCache.get(ExpiringCache.java:62)
[00:59:26] [Paper Watchdog Thread/ERROR]:         me.lucko.luckperms.common.context.manager.QueryOptionsCache.getQueryOptions(QueryOptionsCache.java:57)
[00:59:26] [Paper Watchdog Thread/ERROR]:         me.lucko.luckperms.bukkit.inject.permissible.LuckPermsPermissible.hasPermission(LuckPermsPermissible.java:172)
[00:59:26] [Paper Watchdog Thread/ERROR]:         org.bukkit.craftbukkit.entity.CraftHumanEntity.hasPermission(CraftHumanEntity.java:248)
[00:59:26] [Paper Watchdog Thread/ERROR]:         TownsAndNations-0.17.0.jar//org.leralix.tan.listeners.PlayerJoinListener.onPlayerJoin(PlayerJoinListener.java:45)
#

location.getChunk() is called when Overriding calculate from ContextCalculator<Player>

wild whale
#

(That cache is the context cache for the player, which is why it's blocking on it)

tepid patrol
mossy tapir
#

Hey, i would like to transfer all player groups i currently have on server X to server Y.
My plan was to simply export the data into a file, move it over, and import it using some rules.

This is my plan to export the primary groups:

    TaskManager.runOnIOPool(() -> {
      Map<UUID, String> extractedGroups = new ConcurrentHashMap<>();

      LuckPerms luckPerms = LuckPermsProvider.get();
      UserManager userManager = luckPerms.getUserManager();
      Set<UUID> uniqueUsers = userManager.getUniqueUsers().join();
      CompletableFuture<?>[] futures = new CompletableFuture[uniqueUsers.size()];
      int index = 0;

      for (UUID userId : uniqueUsers) {
        CompletableFuture<?> future = userManager
            .loadUser(userId)
            .thenAccept(user -> extractedGroups.put(user.getUniqueId(), user.getPrimaryGroup()));
        futures[index++] = future;
      }

      CompletableFuture.allOf(futures).join();
      saveToFile(extractedGroups);
    });

And applying them would be done this way:

  public void applyGroups(Map<UUID, String> extractedGroups) {
    TaskManager.runOnIOPool(() -> {
      LuckPerms luckPerms = LuckPermsProvider.get();
      UserManager userManager = luckPerms.getUserManager();

      extractedGroups.forEach((userId, group) -> {
        String mappedGroup = getMappedGroup(group);
        userManager.modifyUser(userId, user -> {
          String permission = "group." + mappedGroup;
          user.data().add(Node.builder(permission).build());
        });
      });
    });
  }
night pier
#

what's wrong with LuckPerms built in method of exporting/importing?

mossy tapir
#

There are a ton of permissions that i dont want to transfer. Im really only interested in the primary group.
And there is a mapping from old group names to new ones. "xyz" could be "abc" in the new system.

#

Hmm... im just seeing the [--without-users] flag in the command.
Maybe i could just export it right now and only worry about the importing.

#

nvm, that doesnt contain any user data at all πŸ™

bitter otter
#

@left geyser ^

frank driftBOT
#

Hey utfunderscore! Please don't tag helpful/staff members directly.

left geyser
silver idol
#

Hey is there a way to use the LuckPerms API in Minestom?

acoustic mica
#

μ•ˆλ…•

wooden ledge
#

Is there a way to get the common module on the local maven repo?

gloomy token
#

Anyone online

unreal mantle
frank driftBOT
#
Please tell us what's going on!

We really would absolutely love to help you out! However, telling us that it isn't working wastes everyone's time. Please, just describe the issue you're having clearly and with as much detail as possible, and send any relevant screenshots of whatever problems you're having.

For Console Errors:
brave saffron
#

        userFuture.thenAcceptAsync(user -> {
            for (String service : Config.getServices()) {
                String group = Config.getServiceGroup(service);

                InheritanceNode lpGroup = user.getNodes(NodeType.INHERITANCE).stream().filter(node -> node.getKey().equalsIgnoreCase(group)).findFirst().orElse(null);
                if (lpGroup != null) {
                    Instant expiryDate = lpGroup.getExpiry();
                    if (expiryDate != null) {
                        String title = Config.getServiceTitle(service);
                        inv.setItem(i.getAndIncrement(), BItem.b(Config.getServiceMaterial(service), title,
                                List.of(
                                        "<white>" + TOOLS.formatDate(expiryDate.toEpochMilli())
                                )));
                    }
                }
            }
        });```

I'm trying to get the expiry date of a group a person has.

Should I enter the group with "group" prefix or not?
#

For example group callled - "example"

#

Should I check with "group.example" or "example" in user.getNodes(NodeType.INHERITANCE).stream().filter(node -> node.getKey().equalsIgnoreCase(group)).findFirst().orElse(null);

pliant nexus
#

Hey, is it possible to synchronize LuckPerms standalone using NATS, similiar to the plugin?

We tried setting up our servers, as well as a standalone instance with the rest api. The synchronization between servers works. The standalone service does not synchronize, the data is right however when we restart the service in Docker, so it's not a database issue.

We have set the database as well the rest configuration using environment variables, however we couldn't find one for synchronization, so we set it in the config. Is there anything we did wrong?

jaunty pecan
#

Standalone should behave the same, is it definitely connected to your NATS instance?

#

Should say so in the startup log

jaunty pecan
brave saffron
#

Then it doesnt work

#

Will need to doublecheck tomorrow

pliant nexus
#

If you need anything, such as the config, the docker compose or anything that might help, let me know.

wild whale
# pliant nexus It probably isn't. However, I'm not sure how to connect it right then. You can s...

Wherever you saw that needs to be updated, or you encountered a bug. All options should be able to be sourced from environment variables https://luckperms.net/wiki/Configuration#environment-variables

pliant nexus
#

is there a full list of environment variable names?

wild whale
pliant nexus
#

I'll look through the code and find the ones I need

#

Maybe it would make sense to add a list of them in the wiki or atleast mention how they are generated, since it was a bit confusing

pliant nexus
paper hearth
#

Hey, I am using the Restapi and was wondering, how do i generate an api key for my application to use?

#

nvm found it

brave saffron
#

How to get user groups that apply in that specific server (in network setup, users gets groups with context server=<server>, I don't want to build a query each time explicitly setting the server context).
Current setup that doesn't work (always return 0):

    public static int getRankWeight(UUID uuid) {
        if (!available) return 0;
        User user = userManager.getUser(uuid);
        if (user == null) return 0;
        Optional<Group> rankGroup = user.getInheritedGroups(QueryOptions.defaultContextualOptions()).stream()
                .filter(group -> group.getWeight().isPresent() && group.getWeight().getAsInt() < 50)
                .max(Comparator.comparingInt(g -> g.getWeight().orElse(0)));
        return rankGroup.map(g -> g.getWeight().orElse(0)).orElse(0);
    }```
wild whale
#

Oh and as for why it's currently returning 0, QueryOptions.defaultContextualOptions just kicks back a QueryOptions without any contexts set, so if all your groups are set with contexts then that'll return nothing

brave saffron
#

Why it cant be static?

wild whale
#

There's nothing explicitly "wrong" about it such that it won't function, but it's an anti-pattern since it negates OOP principles. Generally static should only be used for "pure" utility functions, factory functions, constants, occasional use for things like a singleton pattern (a single static method to retrieve a shared instance of an object), things like that. If a significant percentage of things in a class are static, that's usually a sign you're not following proper object-oriented programming.

-# (One minor actual problem static abuse can cause is introducing weird bugs or resource leaks when /reload or similar is used, but that's usually not as big a concern for many developers)

rain burrow
#

Hi, I am trying to replicate lp user <user> permission settemp <node> <duration> <mode> programmatically using the API. So far this worked great:

api.getUserManager().getUser(player.getUniqueId()).data().add(Node.builder("my.node.here").value(true).expiry(5, TimeUnit.MINUTES).build());

Except that I don't see any builder methods to set it to "accumulate" mode. I see 2 overloads that takes TemporalAccessor, TemporalAmount but i'm not sure if it is relevant or how to construct these.
I am currently searching the wiki with key word accumulate and expire but no luck so far πŸ™

wild whale
# rain burrow Hi, I am trying to replicate `lp user <user> permission settemp <node> <duration...

The API doesn't necessarily have an analogue for every command implemented by default, I'm not aware of any method that replicates the accumulate modifier. You'd need to implement it yourself by searching that user for a node with the appropriate permission & contexts and an expiry set, and if present add the new expiry to it.

TemporalAccessor & TemporalAmount are both interfaces from Java's time API; classes that hold a specific time (i.e. Instant, OffsetDateTime, etc) generally implements TemporalAccessor, while things like Duration implement TemporalAmount. Notably you can grab the Instant a node expires at with Node#getExpiry, so once you've found the Node, you can simply add your desired additional duration to it & set that as the new expiry.

rain burrow
#

Ok got it. Ty.

rain burrow
# wild whale The API doesn't necessarily have an analogue for every command implemented by de...

Turns out there is one. It's in the NodeMap class not in the builder one. It was not mentioned at all in any wiki example. Putting it here so it might help someone:

final UserManager lpUserManager = api.getUserManager();
            final User lpUser = lpUserManager.getUser(player.getUniqueId());
            final NodeMap lpUserData = lpUser.data();

            lpUserData.add(
                    Node.builder(node).value(value).expiry(duration, timeUnit).build(),
                    acculumate == true ? TemporaryNodeMergeStrategy.ADD_NEW_DURATION_TO_EXISTING
                            : TemporaryNodeMergeStrategy.REPLACE_EXISTING_IF_DURATION_LONGER);
            lpUserManager.saveUser(lpUser);
wild whale
#

blobfacepalm I even specifically looked in the NodeMap class for a method like that and somehow missed it. Sorry about that, glad you found it!

wispy patio
#

Folia

#

!folia

frank driftBOT
random plank
#

is this returns all the users?

unreal mantle
random plank
unreal mantle
#

Well luckperms only stores players that have not only just the default group. So if you want to get all players. Online and offline youd be better to use the main servers api instead of LP api.

For example like Bukkit.getOnlinePlayers()

random plank
#

i just have 2740 users on playerdata folder

#

and on luckperms i have 2989

#

and i need convert all my old bedrock uuids to new floodgate bedrock uuids

#

I had a configuration in Geyser where the Bedrock UUIDs in Geyser had the offline Java UUID instead of the Floodgate UUID, and I need to convert all the plugin data to the new UUIDs

unreal mantle
#

Well you'll only be able to get all users that have more than just the default group using LP. I dont believe there is a method to get all the users including those in the default group.

Unless...

You use the getuniqueplayers method, then save them to a list, then get a list of the members in the default group and add them to the list. It may work. Im not sure.

random plank
#

I need to see if a online or offline player have a permission

#

am I doing correctly?

late tusk
#

Why this code sometimes cause user data reset? It removes all his permissions, groups, etc. We use that code when player is online on server

we are running on latest github commit

gleaming pulsar
late tusk
gleaming pulsar
steady iris
late tusk
#

we started using it recently (using some item, gives you temp permission), and some players complains that after using items their group resets

mint spear
#

How to use

gleaming pulsar
frank driftBOT
mild jewel
#

Where and how can If ix this:

private void setupLuckPerms() {
try {
RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
if (provider != null) {
luckPerms = provider.getProvider();
plugin.getLogger().info("LuckPerms provider hooked.");
subscribeLuckPermsEvents();
} else {
plugin.getLogger().warning("LuckPerms provider not found. Role sync disabled.");
}
} catch (Throwable t) {
plugin.getLogger().log(Level.WARNING, "Error hooking LuckPerms. Role sync disabled.", t);
}

But it keep sayting the provider is not found?

gleaming pulsar
mild jewel
#

Name: BloneBurgCore
version: '${version}'

main: nl.bloneburg.bloneBurgCore.BloneBurgCore
api-version: '1.21'
depend:

  • LuckPerms
    commands:
gleaming pulsar
#

!paste And can you also show us your pom or gradle file?
And you have LuckPerms intalled on your server?

frank driftBOT
#
Please use pastebin!

Seeing a paste of the problem makes everything so much easier! Use https://pastes.dev/ for easy pasting!

For console errors:

Pastebin any relevant segments of the console log. If it's a startup error, this includes the entire startup log!

Other errors:

Pastebin the entire LuckPerms config file (passwords removed) as well as any other relevant files!

mild jewel
#

Already fixed it

wraith mural
#

Good evening, I'm making my first server and I have some questions.

I'm making a modpack using NeoForge, and I want to create a rank and kit system. I was previously using FTB Ranks, but it wasn't working the way I wanted.

Now I'm using the NeoForge version of LuckyPerms, and I would like to know a few things:

1 - Can ranks created in LuckyPerms increase or limit the chunk claims in FTB Chunks and the sethome limit in FTB Essentials?

2 - How can I create item kits that only a specific rank can claim, such as:

  • once only
  • once per day
  • with cooldowns

3 - I've seen some servers where players can open an in-game GUI/interface and redeem kits through it if they have the required rank.
How is that usually done on NeoForge servers?

4 - Which TAB or nametag mod works well with LuckyPerms on NeoForge?
I already have custom rank textures/icons ready.

main dagger
wraith mural
#

How do I limit the maximum number of normal and forced chunks that each group can have using lucksperm and ftbchunks?

wraith mural
random plank
#

i need do this on main thread?

#

Or the methods called are thread-safe

wraith mural
#

😭
Good evening, I'm having a problem.

My modpack is:
Minecraft 1.21.1
Neoforge.21.1.228
Arclight-neoforge-1.21.1-1.0.2-SNAPSHOT-0769551
LuckPerms-Bukkit-5.5.42
ftb-chunks-neoforge-2101.1.14
ftb-xmod-compat-neoforge-21.1.8

I want that when assigning the luckperm group, for example group-default, if anyone enters the server they receive the default group, but I want to limit the maximum number of chunks that people in that group can use, for example 10 normal chunks maximum and 2 forced chunks maximum, and if I put that person in another group, for example group-old, in that group-old the person has 30 normal chunks maximum and 10 forced chunks maximum.

gleaming pulsar
gleaming pulsar
wraith mural
#

I even wanted to use the Neoforge modded version of Lucksperms, but it keeps giving me an "invalid player data" error, and I couldn't find anywhere to fix it.
This error always happens when I try to log into the server.
That's why I opted to use the hybrid version, which so far is working okay with the other plugins.

sudden kelp
#

I am providing the lp api like this:

<dependency>
            <groupId>net.luckperms</groupId>
            <artifactId>api</artifactId>
            <version>5.5</version>
            <scope>provided</scope>
        </dependency>

But it downloads a release from 23. may 2025.
Any idea how to get the latest 5.5 changes from git as well? Including hytale etc

serene sail
#

Wait sorry i didnt realize you sent that 6 days ago sorry for the ping

sudden kelp
#

All good, I ended up building it locally. This was enough to get the new version in my local maven repo. That was good enough for me

torpid crow
#

Is there a way to tell LuckPerms about custom permissions on Velocity?
Platform.getKnownPermissions() can't be modified, and i couldn't find a way to tell velocity about my custom permission.

main dagger
torpid crow
wild whale
# torpid crow once per restart or does luckperms keep them in the database?

The permission vault is every permission that's been checked during that LP instances' runtime, plus every permission already set on a group/player. So technically if you wanted to seed a permission on velocity, you'd need to fire a permission check for every restart, but honestly I wouldn't really bother - the majority of plugins don't do any special action & the auto-discovery just finds things as they're naturally checked, generally admins won't try to give a permission until someone encounters the "no permission" state anyways

grim sage
#

any method to check if a string is a valid track name or will I have to check if said string contains spaces manually

jaunty pecan
#

@nocturne elbow πŸ˜ƒ

nocturne elbow
#

ty

#

:p

#

@jaunty pecan how to get users objects list, which have specific permissions like /lp search permission ? With API?

frank driftBOT
#

Hey iBo3oF! Please don't tag staff members.

jaunty pecan
ornate cove
#

Any1 help mewith something?

proud crypt
#

Just say what you need help with @ornate cove

ornate cove
#

Hey, im helping my friend get a server going we wanted some prefix names etc but cant seem to figure it out

wintry comet
#

Hello, I need some help. Please @mention me if you respond since I turn of notifications.

Issue: I am trying to make it so I can set somone to a group, not promote them using /lp group default permission set essentials.kit

Because: I need to do this to simplify setting up buycraft and auto rank plugins.

Why not use original method: If there is only one group in stack, or there are multiple, it either doesn't allow it or requires me to run the command multiple times.

Screenshots:

ripe thorn
#

@wintry comet
1st: That's more a #support-1 question and less a API-related one.
2nd: You can use /lp user <user> parent set <group> to set them in one group only (replace set with add to add the group to the others the player already has)

mint hull
#
        if (!LuckPerms.getApi().getStorage().loadUser(uuid).join()) {
            // got an error whilst loading the user
            return;
        }

        User user = LuckPerms.getApi().getUser(uuid);
        if (user == null) {
            // user not loaded, even after requesting data from storage
            return;
        }

        // the contexts for the lookup. if the prefix/suffix is set in a specific server, you'll need to add that here.
        Contexts contexts = Contexts.allowAll();

        MetaData metaData = user.getCachedData().getMetaData(contexts);

        event.setFormat(metaData.getPrefix() + player.getName() + ChatColor.DARK_GRAY + " Β» " + metaData.getSuffix() + event.getMessage());

        // cleanup the user now we're finished to prevent memory leaks.
        LuckPerms.getApi().cleanupUser(user);```
jaunty pecan
#

you don't need to call loadUser each time a player chats

#

in fact you shouldn't call it

#

and yeah, if it's returning null, it just means they don't have a prefix/suffix set

mint hull
#

So i don't need the loadUser method? And yeah, the admin did something wrong^^

jaunty pecan
#

nop you can remove it

#

since you know the player is online already

wintry comet
#

Thanks Andre_601

icy tinsel
#

So, on github would files in common not rely on spigot or sponge?

#

And be usable by both

jaunty pecan
#

yes

icy tinsel
#

Nice!

nocturne elbow
#

@jaunty pecan I have permission "rank.vip" I want to replace all users having this permission with "group.vip", what's easiest way with LP ?

frank driftBOT
#

Hey iBo3oF! Please don't tag staff members.

jaunty pecan
#

you can't perform bulkupdates with the api

icy tinsel
#

Will you add support for it in the future?

jolly hazel
#

Rule says don't tag luck or the admins @nocturne elbow

icy tinsel
#

@frank drift has already stated that.......

nocturne elbow
#

AHHHHH!!!!

soft prawn
#

Im trying to retrieve the prefix the user should have on for the server they are connected to via the LuckAPI. I'm having a little trouble as it only ever says guest. When I set the context to allowAll, it begins to work but then never changes when they move server. Here is the code im trying to use, in various stages of completeness (as per the wiki):```
ContextManager cm = Main.luckApi.getContextManager();
//ImmutableContextSet contextSet = cm.lookupApplicableContext(user).orElse(cm.getStaticContext());
Contexts contexts = cm.lookupApplicableContexts(user).orElse(Contexts.allowAll());
MetaData metaData = user.getCachedData().getMetaData(contexts);

    //String prefix = user.getCachedData().getMetaData(Contexts.allowAll()).getPrefix();
    String prefix = metaData.getPrefix();
    //String suffix = user.getCachedData().getMetaData(Contexts.allowAll()).getSuffix();
    String suffix = metaData.getSuffix();
jaunty pecan
#

use

#
Contexts contexts = cm.lookupApplicableContexts(user).orElse(cm.getStaticContexts());
cold meteor
#

Hey there, I was just wondering if its possible to access the Lucky Perms API through bungeecord?

polar hinge
#

If you have LuckPerms installed on your bungee server, yes.

cold meteor
#

I do, was just wondering how to do it since I couldnt find it for Bungee on the github pages?

jaunty pecan
#

the API is platform agnostic

#

in other words, it's the same for all platforms LP runs on

cold meteor
#

Ah I got it, thanks.

soft prawn
#

@jaunty pecan As per git hub issue, sadly that doesn't work. Although Im sure it will do once LP outputs the correct info πŸ˜ƒ

frank driftBOT
#

Hey xtechgamer735! Please don't tag staff members.

soft prawn
#

Sorry 😬

obtuse lynx
#

how do you get rank color on tablist?

#

for 1.8 and 1.7 both

obtuse lynx
#

and how do you connect luckperms's permission to all servers

nocturne elbow
#

Not sure. The global wasn't working for me too

jolly escarp
#

on a bungee network?

#

u put lp in every spigot instance

#

and configure it

#

to connect it to the same MYSQL

#

connect all of them

#

but it's not that usefull, I mean, if u want to give someone operator on a server (up from admin to operator on survival, (example) ), it will give him operator on all the servers that are connected.

#

I have a bot on discord which is a "rank moderator" and with only ?remove (name) u remove him the rank, and so on, u can select the subserver, what so ever

nocturne elbow
#

But u can specify servers

jolly escarp
#

when u add a rank to a player with lp?

#

I didn't know, if it's possible it could be good

nocturne elbow
#

Yeah

#

I do that for my builders but I specify the world instead of the server

obtuse lynx
#

;c

#

idk how to connect luckperms to mysql πŸ˜…

unreal mantle
obtuse lynx
#

THANKS!

icy tinsel
#

@obtuse lynx #offtopic
This is API talk. And I got told off for talking about connecting lp to MySQL in general. So yeah, apparently it's offtopic

#

Just letting you know

obtuse lynx
#

ok

forest knoll
#

can a luckypems to discord plugin be made ?

#

its jsut an idea for a discord bot to help with rank match up with the server

polar hinge
#

You could most certainly make one yourself, but if you use DiscordSRV for bukkit and MagiBridge with the necessary addon, you can sync ranks

nocturne elbow
#

Whats the current recommended way to pull permissions for sponge?

jaunty pecan
#

pull permissions?

icy tinsel
#

I'm guessing he means to list all permissions a user has? But I'm not sure πŸ€”

neat mauve
#

To list perms you could always do /lp (user/group) (example) editor

icy tinsel
#

@neat mauve This is for plugins using the luckperms API. That means getting it through the API. Not with a command

nocturne elbow
#

Correct

#

I am building a Server agnostic plugin, but for sponge it looks like I will have to use the LuckPerms API

crystal sonnet
#

The context calculators get called every time permissions are checked, right?

jaunty pecan
#

the result is cached for approx 1 tick

crystal sonnet
#

Ok. Thanks

jaunty pecan
#

πŸ‘

crystal sonnet
#

Great. πŸ˜ƒ

cursive ravine
#

@crystal sonnet are working on Dragonproxy??

frank driftBOT
#

Hey Nostyll! Please don't tag staff members.

crystal sonnet
#

I just made a PR to allow LP to distinguish between bedrock and normal clients

cursive ravine
#

Nice I'm trying to get it working but I'm having issues with the hybrid system

crystal sonnet
#

Current versions work for me

#

You need the plugin though

#

For bungee and spigot

cursive ravine
#

I have everything setup

#

I will check it again

night phoenix
#

Hello!

#

When i set a permission to an offline user

#

do i have to save the user?

#

In the 3.0 api i had to save it

jaunty pecan
#

Yes you still need to save

night phoenix
#

;_;

#

ok

#

I should also invoke the cleanup right?

#

Or LP handles it with an expiring cache?

jaunty pecan
#

Yes, but that is no longer an essential step

night phoenix
#

In my code i don't know if i'll reuse or not a User object, can i just let LP hadle it with the cache expiration?

#

@jaunty pecan

frank driftBOT
#

Hey sgdc3! Please don't tag staff members.

night phoenix
#

Do i have to refresh the cached data after i saved the user?

#

i'm porting my hook from api 3.0 to 4.0 and i'm not sure which steps are now useless

#

Any help? I really don't know what to do in this case

crystal sonnet
#

I’d recommend waiting for Luck

night phoenix
#

ok

crystal sonnet
#

When it comes to the API I’m also just guessing XD

night phoenix
#

lol

#

this is my code so far

#

lambda over 9000

#

do you know how to call saveUser async but ignoring the result?

#

just call the method?

crystal sonnet
#

Nope. I know nothing by heart of the API tbh

night phoenix
#

no it's a question about lambdas

#

if i have a method that returns a CompletableFuture

crystal sonnet
#

Ok

night phoenix
#

in this case saveUser

crystal sonnet
#

Use runAsync

#

Or thenRunAsync

#

One of the two

#

Runs Async and discards the the return value

night phoenix
#

saveUser calls CompletableFuture.supplyAsync right?

#

or complete?

crystal sonnet
#

Idk

night phoenix
#

Need to check the LP source, one moment

jaunty pecan
#

it always calls supplyasync

#

otherwise there would be no point in returning a future

#

I've tried to explain a lot of this in detail on the wiki pages

night phoenix
#

Yeah, that was what i initially thought...

#

What about the refreshCache? do i need to call it after saving?

#

in 3.0 i had, is it still required?

jaunty pecan
#

Uhh yeah

#

you do, I'll add that to the wiki

nocturne elbow
#

Luck, does LuckPerms convert from PEX 1.19.5 version?

crystal sonnet
#

It should

#

No harm in trying. The PEX data doesn’t get modified

nocturne elbow
#

[LP] > no available plugins to migrate from

#

plugman info PermissionsEx
[12:28:57 INFO]: [PlugMan] Plugin Information: PermissionsEx
[12:28:57 INFO]: - Version: 1.19.5

#

can you guys add support to migrate from this version to LP?

crystal sonnet
#

What’s the current version of PEX?

icy tinsel
#

@nocturne elbow can't you just update to the latest?

#

Or download an earlier version?

#

Ofc backup your permissions

#

Surely the permissions file hasn't changed that much with pex

regal elm
#

I need help, I donno how to just add myself to the group I named 'Admin'

proud crypt
#

/lp user <user> parent add Admin

regal elm
#

Thank you ❀

livid glen
#

Hello there πŸ˜ƒ I have one question about API. Why when I getting api User from userManager() by getUser(String username) method, this User copy stores in api only about 5 minutes..? I know what LuckPerms using Caffeine for caching but maybe I do something wrong?

jaunty pecan
#

I'm not sure what you mean exactly

#

can you maybe share the code you're using?

#

just so I can get a better idea of what you're trying to do :p

livid glen
#

Hi, Lucko.
I have a large system depends on your permission plugin.
My big core api plugin, messenger bot (to provide two factor auth and another cool stuff), and some small plugins depends on core api and your plugin.
Before LuckPerms, I used custom permission plugin with custom uuids system and now I have very big donation data. It's reasonable for me to use a single uuid system for all my plugins.. I was decided to move to the LuckPerms and import all of my data from old plugin. I write importer in LuckPerms and convert all uuids to my own uuids system with all donation data.
I rewrite some code in your plugin to handle my new uuids and now something went wrong, when I trying get User copy.
I rewrite all connection listeners. Just change player.getUniqueId() to my uuids system.
Sorry for my bad english... And thank you.

#

Without
if(user == null) user = luckPermsApi.getUserManager().loadUser(toDardUUID(player.getName())).join();

#

It works only ~5 minutes

#

After 5 minutes I always get null

livid glen
#

Can I send you a link of my modification of LuckPerms?

jaunty pecan
#

Oh right okay

#

yes, offline users are unloaded automatically after 5 minutes

#

you need to keep calling loadUser when you want to view/modify data

#

the auto unload behaviour is handled here

livid glen
#

Oh

#

Okay

#

I'm noticed to this too

#

Can I pm to you with my link?

jaunty pecan
#

hm?

livid glen
#

With my changes or you're not interested?

jaunty pecan
#

Well you didn't say what the "link" was

livid glen
#

Archive with source code

jaunty pecan
#

I don't really understand what you're trying to suggest

livid glen
#

Advice, maybe I'm doing something wrong.. Your code is amazing and difficult at same time

jaunty pecan
#

oh right, i'm happy to answer questions

#

but would prefer just snippets of code instead of having to look for changes in your version πŸ˜›

livid glen
#

It's okay?

#

My changes

jaunty pecan
#

It should be okay

#

if you want to do that sort of thing, you basically want to check for all usages of player.getUniqueId() in the codebase and run them through your conversion method

#

intellij will let you search pretty easily

livid glen
#

That's exactly what I did πŸ˜ƒ

#

And this

#

Because lp user info Status with UUID not working after my changes

jaunty pecan
#

uhh yeah

#

anything that uses the isPlayerOnline(UUID) method will probably not work

livid glen
#

And I added one more Dao, called Aerospike

#

What you think about this database?

#

Something like this

jaunty pecan
#

cool!

#

nice to see other databases being used

#

there's an implementation using cassandra here

livid glen
#

My skills in programming much lower than yours, but maybe I refactor some code and make pull request with this?

jaunty pecan
#

I probably won't accept PRs which add new storage implementations, they become a bit of a maintenance burden for me

#

but I've added an API (as you can see from above) which lets other addon plugins provide storage implementations at runtime

livid glen
#

Okay :)
Thank you so much for your feedback!
I was very pleased to talk with you :)
Thank you for your amazing plugin and really cool architecture of code, a lot of interesting features I found for myself in your plugin!

jaunty pecan
#

thank you for the kind words, and I'm glad you've found some use for it πŸ˜ƒ

livid glen
#

Using your storage impl in my plugin

jaunty pecan
#

o wow

#

nice!

livid glen
#

But I really do not fully understand how she works... :'DDD

jaunty pecan
#

haha

livid glen
#

But with this it works great

#

Thank you once again and goodbye πŸ˜ƒ

#

Oh! One last question!

#

Why this is happening?

#

Storage is empty

#

try {
this.phaser.awaitAdvanceInterruptibly(this.phaser.getPhase(), 10, TimeUnit.SECONDS);
} catch (InterruptedException | TimeoutException e) {
e.printStackTrace();
}

#

In storage memory nothing contains while plugin disabling

night phoenix
#

Hello, Luck, does your maven dependency manager handle transitive dependencies?

jaunty pecan
#

Uhh no it doesn't

night phoenix
#

😭

gusty goblet
#

How would I go about getting a player's group across all contexts?

jaunty pecan
#

Contexts.allowAll()

random locust
#

How can I get a user's prefix using the luckpermsapi?

jaunty pecan
#

it's covered on the wiki page

livid glen
#

Hello, Luck, how can I add temporary group to user? Which will disappear in a month

jaunty pecan
#

Use the setExpiry method on Node.Builder

livid glen
#

Thanks!

#

And.. If this group has a weight higher than the existing , I need to set it to primary?

#

After it expires, previous group sets automatically?

jaunty pecan
#

uhh you shouldn't need to do that

livid glen
#

Ok.
luckPermsUserToGrant.setPermission(
luckPermsApi.getNodeFactory().makeGroupNode(groupToGrant)
.setExpiry(month.getTime()).build()
);

#

It's okay?

jaunty pecan
#

depends what month.gettime returns

#

but other than that yes

livid glen
#

Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, 1);
Date month = calendar.getTime();

#

Oh.. Node has setExpiry(long, TimeUnit); I din't notice

icy tinsel
#

Does luckperms support webhooks? I think I saw it somewhere....

#

Or would we have to code our own plugin to work as a webhook

jaunty pecan
#

in what sense would it work with a web hook

ancient totem
#

How long did it take u guys to make luckperms

jaunty pecan
#

coming up to 2 years of work

crude laurel
#

Dang

icy tinsel
#

I'll take that as a "not included in luckperms"

random locust
#

I was able to get the player's primary group, but I didn't see a method to get the prefix of the group. Could you tell me the name?

jaunty pecan
#

you'll need to read from above to understand how you get to that point

#

but those are the methods you need

random locust
#

oh thanks, I got it to work.

jaunty pecan
#

itsTyrion - Today at 20:54
User user = LuckPermsApi.getUserManager().getUser(p.getUniqueId());
non-static getUserManager() can't be referenced from a static context. normally when I get this while coding when forgetting a "static", but in this case, I don't know how to do ._.

#

@limber token LuckPermsApi is an interface

#

you need to obtain an "instance" of it

limber token
#

I'll go look for my brain... in the microwave or so... 🀦

jaunty pecan
#

πŸ˜›

limber token
#

sooo I didnt even know about LuckPerms 'til a few days ago...
I need an equivalent of cloudplayer.getPermissionEntity().getPermissions().put("silenthub.fallback", true); (what I do for the cloudnet perms system)
Please write like you're talking to an idiot, bc you are. I'm very new to (bukkit)development^^

jaunty pecan
#

it's (unfortunately??) not as straight forward to do in luckperms

#

but on the plus side, it's quite well documented

#

you need to:

  • obtain a User instance
  • create a Node
  • add the node
  • save the user
#

all of that is explained here

#

try to read through as much of it as you can, if you have any questions feel free to ask and I'll try to explain in more detail πŸ˜›

limber token
#

Hmm. 1 snack and minute, creating a node seems simple. let's have a look...

#

Wow. It is actually as eZ as fighting an afk steve with no armor xD

crude laurel
#

That deserves a pin

nocturne elbow
#

How to get group display name with API?

nocturne elbow
#

Btw can I add for default group permission group.test won't this cause any issues @jaunty pecan

frank driftBOT
#

Hey Milburn! Please don't tag staff members.

nocturne elbow
#

if being more accurate: adding "group.c" permission for group called "c2", which inherits default group with displayname C

nocturne elbow
#

Luck :/ ?

jaunty pecan
#

yep sounds fine

nocturne elbow
#

how about get display name with API?

#

of group

jaunty pecan
#

(sorry for not replying πŸ˜› )

nocturne elbow
#

np

jaunty pecan
#

getFriendlyName()

crystal sonnet
#

Can I iterate over all know players and filter if they have a certain permission? (Will be executed async, so can take a while)

jaunty pecan
#

do you need to check for inheritance too

crystal sonnet
#

Yes.

#

Like I want to check if a player is in the group team directly or indirectly

#

I mean it can take a while, doesn't matter

jaunty pecan
#

yeah i guess that's the only way then

crystal sonnet
#

Ok. So the API provides a method to iterate over all players LP knows?

jaunty pecan
#

yes

crystal sonnet
#

Great. Do you know which call it is? If not I'll find it. But if you know it at the top of your head it would be nice telling me xD

jaunty pecan
#

storage.getuniqueusers

#

i think

crystal sonnet
#

Ok

#

Thanks

pine surge
#

Hey can anybody help set up my server perms and what not I'm new to this plugin?

trail oar
mint hull
#

An exception was thrown by me.lucko.luckperms.common.contexts.LuckPermsCalculator whilst calculating the context of subject CraftPlayer{name=Scarpex}

This error appears when i ask the player about a permission.

graceful pawn
#

hello, how can i check and get time of player's temporary rank?

jaunty pecan
#

you can then use the stream API (or just if statements inside a for loop) to search for temporary group nodes

crystal sonnet
#

Hi Luck, does storage.getUsersWithPermission

a) take into account all users known to LP?
b) take into account inhertiance etc?

jaunty pecan
#

yes, no

crystal sonnet
#

Ok. For that I have to load the users first, right?

jaunty pecan
#

Yes

#

but even if they're loaded, the call won't account for inheritance

crystal sonnet
#

Ok. But I mean I can load every player one by one and the check if they inherit the permission?

jaunty pecan
#

Yes

crystal sonnet
#

user.hasPermission or user.hasTransientPermission?

jaunty pecan
#

neither of those calls account for inheritance

#

if you want to run a "real" check you need to do it using the userdata class

crystal sonnet
#

Which do I need to use then, when I have the User object?

jaunty pecan
crystal sonnet
#

I've created Frankenstein's monster xD

#
  private static Comparator<User> getUserComparator() {
    return Comparator.<User>comparingInt(
            user ->
                user.getCachedData()
                    .getMetaData(lpContextsGlobal)
                    .getMetaMultimap()
                    .get("weight")
                    .stream()
                    .flatMapToInt(
                        weight -> {
                          try {
                            return IntStream.of(Integer.parseInt(weight));
                          } catch (NumberFormatException e) {
                            return IntStream.empty();
                          }
                        })
                    .findFirst()
                    .orElse(Integer.MIN_VALUE))
        .reversed()
        .thenComparing(User::getFriendlyName);
  }
quartz fossil
#

oh jeez

crystal sonnet
#

Erm, which events do I have to listen to, to catch all permission changes?
And can I use the default Bukkit event system, or do I have to use the EventHandler provided by the API?

jaunty pecan
#

UserDataRecalculateEvent

#

and you have to use the eventhandler

#

it's not possible for me to post the events to the bukkit system

crystal sonnet
#

So LuckPerms.getApi() .getEventBus().subscribe(UserDataRecalculateEvent.class, new PermissionChangeListener()); is right? (Assuming PermissionChangeListener implements Consumer<UserDataRecalculateEvent>?)

jaunty pecan
#

yep

crystal sonnet
#

Perfect!

#

Thank you so much!

jaunty pecan
#

no worries

#

sounds like you're making something fancy πŸ˜›

crystal sonnet
#

I'm seriously wondering how bad my code would look without lambdas

#

Yes, I'm making a plugin that generates a list of all team members and adds their heads into a Head Database category (generating the list is complete, once the API of HeadDatabase allows adding heads, then I'm essentially done)

jaunty pecan
#

nice!

crystal sonnet
#

Any idea how I could speed that up? https://hastebin.com/icuvubilic.swift

Maybe using parallelStreams, or collecting and creating a new stream after the .map(lpUserManager::loadUser) call?

jaunty pecan
#

yes, definitely a valid use case for parallel streams

#

btw assuming you're using java8

#

TeamMemberFinder::waitForCompletion can be replaced with CompletableFuture::join

crystal sonnet
#

Ah! Good to know!

#

One more problem, I listen to the UserDataRecalculateEvent. When I recieve this event I schedule a refresher of the users, which in turns causes userdata recalculations...

#

Could I use the LogBroadcastEvent instead?

jaunty pecan
#

Yes

graceful pawn
#

it's too hard, can you send me a code where i can get expiry of player's group vip?

crystal sonnet
#

Looks like the LogBroadcastEvent is never sent...

jaunty pecan
#

p. sure it is

#

will do some debugging in a sec

#

Feerko, there are plenty of examples on the wiki page. If you don't understand, then there's zero benefit in me (or anyone) just doing it for you πŸ˜›

graceful pawn
#

ok, so can you add an example to get expiry on wiki?

#

you will help for others not only for me

#

can you? πŸ˜„

graceful pawn
#

i did it πŸ˜„

crystal sonnet
#

πŸ‘πŸ»

crystal sonnet
#

Luck, did you check the event?

random locust
#

How can I get a player's primary group display name?

proud crypt
#

I think it was something like getFriendlyName()

random locust
nocturne elbow
#

Luck, what is taking most in LP database space? It's 5MB

#

wondering how to cleanup it

jaunty pecan
#

don't know

#

you can't really clean it up

nocturne elbow
#

can you make it so it would be possible to clean up :D?

jaunty pecan
#

no because i don't store unnecessary data

proud crypt
#

5MB really isn't that much

icy tinsel
#

^

#

Code your own clean up, if you want one. And expect bugs

crystal sonnet
#

Sorry for asking again Luck, but did you manage to debug the event?

#

Because so far it hasn't fired once even though I've personally recieved log messages

jaunty pecan
#

haven't had a chance to look yet

crystal sonnet
#

Ok

crystal sonnet
#

Wtf

#

Now it works

#

Weird

jaunty pecan
#

hm

#

is there a need for me to look into it then?

crystal sonnet
#

I don't think so

jaunty pecan
#

ya seems to be working for me

#

using

#
importPackage("me.lucko.luckperms.api");

var LuckPermsApi = Java.type("me.lucko.luckperms.api.LuckPermsApi");

var UserDataRecalculateEvent = Java.type("me.lucko.luckperms.api.event.user.UserDataRecalculateEvent");
var LogBroadcastEvent = Java.type("me.lucko.luckperms.api.event.log.LogBroadcastEvent");

var api = server.getServicesManager().load(LuckPermsApi.class);
var eventBus = api.getEventBus();

registry.with(eventBus.subscribe(UserDataRecalculateEvent.class, function(event) {
    Bukkit.broadcastMessage("------------------------");
    Bukkit.broadcastMessage(">> UserDataRecalculateEvent");
    Bukkit.broadcastMessage("user: " + event.getUser().getName());
    Bukkit.broadcastMessage("data: " + event.getData().toString());
}));

registry.with(eventBus.subscribe(LogBroadcastEvent.class, function(event) {
    Bukkit.broadcastMessage("------------------------");
    Bukkit.broadcastMessage(">> LogBroadcastEvent");
    Bukkit.broadcastMessage("entry: " + event.getEntry());
    Bukkit.broadcastMessage("origin: " + event.getOrigin());
}));
long moon
#

beautiful, the thing I wanted to confirm is right there in a pretty picture for me πŸ˜„

jaunty pecan
#

hm?

#

idk what you’re talking about πŸ˜›

long moon
#

Was wondering what event would be fired if I modified somebodies player data, and it was right there in a picture confirming what I thought it would be πŸ˜„

jaunty pecan
#

oh I see

#

πŸ‘

limber token
#

Is there something like .getUser(p.getUniqueId()).gethighestPermissiongroup.getDisplayName()

#

(for the lobby scoreboard, I want to avoid 100 times if(p.hasPermission("blabla") {
somesh!t
}

#

another question. I am too dumb to figure out the displayname of group x using the API

jaunty pecan
#

getFriendlyName

#

and you can do the first thing using .stream() and then sorting by group weight

limber token
#

thx. will try it ^^

limber token
#

ended up doing this btw:

        User user = Data.lpapi.getUser(p.getUniqueId());
        Group group = null;

        if (user != null) group = Data.lpapi.getGroup(user.getPrimaryGroup());

        String groupname = "Β§4ERROR";
        if (group != null) groupname = group.getFriendlyName().replace('&', 'Β§');
        return groupname;
    }```
jaunty pecan
#

πŸ‘

olive spade
#

Hey there, I looked at your BungeeConfigAdapter and your (bungee) config.yml, but I didn't figure out where you implement that config. Can you help me and say where you implement your (bungee) config.yml?

Thank you!

crystal sonnet
#

What exactly are you trying to achieve?

olive spade
#

I want to create a default config with comments from me and the way to implemts this into bungeecord. I found out that the way to implement is different then in spigot. I want to find out how this works in luckperms to be able to understand the way how this works

crystal sonnet
#

LuckPerms might not be the best plugin to find out how it works, simply because there are many different layers of abstraction involved

#

Also as far as I know, the default config is copied out of the jar. And the comments persist, because the config is never written to

olive spade
#

Hm, okay :/

Do you know a plugin where I am able to understand how this works? Maybe BungeeChat?

crystal sonnet
#

If your looking at BungeeChat look at the code of version 2.1.6. Because the current version uses a very different system!

#

@olive spade

olive spade
#

Okay, I will have a look into it - thank you :)

crystal sonnet
#

If you don’t know how to look at a tagged version of a Git repo, I can tell you how to do it if you tell me where/how you prefer to browse the code

nocturne elbow
#

how to delete user with API?

covert compass
#

player.clearnodes()?

trail oar
#

Luck

#

How can i get players info? like prefix, suffix

jaunty pecan
trail oar
#

Luck I tried, but when i use the command to get prefix, server crashes (Stop responding)

jaunty pecan
#

probably because you're misusing the futures

#

can you share the code you're using?

jaunty pecan
#

okay so

#

on the first line where you call join()

#

that's the problem

#

if you know the user is already online, it's not necessary to make that call at all

trail oar
#

Uhmm, youre right

#

command is used only when player is online

#

I'll try

#

Works perfect, thanks! πŸ˜„

trail oar
#

Luck

#

Sorry to ask again

#

Im using the api to get Players prefix, i could get it work. The command fires a method that opens an inventory with an item in which one of the lores is rank what displays Rank prefix. Works fine, but when i use a PlayerInteractEntityEvent and check if clicked entity is not null, if its a player, and cast it to player. The console return NullPointerException. I'm using the same method than with the command. ("method that opens an inventory with an item in which one of the lores is rank what displays Rank prefix"). If boths are entities, and both are players. Why is this happening?

jaunty pecan
#

not sure

#

doesn't sound LP related though

#

would need to see the code to help further

mighty hearth
#

What is the best way to check if a User is in a group (LP Bungee)

jaunty pecan
#

check for the permission "group." + groupName

mighty hearth
#

ProxiedPlayer#hasPermission ?

jaunty pecan
#

ya

mighty hearth
#

tried not working

jaunty pecan
#

it does work :p

mighty hearth
#

ymm

tender iris
#

Where can I find a list of event listeners within LP? Trying to build a listener for when a player changes groups

jaunty pecan
#

there's a list of them here

#

to listen for group changes specifically, you want NodeAddEvent and NodeRemoveEvent

desert orbit
verbal lark
#

Can anyone tell me how the weighting system works for luckperms

#

The command to set weight per group, and what value sets the highest and lowest weight

crystal sonnet
#

@verbal lark the wiki page Command Usage has the command. And higher weight means higher priority

still lintel
#

Hey,
Is there an easy way to get all the groups that a player inherits (directly and indirectly) using cached data?
Also can I get somehow the tracks a player is on from cache?

crystal sonnet
#

@still lintel stream all nodes the player has and filter for all group nodes

still lintel
#

thanks v much

still lintel
#

Is there a more elegant way to get an user's tracks other than something like this:

for (Track t : api.getTracks()){
  for (String g : t.getGroups()){
    if(userGroupSet.contains(g)) {
      userTrackSet.add(t)
       break;
    }
  }
}
jaunty pecan
#

uhh nope

#

not really

still lintel
#

thx

low siren
#

how to laod api

crystal sonnet
#

Don’t call the getter before the onEnable

#

Also make sure to add LP as a dependency or soft dependency in your plugin.ynl

low siren
#

where do i put the getting then?

crystal sonnet
#

In the onEnable

#

Or in a separate class, that you don’t call before the onEnable

#

Either works

low siren
#

neat got it

#

thx

crystal sonnet
#

You’re welcome

low siren
#

is gettiing a group's prefix in wiki too

crystal sonnet
#

Just have a look

proud crypt
low siren
#

gd where do i get metadata πŸ˜‚

#

String rank = api.getUser(n).getPrimaryGroup().getPrefix()?;

crystal sonnet
#

Use the autocomplete of your IDE to your advantage

low siren
#

ye i got it

#

how come this dont work?

#
    public void onChat(PlayerChatEvent e) {
        Player p = e.getPlayer();
        String n = p.getName();
        ContextManager cm = api.getContextManager();
        Contexts contexts = cm.lookupApplicableContexts(api.getUser(n)).orElse(cm.getStaticContexts());
        MetaData metaData = api.getUser(n).getCachedData().getMetaData(contexts);
        String rank = api.getUser(n).getPrimaryGroup();
        String suffix = metaData.getPrefix();
        e.setFormat(suffix + " " + n + " " + e.getMessage());
    }```
#

oh he left

crystal sonnet
#

I’d recommend using the UUID to get the user from the API.

low siren
#

ok done

#

why still show the same

#

ohhhhhhhhhhh

#

it works

#

yey

crystal sonnet
#

πŸ‘πŸ»

low siren
#

wait

#

i did /lp group Owner meta addprefix 100 test and its not updating

crystal sonnet
#

You can get the prefix directly from the metadata

low siren
#

the prefix in chat

#

i tried changing prefix

#

it wont update

#

using command /lp group Owner meta addprefix 100 test and its not updating

#

still says Owner

crystal sonnet
#

I know. What I’m saying is, don’t get the primary group

#

Get the prefix from the user’s metadata directly

low siren
#

im not anymore

#
String prefix = metaData.getPrefix();
        e.setFormat(prefix + " Β§e" + n + ": Β§7" + e.getMessage());```
crystal sonnet
#

Also make sure the priority of the new prefix is higher than the old one

low siren
#

ohh

crystal sonnet
#

Or you remove the old one

low siren
#

o

#

i see

#

AYEEE

#

this is a bit tricky for ann average guy lol

crystal sonnet
#

Just gotta keep in mind that a computer has no fucking idea what you want it to do, so you have to be pedantically specific when giving it instructions

proud crypt
#

if in doubt, debug!

#

what is it in java... println?

crystal sonnet
#

System.out.println

#

Or just use the logger

low siren
#

why is this not working

#
            String n = p.getName();
            UUID id = p.getUniqueId();
            ContextManager cm = getOwner().api.getContextManager();
            Contexts contexts = cm.lookupApplicableContexts(getOwner().api.getUser(id)).orElse(cm.getStaticContexts());
            MetaData metaData = getOwner().api.getUser(n).getCachedData().getMetaData(contexts);
            String prefix = metaData.getPrefix();
            p.setNameTag(prefix + " | " + n);
        }```
#

getowner is main

#

class

crystal sonnet
#

Name tags are very strange

low siren
#

nvm im retarded

#

it work now

crystal sonnet
#

What was it?

low siren
#

i always forget to compile again lol

#

no problem in that coe

#

code

crystal sonnet
#

Lol

#

Except that you should use the UUID for the second getUser too

#

Or even store the user in a variable

low siren
#

yea ill do

crystal sonnet
#

In general, just assume getters are expensive, so if you’re calling the same getter twice, store the result

#

I mean if you’re getting the same object/result twice

low siren
#

ok

#

im so trigerred

#
    public void onJoin(PlayerJoinEvent e) {
        Player p = e.getPlayer();
        String n = p.getName();
        UUID id = p.getUniqueId();
        ContextManager cm = api.getContextManager();
        Contexts contexts = cm.lookupApplicableContexts(api.getUser(id)).orElse(cm.getStaticContexts());
        MetaData metaData = api.getUser(id).getCachedData().getMetaData(contexts);
        String prefix = metaData.getPrefix();
        p.setNameTag(prefix + " | " + n);
}
        ```
#

not working

#

but work on playerChat

#

nukkit bug maybe

#

bc i been having problems with playerJoinevent

sacred mist
#

Trying to change a group of a player and yet their group will not change no matter what I do. Any suggestions?

crystal sonnet
#

See if there’s maybe a save or update method for the user

#

Also is the debug Text being called?

sacred mist
#

yes, the debug text is

#

and it's running through the block without any errors

crystal sonnet
#

Hm. If there’s no save, store or update method, then I don’t know. I’m sorry

sacred mist
#

the only thing remotely close to a 'save' method would be refreshCachedData, which seemed to have done nothing

#

all good, thank you

crystal sonnet
#

You’ll need to wait for Luck. He’ll know

sacred mist
#

alright, when's he around usually

crystal sonnet
#

He lives in GB and is around starting at about noon

#

One more idea

#

Did you check that rank is in fact different from the rank the player has? Try a quick debug I’d say

sacred mist
#

I didn't, but it's worth a check

#

darn that's frustrating, I guess it's working in theory but there must be an obscure method to apply and save the data in game to cache.

crystal sonnet
#

Yeah. I hope you’ll figure it out

sacred mist
#

woot woot api.getUserManager().saveUser(user).thenRunAsync(user::refreshCachedData);

crystal sonnet
#

Ahhhh

#

There you go

jaunty pecan
#

πŸ‘

mighty hearth
#

the method ProxiedPlayer#hasPermission does not work for group.<group name>

jaunty pecan
#

it should do

#

it's handled in the same way as on bukkit

mighty hearth
#

But it returns false for some reason

mighty hearth
#
if(u.getCachedData().getPermissionData(cm.lookupApplicableContexts(u).orElse(cm.getStaticContexts())).getPermissionValue("group."+g.getName()).asBoolean())```
#

cm is ContextManager from api.getContextManager()

#

so should this be correct

#

@jaunty pecan

frank driftBOT
#

Hey Cubxity! Please don't tag staff members.

mighty hearth
#

Oh sorry

crystal sonnet
#

@mighty hearth why don’t you just use the permission check of the platform?

mighty hearth
#

brainstone so I am using bungee, does it support offline player perm?

crystal sonnet
#

That it doesn't

#

Though your code looks correct

lament bay
#

Can anyone provide an example of changing the permission for an offline player in Bukkit? The api docs suggest to use the Bukkit scheduler to handle the requests asynchronously. Does this mean I should create a bukkit event when the task finishes and add a listener?

jaunty pecan
#

there are examples on this page

#

If you don't understand how to load/modify data for offline players, then I suggest reading the first few sections, as it's explained in a lot of detail there

lament bay
#

I think I've got that code worked out, I'm just concerned that it's being called synchronously

#

Would this be a good application for your helper Scheduler?

jaunty pecan
#

No, you can use the bukkit scheduler for it

lament bay
#

I'm looking at your api docs again and see this section mentioning using an executor, is this where I can apply that usage of the scheduler?

jaunty pecan
#

Yes

lament bay
#

If I need to use the result of the operation once it's complete, would I need to send an Event and listen for that to work with the result?

#

For example, I create a function to update a permission or group for an offline user, but then want to perform a follow up operation elsewhere, once the update has completed?

tender iris
#

Could someone tell me a method I can use to promote a player in code vs. command?

#

command I am using is /lp user PLAYER promote members

#

Track name is members

nocturne brook
still lintel
#

what's in your givePlayerPermission.java which line is line 18 in your source

#

NullPointerException suggest that you are trying to do something on/with a null object

tender iris
jaunty pecan
#

Yes you're right, the API doesn't support it

#

using a command isn't really the best solution, but I suppose it's probably the easiest

#

it is technically possible to do via the API, you'd just need to replicate the promotion behaviour

nocturne brook
#

@still lintel line 18 is User user = luckPermsMain.api.getUser(player.getUniqueId());

still lintel
#

Well, debug it and see which one of those is null when executing, i suspect the player instance

nocturne brook
#

how come?

#

Command class:

    public void execute(CommandSender commandSender, String[] args) {
        if (commandSender instanceof ProxiedPlayer) {
            ProxiedPlayer p = (ProxiedPlayer) commandSender;
            p.sendMessage(ComponentSerializer.parse("{'text':'[Kick]','color':'red','clickEvent':{'action':'run_command','value':'/kick " + p.getName() + "'}},{'text':'[Kick]','color':'red','clickEvent':{'action':'run_command','value':'/kick \" + p.getName() + \"'}}"));
            if (p.hasPermission("potsmc.violationalert")) {
                removePlayerPermission.removePlayerPermission(p, "potsmc.violationalert");
                p.sendMessage(new TextComponent("Staff mode disabled"));
            } else {
                givePlayerPermission.addPermission(p, "potsmc.violationalert");
                p.sendMessage(new TextComponent("Staff mode enabled"));
            }

        }
    }```
still lintel
#

In the snippet you supply player using an argument
Either that or the api instance is null

nocturne brook
#

    public LuckPermsApi api;

    public LuckPermsMain() {
        api = LuckPerms.getApi();
    }
}``````public void onEnable() {
new LuckPermsMain();
}```
still lintel
#

Removing works or that fails too?

nocturne brook
#

That fail

still lintel
#

When you try using the command, you get back the message?

nocturne brook
#

Yes

#

I found a way to fix this.

still lintel
#

What was the way to fix it?

nocturne brook
#
luckPermsMain.api = LuckPerms.getApi();```
#

Others unchange

sleek cove
#

How to get a player group from sponge plugin?

#

ok

#

but

#

how to get list of the groups?

#

api.getGroups()

#

Thank docs

#

πŸ˜„

autumn kiln
#

Hey. I was having a problem. I have a spigot server, and for some reason. My prefixes were not showing

crystal sonnet
autumn kiln
#

ok

trail oar
#

Luck, i know this may be a silly question. Can i get the prefix of a player using the api when creating a plugin for BungeeCord?

void vector
#

is this the place to ask for help with server crashings?

crystal sonnet
#

@trail oar there's a wiki page on the API

rain dome
#

Hey luck, in user#inheritsGroup - is there a way to specify all contexts?

#

I want to get all groups, not just a specific context

crystal sonnet
#

You could iterate over all user nodes and filter everything out that isn’t a group @rain dome

rain dome
#

That's horrendously messy, I'd prefer not to do that

#

If it's the only way, I will, otherwise I'd prefer something else

jaunty pecan
#

not sure i understand the question

crystal sonnet
#

What’s messy about that?

#

Using streams it’s easy as cake

rain dome
#

To clarify, you can specify a context for inheritsGroup, is there any way I can make that context include multiple servers

tepid sorrel
#

Why is setPrimaryGroup not working? Is there something else needed besides save?

#

@proud crypt any clue? Since youre online x.x

frank driftBOT
#

Hey Albfred! Please don't tag staff members.

tepid sorrel
#

Rip

#

Isnt there a way of like, removing perms

#

Like to tag staff

#

Tag me if anyone responds i guess

#

Literally ran setPrimaryGroup(string) and sended the message of their primary group and it didnt change it at all

proud crypt
#

No there isn't and no I don't know.

tepid sorrel
#

Oy luck

#

You available?

jaunty pecan
#

hi

tepid sorrel
#

Are you available for voice for quick help

#

Voice is faster communication

jaunty pecan
#

@rain dome best way to do that is just by querying the full set of nodes

#

No i can’t, you have my attention for about 1 min and then I’ve got to go πŸ˜ƒ

tepid sorrel
#

Okay so what exactly does setPrimaryGroup do

#

Because when i run it on a user then do getPrimaryGroup it doesnt seem to change

jaunty pecan
#

it will only change the stored valid

#

value

tepid sorrel
#

And if i do usermanager.save(user) it saves that

#

Right?

jaunty pecan
#

you will need to set primarygroup-calculation-method to stored in the config for it to apply

tepid sorrel
#

Oh

#

OH

#

THANKS

ember wind
#

Oh?

#

Worked

tepid sorrel
#

Ty ily

nocturne elbow
#

Why does /lp user <nick> switchPrimaryGroup <group> <- doesn't remove old group from one which we are switching off?

#

and add new

crystal sonnet
#

Because you want to use parent set instead

nocturne elbow
#

is group set and parent set same?

#

because group set (removes other temproar group from player)

crystal sonnet
#

Yes.

nocturne elbow
#

Hey! For some reason, I'm on a group called "owner" with its prefix and everything, but it shows the default prefix instead. How do I fix this?

tardy lava
#

probably cause weights

nocturne elbow
#

Yeah, fixed it.

serene orchid
#

Can someone help me negate a permission in an inheritance with default for instance default has a prefix in tab. Merchant is parenting it also so it has that but also has the permission for the Merchant prefix, but it dose not show up because of the permission in the default, is there a way to negate it in merchant, but not take it away in default?

teal tartan
#

lp group merchant permission set default_perm false

#

And merchant group need bigger priority

green jasper
#

how do I check if user or any of their groups have a certain permission? user.hasPermission() returns true only if the permission is set directly to the user

#

I don't have Player instance so I need to check that with User instance

#

or I need to manually get all the nodes and check if they match the target permission?

crystal sonnet
#

Why don’t you use the platforms permission check?

green jasper
#

it's asynchronous

crystal sonnet
#

Doesn’t matter

green jasper
#

of course luckperms override default permissions πŸ˜„ so it's thread safe right?

crystal sonnet
#

Sponge, Spigot and Bungee can handle Async permission checks if the plugin implements it. Which LP does

#

And I can also check how a permission check is done through the API. I’ve done it before

#

So you’ll have both possibilities. Use what makes more sense in the context

green jasper
#

OK thanks I'll try to do that with player instance

crystal sonnet
#

πŸ‘πŸ»

green jasper
#

found another problem, why user.getPrimaryGroup() returns always "default" but in /lp user someuser info I see another primary group?

green jasper
#

or is there any other easy way how to get users primary group? Or I have to write my own method for that? πŸ˜„

jaunty pecan
#

it should return the correct value

#

yeah I just double checked

#

the API method calls the same method as the one used in the command

still lintel
#

okay, does someone know "how async" bungee is?
e.g. if I do something like this:

public  User getOfflineUser(UUID who) {
    return user = luckPermsApi.getUserManager().loadUser(who);
}

Would caling that method will hog down my bungee instance?

jaunty pecan
#

depends on the context of the call

#

from scheduler tasks, that's fine

#

but probably not from standard events

#

you want to avoid blocking the networking threads

still lintel
#

let's say I just call it when I execute a command

#
public void execute(CommandSender commandSender, String[] args) {
...
User u = getOfflineUser(pUUID);
System.out.println(u.getName());
}
tropic jewel
#

is there no way to get a offline user by name or am I blind?

still lintel
#

I did it like this:
~~```
api.getStorage().getUUID(userName).thenAcceptAsync(uuid -> {
api.getUserManager().loadUser(uuid).thenAcceptAsync(user -> {
//do something with user
});
});

Better solutions are welcome though
#

Also is there any difference between these? Can the second load the user from it's name when invalid/valid uuid is supplied?

api.getUserManager().loadUser(uuid)
api.getUserManager().loadUser(uuid,userName)
#

I've forgot to rtfm, the above is for an older api version

api.getUserManager().lookupUuid(userName).thenAcceptAsync(uuid -> {
  api.getUserManager().loadUser(uuid).thenAcceptAsync(user -> {
     //do something with user
  });
 });
tropic jewel
#

does that only use the data LP has or also mojang requests?

still lintel
#

Only LP data

tropic jewel
#

alright good, will try that then, thanks

tropic jewel
#

hm, it says that it is using the cache. Doesn't that mean it will only lookup the uuid of users who are online?

still lintel
#

loadUser and lookupUuid loads from the storage backing (the reason you have to use it async)
getUser uses the cache

delicate bough
#

Hi, please how i have web app for add/remove groups?

crystal sonnet
#

Mind to elaborate a little bit? Not sure what exactly you are asking @delicate bough

delicate bough
#

How i can use API for add/remove groups from player πŸ˜ƒ

crystal sonnet
#

The API is only available for other plugins. It's not a web API

lucid lodge
#

Can I ask something about the api?

#

Is there a event that gets triggerd when player's rank changes?

#

Like API

#

@crystal sonnet ?

frank driftBOT
#

Hey TeAm6_AZLIK! Please don't tag staff members.

lucid lodge
#

Wow stupid bot

crystal sonnet
#

There are a few generic events

#

So you can listen to them and filter them

lucid lodge
#

you guys know skript-mirror?

crystal sonnet
#

No

still lintel
#

never used it

lucid lodge
#

Someone said I cant just use your guys api bc you guys use interface

crystal sonnet
#

Can’t help with that

#

Also if I’m not entirely mistaken, LP uses it’s own event system, to make the API platform independent

lucid lodge
#

En that means?

crystal sonnet
#

I bet this Skript thing uses the Bukkit event system. Which means that registering a handler for the even the way you do cannot work, because the events are handled through LPs own system

next tiger
#

Does LuckPerms have an event for when someone is added/removed from a group? I had a look but couldn't find anything besides the ones about track and the closest thing I could find to what I'm after is UserDataRecalculateEvent

still lintel
#

group are represented az nodes too,
so NodeMutateEvent should work here too

next tiger
#

aha I had that but I was listenin on my own perm, forgot that lp does that so I guess listening on group. should work

#

I'll give it a go, thanks

#

Yeh works like a charm, many thanks

lucid lodge
#

@crystal sonnet , got any idea to fix?

frank driftBOT
#

Hey TeAm6_AZLIK! Please don't tag staff members.

jaunty pecan
#

Its probably not possible using skript alone

#

Ive never used skript before so cant help you either

#

LP events are dispatched through a different event system to the other events running on the server

lucid lodge
#

Its possible with skript-mirror

#

Its a addon that support java in skript

crystal sonnet
#

Alright. Then use that. The wiki has a page on how to use the API. Iirc it should contain an example how to use the LP event system

lucid lodge
#

link?

jaunty pecan
sullen kite
#

How would I get the name of a group that a user is in.

still lintel
nocturne elbow
#

@still lintel

still lintel
#

Yes, @nocturne elbow?

south sail
#

How would i get a list of all the groups a user inherits?

nocturne elbow
#

At the moment I use the following in my plugins to set up colors and more:

 if(player.hasPermission("group.administrator"))
        {
            team = "B";
            color = "Β§4";
            tablist = "Administrator";
        }

Is there an option to set every group a meta for that and access it with the API?

#

I want to replace

        String color = "Β§a";
        String team = "Z";
        String tablist = "Spieler";

with something like that:

        String color = controller.getLuckPermsApi().getMeta("color");
        String team = controller.getLuckPermsApi().getMeta("team");
        String tablist = controller.getLuckPermsApi().getMeta("tablist");

But how can I get the meta?

still lintel
nocturne elbow
#

Hm okay, will have a look at it

still lintel
#

@nocturne elbow If you have a MetaData of a group then metaData.getMeta().put(key, value) might work

nocturne elbow
#

Okay

hot ledge
#

I guess it's technically an API made by luck πŸ˜›

#

Who has used luck's Helper?

#

I'm confused with commands

#

do they still need to be in an onCommand?

#

I couldn't find it used in LuckPerms' repo to find an example

#

@proud crypt ?

frank driftBOT
#

Hey Artitus! Please don't tag staff members.

proud crypt
#

I have no idea sorry

hot ledge
#

oof

#

All good, I know brainstone does dev work

proud crypt
#

I only know stuff about LuckPerms

hot ledge
#

I'll just test ig

delicate bough
#

@jaunty pecan can u write me please? I have private question

frank driftBOT
#

Hey matyvane! Please don't tag staff members.

jaunty pecan
#

what's it about?

delicate bough
#

i send u to spigot

jaunty pecan
#

I don't really see how that's a private question :p

#

but uh, anyway

#

the API is explained in detail on these pages

delicate bough
#

Yes I read it. But it did not help me too much

jaunty pecan
#

all of the things you've asked for are covered in those pages :p

delicate bough
#

okey

jaunty pecan
#

i know it's a lot to read, but I think it's definitely worth just spending a few mins reading through everything

#

*reading through everything in order

#

πŸ˜‰

tender iris
#

@jaunty pecan , any chance spark will run on the client to profile the client itself?