#luckperms-api
1 messages · Page 19 of 1
yes but i can't check if player have new role for send title
That sentence doesn't make sense
I use an custom command because i send an title to the player when promoted to the VIP group for example. If player is not logged i send the title on next login
You can check if the player has the "new" rank before you start removing things
yes i have make that
Yo I have a question. For some reason Luck Perms in GUI ain't loading on the server I'm on. Any soltuions?
Why are you asking this question here?
Um wrong channel?
That, and we don't offically support LPGUI
O sorry
Anyways, #general, might be able to help, if it's a "normal" issue (never used LPGUI but maybe someone else will see it there)
@crystal sonnet if it's user.unsetPermission(Node), I don't understand the Node part
Hey Zen! Please don't tag staff members.
Hello, if i load a potential offline user async with completable future and he is online, what will happen? DO i have to check first if he is online or is luckperms checking it?
Is there a way we can tap into a server's luckperms database for a discord webhook or bot?
Hey I have some doubts about how something is behaving in specific. When I unset a group or permission on an offline player it's done instantly, but when setting it for an offline player it either doesn't set it or takes an unconfirmed amount of time.
@uneven radish then the loading will succeed instantly and the async code will be run
@rotund light the Node is the actual permission
@sudden seal Can you elaborate?
Especially on what kind of data you need
@silent bough you need to save changes
Then what permission do I need to put there in order to remove those meta
The best way if you want to remove something from a player is by iterating over all the nodes they have and filtering for the one(s) you want gone and removing them
Can you show the code then?
Please don't do this
There's one cardinal sin of prgramming
And that's not programming in English (or whatever language the programming language is in)
Wut?
You aren't joking?
Only non english words are messages sent to players or 1 or 2 words used internally in our server
That's obvious, players wouldn't understand the message otherwise
And there are just a handful of variable names which are used by us
Which is what I said in my previous comment
If it's not an inconvenience I'd like some help instead of nitpicking some minor details, honestly it's kind of disrespectful
I understand you might argue if I'm not willing to code everything in english I shouldn't come here expecting help
In such case I'll go elsewhere
I find it rude having code not English given to me in the expectation for me to find issues in it. Before you complain, my native language isn't English either.
Now back to the topic. I honestly don't know what's going on. If I remember correctly the save method returns if it was successful or not. Try outputting that result
And btw, if players see raw expection messages, something is wrong.
Are you trying to do this through your own (custom) plugin? Because that’s what the API is for @lament pulsar
If you’re just talking about using the plugin, ask in #support-1
i found out
Why Am I getting null pointer exception when im trying to set someones primaryGroup??
Why is that code not working? https://pastebin.com/DCDDSKCs
do i have to set temp permissions in another way?
Hello, have make and command for promote/demote an user with send title but i don't know how i can reset the primary group to default when revoke user from group
When i want to change the content of a meta node from a user. i have to delete the old one and set the new one, is this correct?
Correct
Could you please help me?
If you ask your question @uneven radish
I did yesterday just 4 messages ago
User user = Util.getPermUser(pi.getUUID());
user.setTransientPermission(perm);
MineconomyWorld.luckPermsApi.getUserManager().saveUser(user);
i save them?
@crystal sonnet Do you know someone which can help me?
Hey cerexus! Please don't tag staff members.
Sorrry Clippy
Luck
If he read this chat
Could you message him with my problem please?
@jaunty pecan you gotta check this channel more often 😜
@nocturne elbow are you sure that the person youre calling that on even has a prefix if its null then
they do. i tested it with /lp user zbk info
how did you get your userContext
getContextForUser
i think you should be using the context manager
ContextManager#getApplicableContexts(player) or ContextManager#lookupApplicableContexts(lpUser)
oh its spitting out a IllegalStateException
for what
ApiUser not being assignable from ProxiedPlayer
I know LP has a User object, haven't seen an ApiUser object...
me.lucko.luckperms.common.api.implementation.ApiUser
interesting
oh i was using get instead of lookup
still null though
is the player online
yup

Maybe someone in here knows then 
How would I be able to set a users group through the api?
!wiki
:paperclip: https://github.com/lucko/LuckPerms/wiki
Developer section
I looked through there and I didn't find anything on how to set a users group
You load user and set him group.groupName permission then save him
why is luckPermsApi.getUserManager().getUser(p.getUniqueId()).getPrimaryGroup() returning default when the users primary group is not actually default
Are you sure it's not default?
Node memberranknode = DiscordLink.getPlugin().getLuckPermsApi().getNodeFactory().newBuilder("group.member").build();
DiscordLink.getPlugin().getLuckPermsApi().getUserManager().getUser(event.getPlayer().getName()).setPermission(memberranknode);```
So um... is this supposed to work?
you have to save
public static void addPermission(Player p, String permission) {
LuckPermsApi api = MineconomyWorld.luckPermsApi;
User user = api.getUser(p.getUniqueId());
Node node = api.getNodeFactory().newBuilder(permission).build();
user.setPermission(node);
api.getUserManager().saveUser(user);
}
thats working for me
not for me
this is correct isn't it
this is how I use it
LuckPerms.removePermission((Player) Bukkit.getOfflinePlayer(args[0]), "group." + args[1].toLowerCase());
LuckPerms.removePermission((Player) Bukkit.getOfflinePlayer(args[0]), "group." + rank.getName().toLowerCase());```
oh wait
hold on imma try something
It keeps coming up with NullPointerException when I do this: User user = api.getUserManager().getUser(p.getName());
maybe api is null?
should metaData.getPrefix() return the value shown in this screenshot?
or is that separate from metadata
Api isn’t null, it’s LuckPermsApi api = DiscordLink.getPlugin().getLuckPermsApi()
that doesn't mean it's not null?
Yeah its just re-instancing lol
How do I register a luckperms event?
@jaunty pecan Could you please help me with my issue some messages above? (3 days ago at 12:30 pm with a pastebin link)
Hey cerexus! Please don't tag staff members.
Btw. Sorry for marking you
does getApplicableContexts work with a ProxiedPlayer instead of a regular player
Nevermind
how do i get the color of a specific rank?
Is it possible to get all players in a group using the API?
Something like api.getGroup("name").getMembers() perhaps?
(something which includes offline players)
Actually, kind of like the ingame command lp group name listmembers, but using the API
yep, this method
use group.admin as the permission to get members of the "admin" group
Ah I missed that one, thanks!
@uneven radish are you getting any errors when running the code, or just not working?
sorry for the slow replies in this channel, I've been super super busy :((
Hey its okay, thought you oversaw me ^^
Thanks for that great plugin btw. it works so nice, this is the only problem with it
no errors
For me the code looks not false, but maybe i did something wrong
permanent permission giving is working with the code some messages above. but the temp permissions not
so if i understand correctly you should not use CompletableFutures on a sync method?
i run tehm in an async task
if i would run them sync it should just lag a bit
but it should work
So thenAcceptAsync doesn't run off the main thread?
if im inside of a async task should i use thenAcceptAsync() or just thenAccept()
If you already inside an async task you can use thenAccept
does the LuckPerms api work with BungeeCord?
Yo. I got a questions
How do I setup the setPermission
part
where is the function
I see addPermission
public void addPermission(User user, String permission) {
// TODO add the permission
// Now we need to save changes.
luckPermsApi.getUserManager().saveUser(user);
}
Node permnode = LuckPermsApiThing.getNodeFactory().newBuilder("perm.permission").build();
LuckPermsApiThing.getUserManager().getUser(userstuff).setPermission(permnode);```
then what is this
public void addPermission(User user, String permission) {
// TODO add the permission
// Now we need to save changes.
luckPermsApi.getUserManager().saveUser(user);
}
Oh yeah, you gotta save it too using that
I'm just gonna guess the api works with Bungeecord
Yes it does
Ok thanks :)
RegisteredServiceProvider<LuckPermsApi> provider = Bukkit.getServicesManager().getRegistration(LuckPermsApi.class); how would I be able to do this with BungeeCord?
LuckPermsApi api = LuckPerms.getApi(); you mean this?
Yup
Thanks 👍
I don't understand this plugin lmao
hi i am new to luckperms can anybody help me to add players to my groups?
it would really help
That's why i asked
wrong channel @glacial aspen
ok, thank you
@jaunty pecan i know you are super busy at the moment, but it would be super nice if you could help me with that problem :/
Hey cerexus! Please don't tag staff members.
Does luckperms work in any way with brigadier for dynamic colored tab completions?
Yes it does
can you tell me the section that has the colored tab completion code on github?
I've been looking thru it.
Are there more devs or is it just Luck?
just Luck
Why isn't there prefixes in tab?
How do you put the prefixes above a player's name or tab?
you need an external plugin to do that. Try looking up a tablist plugin
my luck perms is read when i do /plugins and a folder wont create for it can anyone help me
Hey Blizzard! Please don't tag staff members.
@Blizzard#3696 Restart and see if it creates the folder/has an error in console
Hmm :/ hopefully hes back soon
nah. And wrong channel anyways
I'm attempting to use LuckPerms api in my Velocity plugin. But for some reason the LuckPerms.getApi() method keeps throwing the IllegalArgumentException in my ProxyInitializeEvent. I have put luckperms as a dependency, is there anything else I missed?
When are you accessing it?
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
}
so this fires when the proxy initalizes
That seems right
And are you sure it's an IllegalArgumentException and not an IllegalStateException?
umm let me check
oh yes, illegalstateexception: API is not loaded
my bad
is my gradle wrong?
I used this (kotlin DSL): implementation("me.lucko.luckperms:luckperms-api:4.4")
I'm not very experienced yet and I'm not 100% sure what that means
if you could point me in the right direction that would be great
I had the plugin working using a file based system, tried to add luckperms support
I have a shadow jar when building if that is what you mean
aha I see, so I should exclude it from my shadow jar?
Yeah
okay, great, thanks a lot
I mean what are you shading in in the first place?
As I said, not very experienced. I looked at the neutron source code and saw the following lines
id("com.github.johnrengelman.shadow") version "4.0.4"
and then just execute the shadowJar task to build my jar
not quite sure what it does (which I know is not very smart)
Don't do stuff you don't know
I mean, i know what it does, just didn't know I couldn't add stuff
So unless you need a library in your jar because Velocity doesn't provide it, don't use shading at all
okay, I'll remember that
And then only shade those libraries is
for (char value = 'A'; value <= 'Z'; value++){
p.chat("/lp creategroup " + value);
p.chat("/lp group " + value + " setdisplayname " + value);
p.chat("/lp group " + value + " meta setprefix 1 &8[&a" + value + "&8]&f");
p.chat("/lp track prison append " + value);
p.chat("/lp group " + value + " parent set A");
}
for (int i = 1; i <= 20; i++) {
p.chat("/lp creategroup " + i);
p.chat("/lp track prestige append " + i);
p.chat("/lp group " + i + " meta setprefix 1 &7[&6" + i + "&7]&f");
p.chat("/lp group " + i + " parent set A");
p.chat("/lp group " + i + " permission set some.shopmultiplier.p" + i);
}```
Can someone show me how to use luckperms api? The wiki doesn't help me very much in cases like this
Nop bc no one knows it here
I do but I’m too lazy to tell you
For sure
:paperclip: https://github.com/lucko/LuckPerms/wiki
wait a minute
is it this:
// build a simple permission node
Node node = api.getNodeFactory().newBuilder(permission).build();
// build a group node
Node node = api.getNodeFactory().makeGroupNode(group).build();
// build a prefix node
Node node = api.getNodeFactory().makePrefixNode(100, "[Some Prefix]").build();
// build a suffix node
Node node = api.getNodeFactory().makeSuffixNode(150, "[Some Suffix]").build();
// build a metadata node
Node node = api.getNodeFactory().makeMetaNode("some-key", "some-value").build();
Try it and see what happens
how do i git help frum @frank drift
/clippy
!help
/help
/help
.help
oof
Whoops wrong chat sorry
@zenith linden yeah, make a node with the permission you want to give, add it to the player, and save it. It's all on the wiki
Save the player*
i don't think it's all on the wiki
p.chat("/lp track prestige append " + i);
p.chat("/lp group " + i + " parent set A");
i can't find these things
and this:
p.chat("/lp group " + value + " setdisplayname " + value);
How do i get the parent with the highest weight of a user?
@drowsy moon This maybe?
Does that work in a custom plugin?
Do you have PAPI installed?
And have you imported the LuckPerms part
I have.
To use the placeholder you need
- papi
- Imported the luckperms placeholders
Isn't there a way to do it without papi?
No papi is the thing with the placeholders
There has to be a way to do it without papi.
- Install papi
- /papi ecloud download LuckPerms
/papi reload
Not that I’m aware of, you need the api to communicate between luckperms and your custom plugin
@zenith linden if you really can't find it on the wiki (it's on there) then you could use getServer() or Bukkit.dispatchCommand(whatever you want to run);
that's the thing i didn't want a command to run other commands
Is there any documentation on how to use the sql messaging table manually? I am trying to write a user admin panel that includes permissions and I need to be able to send updates to luckperms with changes to user roles or permissions
Maybe I'm going about this all wrong, hoping someone can point me in the right direction
how to transfer this code so it works with luckperms?
List<String> groups = user.getParentIdentifiers();```
(from pex)
and this (almost the same as the last one)
PermissionUser user = PermissionsEx.getUser(p);
???
Did you take a look at the javadocs of Luckperms ?
Here is your answer
luckPermsApi cannot be resolved
Add LuckPerms to your build path and import it @fallow dagger
already done
How to get the instance of the API is explained earlier
@jaunty pecan
Are u still alive?
He's a very busy guy
Hi, I wrote something like user.setPermission(node) node is in this case new meta node. I have problem if that node already exists, because it will create a new meta instead of rewrite the value of the old. How can I solve this?
@uncut onyx remove the other node first
and how to remove? something with unsetPermission()? I havent got the old node as instance.
Good day, I'm using LuckPerms API and I'm trying to get User instance of offline player. I'm using LuckPermsApi#getUser(playerName);
Problem is that it returns null User everytime. It works for online players though.
YOu can iterate over the player's nodes and filter for the one(s) you want and remove them. @uncut onyx
@heady prism check the wiki. There's a section fot the API. And you need to load offline players
@crystal sonnet thanks a lot. I am quite a beginer in this.
Hey asty! Please don't tag staff members.
Thank you, final solution was
LuckPermsApi#getUserManager().loadUser(Bukkit.getOfflinePlayer(playerName).getUniqueId()).join();
Hey, so I am VERY new to the bungeecord thing and was told that Luckperms has some Bungeecord integration.
Its just im new to all this and dont really know how the stuff works. Do I put the luckperms in one of my servers or in the Bungee Server?
How do I set up the MySQL
and all that stuff
Is there anyone willing to attempt to walk me through any of this stuff?
and because I dont thing BungeeCord has a discord
please use #support-1 for general LuckPerms questions, this channel is for developers using the API.
whats the api?
if you need to ask that question this is obviously not the place for you :P
there is an event when a player's rank expires?
because I do not see it in the API or the doc of the API
Hello. I am trying to make a player whenever they right click on an item to be given a rank. Any possible ways of doing that?
Hi. I am going to define some permissions in my plugin and i am really new to this. What should i use for this purpose: vault api, luckperms api or i can use permissions from bukkit?
UPD: So I implemented Vault API and it works fine for now. But I still hope to hear advices from you <3.
Any helpers that could help me?
@left parcel You will need another plugin for that, something like “Vouchers” works really well but it is payed there are other plugins that do similar things at no cost
Thanks man
Is it possible somehow using h2 database to bridge permissions from Spigot server to Bungee? Using Bungee only temproary to protect from bot attacks
I think I saw this answered some where else... but the answer is no. Secondly, this should be asked in #support-1
Hi, I am trying to use PGInterval Class from the PostgreSQL driver. But when I use it this i get this error. Is this a problem from LP ?
This is the line 159 PGInterval pgInterval = (PGInterval) resultSet.getObject(2);
Looks like you're trying to use a relocated PGInterval?
I'am trying to use PGInterval from the postgres driver. I have to use another one ?
what's the equivalent of setting a permission to false but using the api?
/lp user User permission set activecolor.blue false something like this but using the api
Node.Builder#setValue?
ah, thanks.
Is there a good way of getting the highest ranked people in a certain track?
or any way of getting all the players in a group?
Hey powercas_gamer! Please don't tag staff members.
How can i get the prefix of a group?
GroupData groupData = group.getCachedData();
Contexts contexts = luckPermsApi.getContextManager().getStaticContexts();
MetaData meta = groupData.getMetaData(contexts);
String prefix = meta.getPrefix();```
thanks
One message removed from a suspended account.
One message removed from a suspended account.
How do I get all online users which have a specific permission?
for (Player p : Bukkit.getOnlinePlayers()) {
if (p.hasPermission("a.permission") {
}
}
Something like this maybe?
One message removed from a suspended account.
Tobi, @graceful perch whats about the performance of this?
One message removed from a suspended account.
Finnaly I used: java Bukkit.getOnlinePlayers().stream().filter(p -> p.hasPermission(permission)).forEach(p -> { //code });
One message removed from a suspended account.
One message removed from a suspended account.
Are you saving the user?
One message removed from a suspended account.
Try api.saveUser(commandSender.getName()) not quite sure about this as I use a User (and UserManager) object
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Hey Pitaya4! Please don't tag staff members.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
what event is fired when a user gets their parent changed?
nevermind, i learned how to read
One message removed from a suspended account.
eventBus.subscribe(NodeAddEvent.class, this::onUserRoleChange); this should call onUserRoleChange whenever /lp user zbk parent add is ran correct?
ah i see the problem
its only being called when /lpb is used
final String rank = ChatColor.translateAlternateColorCodes('&', "&e" + LuckPerms.getUser(player).getPrefix()).replace("_", " ");
String displayName = player.getDisplayName();
displayName = rank + displayName;```
i need help
@here
^ those pings don't work, btw
imagine pinging 1000 people for something probably only 50 could help with, lol
@proud crypt
Hey Lean_! Please don't tag staff members.
and don't ping me
- i literally am already here
- i don't know anything about java
- #rules, as Clippy just told you
No, LuckPerms itself is written in Java, the api too. But Turbo doesn't knows anything about it.
If you read the developer usage page(s) you should be fine, also don't forgot to check the javadocs
is this right when checking if a player has a group ?
!online.hasPermission("group.admin") && !online.hasPermission("group.vip")) {
}```
i dont want to mess up with the api
Looks right to me
How do I set op with the plugin because I've tried to set up and it won't let me get full op
How do I show a set prefix with the api?
hello all so i'm struggling to figure this out at the moment, I'm completely new to luckperms ben using pex ever since day one pretty much all dem years ago....but now that I am using bungeecord, pex doesn't seem to work very well with crossserver support so I'm switching to luckperms as its apparently the best thing out there at the moment however I'm struggling to figure out how to perform some basic tasks using the API , such as adding a player to a group? i've got the checking of permission strings/nodes done and I think I could handle groups also , but not sure how to add a user and remove a user from a group?
API docs on the wiki should help
yeah I've been reading those and trying to understand the group/user modification bit but its confusing ><
am I right in that I would be using unsetPermission(node) and setPermission(Node)?
I always thought nodes were 'some.permission.node' ?
OOOOOooo but I suppose group.GroupName' would also be a node?
i see
Context.SERVER_KEY
how i use it? I mean i need to get the prefix of a group in a specific context
When I try to use the PostgreSQL driver in my code it uses the one from me.lucko.luckperms.lib and it creates conflicts. How can I avoid that ? It's very inconvenient :/
I have this kinds of errors when I use Objects from the driver itself https://cdn.discordapp.com/attachments/338358811779792896/615555014324125716/unknown.png
@fierce nebula you can run ipconfig and copy ipv4 and it will say your adress to mugfin the bisectur of the binary config yml
One message removed from a suspended account.
Hey, how do i make this work : getUser(event.getUniqueId()).hasPermission("perm.here");
i made a LocalizedNode but i have no clue how to use it
If you just want to check permissions, use the platform’s permission checks
I can't do that
as i want to check the perm of an offline player
and Bukkit does not allow to check perms of an offline player since bukkit perms are only set when the player fully joins
so does anyone know how to make a LocalizedNode?
I’ve never heard that in the context of LP
So I can’t help with that
And btw you need to load the player data of offline players first before you check permissions on them
You also need to pass an appropriate context
i figured it out
@crystal sonnet what do you mean i would need to load the player data?
Hey Cobiy! Please don't tag staff members.
Sorry
i did not know he was staff lol
anyway it seems to be working straight away so yeah 🙂
👍🏼
actually its not working
im using
ContextManager contextManager = plugin.api.getContextManager();
Contexts contexts = contextManager.lookupApplicableContexts(user).orElseGet(contextManager::getStaticContexts);
PermissionData permissionData = user.getCachedData().getPermissionData(contexts);
return permissionData.getPermissionValue(permission).asBoolean();
}```
which is on the wiki and it does not seem to be able to tell me
Because it's for online players
how would i check offline players?
As I've said you need to load playerdata for offline players
how does?
ill check
I just done that for my conflict problem and now It's working 😄
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<artifactSet>
<includes>
<include>*:*</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<relocations combine.children="append">
<relocation>
<pattern>org.postgresql</pattern>
<shadedPattern>
me.lucko.luckperms.lib.postgresql
</shadedPattern>
<includes>
<include>org.postgresql.**</include>
</includes>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>```
Anyone can help me with this issue i still yet to have found a solution
so i am trying to get the perms of an offline player on the wiki it says to use this
return luckPermsApi.getUserManager().loadUser(who)
.thenApplyAsync(user -> user.inheritsGroup("admin"));
}
public void informIfAdmin(CommandSender sender, UUID who) {
isAdmin(who).thenAcceptAsync(result -> {
if (result) {
sender.sendMessage("Yes! That player is an admin!");
} else {
sender.sendMessage("No, that player isn't an admin.");
}
});
}```
but this seems to be outdated as inheritsGroup ask for a node now not a string and even if i give it a node its has yet to work
One message removed from a suspended account.
How can I give out a group to a player for a certain period using API?
My console keeps spamming this. What does that mean.
One message removed from a suspended account.
One message removed from a suspended account.
its only when luck perms is installed. not luck perms though?
One message removed from a suspended account.
lol okay prick
Hello, how can I set a group for a player using the API plug-in? I tried to create a new node and add it to the player, but that didn't work. And still it is necessary to establish this group for a while.
How I can edit the Prefix of a player with Luckperms API?
Node
???
and how i add the node to a player?
probably probably
Yes
Hello, I want to change data on bungeecord and sync these changes to spigot. is there a simple way for something like that? I use already api.getUserManager().saveUser(..) but that doesn't sync the changes to spigot
You have to trigger a network sync
One message removed from a suspended account.
Hello.
I'm currently trying to create a plugin that allows users to have a custom prefix, however, I'm not sure how I would go about removing it and reverting to their primary group's prefix afterwards.
Will the user only have one prefix node? I suppose I could keep a store of nodes mapped to players, but I'd like to know if there's anything I can use that's a part of the API.
Anyone? ._.
Nvm, I can just get the prefix with the highest priority.
you are supposed to check your console for errors if that happens
so do that maybe
also, wrong channel
How I can remove a Prefix from a player using the weight?
@proud crypt I change defult but it is not warking .... 🙂
Hey 둑두둑이! Please don't tag staff members.
@proud crypt I change defult but it is not warking .... 🙂
Hey 둑두둑이! Please don't tag staff members.
I change defult but it is not warking .... 🙂
You can say it once...
UserData cachedData = user.getCachedData();
Contexts contexts = Contexts.global();
PermissionData permissionData = cachedData.getPermissionData(contexts);
MetaData metaData = cachedData.getMetaData(contexts);
String prefix = metaData.getPrefix().replaceAll("&", "§");
String suffix = metaData.getSuffix().replaceAll("&", "§");
e.getPlayer().setPlayerListName(prefix + e.getPlayer().getName() + suffix);
e.getPlayer().setDisplayName(prefix + e.getPlayer().getName());``` what's wrong with it?
How can i get the name of the group from a player?
LuckPerms.getApi().getUser(<player name string or uuid object>).getPrimaryGroup()
One message removed from a suspended account.
One message removed from a suspended account.
its for a tab plugin
i mean
One message removed from a suspended account.
doesn't bukkit have a built-in colour formatting thingy
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
ChatColor.translateAlternateColorCodes('&', metadata.getPrefix())
One message removed from a suspended account.
One message removed from a suspended account.
oh
userManager().loaduser only accepts UUID, is there a way to provide the players name instead? and have luckperm checks its own database for the players UUID ?
One message removed from a suspended account.
One message removed from a suspended account.
how can i set the rang from a user?
is error
public void onSneak(PlayerToggleSneakEvent e) {
if(e.getPlayer().isSneaking()) {
}else {
User user = LuckPerms.getApi().getUser(e.getPlayer().getName());
UserData cachedData = user.getCachedData();
Contexts contexts = Contexts.global();
PermissionData permissionData = cachedData.getPermissionData(contexts);
MetaData metaData = cachedData.getMetaData(contexts);
String prefix = ChatColor.translateAlternateColorCodes('&', metaData.getPrefix());
String suffix = ChatColor.translateAlternateColorCodes('&', metaData.getSuffix());
e.getPlayer().setPlayerListName(prefix + e.getPlayer().getName() + suffix);
e.getPlayer().setDisplayName(prefix + e.getPlayer().getName());
}
}
code
what's wrong
Whats on line 50
String suffix = ChatColor.translateAlternateColorCodes('&', metaData.getSuffix());
how can i set the rang from a user?
LuckPerms.getApi().getUser(<player name string or uuid object>).getPrimaryGroup()
Thats getting it
no not the name of the group
oh set
yes
@turbid solar
??????
@random cloak
?
(kind of offtopic but luckperms dev surly had this issues)
Anyone experienced with mysql? I have a small problem..
Lets say I have 1 mysql connection.. It works pretty well, I HAVE to make sure to always close connection, statement and result before using again.. Main problem is I cant run 2 mysql queries at the same time which is pretty limiting as I am experienced NodeJS develoepr where running 10 queries at once with 10 connections is basic.
That means I need pool of connections.. With basic hiraki pool there is problem - when you run out of connection, your server freezes.. waits for new connection to open.. but it wont ever open because its frozen and it wont know old connection is finished..
SO... I had to make my own query queue manager and every tick check if there is connection available, if yes, take oldest query in queue and run it..
That.. is awesome.. But now I have yet another problem - I cant run sync queries (for example, when player join server, I need his tag from database.. I run query, it gets into queue, it will run next tick.. but message in chant is already shown with default tag as I dont have player data yet).
I came up with idea of having 1 idle connection for sync methods - sync method wont need 2 queries.. never..
BUT.. I also have sqlite support for my small lib.. Problem is sqlite supports one connection only so if I want to keep one connection for sync methods, async wont ever trigger as they wont ever get second idle connection.
Any tips? 😄
I use https://github.com/exlll/databaselib
You can take a look at the db stuff from aikar. Sounds a little bit complicated with your queue stuff. Sqlite is weird.
@astral loom first of all:
never ever run database actions synchroniously!
At least not synchroniously on the main thread
The way to do it is to use the async join event
well, in some cases you just have to.. I have 2 examples:
I use CMI.. CMI send message when player connect.. I have tag plugin, I use placeholder to show his tag when he join.. so.. player join, CMI want to send join message, it parse placeholder to get tag.. my plugin has placeholder registered, it recieves request.. it check storage but player is not there, it returns default tag.. Why default tag? Because I load it from mysql but its not sync.. its async and placeholder has to return value immidietelly, it cant wait for my callback..
Same problem with onDisable... lets say I stop my server BUT my plugin has some data stored in variables. When server stops, I want to put it all into mysql.. I run queries, but they are async, server stops before these queries gets executed (some may be nested, these wont get run for sure)
these are 2 cases I found I just have to run queries sync
And block there until you have all data you need
And for stopping you can run the "synchroniously"
In MC plugins running "synchroniously" typically means running on the main server thread.
But in any case, yes you need a connection pool. But the way you work with it is that you close the connections, queries and results as soon as you can
This is very important
(Hikari caches the real connections. So you closing a connection from hikari only ever frees it in the pool)
@astral loom
And the way LP does it, is by following those guidelines
- Never run queries synchroniously on the main thread (no exceptions. No but, nothing.)
- Always close your database resources ASAP.
- Use try-with-resources statements to make sure all those resources always get closed (https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html)
(And NodeJS also does pooling btw if you can run multiple queries in parallel)
okay, what about my problem with onDisable for example? if I run stuff async, server will stop sooner than my coe s finishet, wont it?
That’s not on the main server thread
Or the game loop to be precise @astral loom
So it’s ok to do it sync
As it is ok to do sync when you’re async to the main server thread/game loop
How can I get the instance of LuckPermsApi on BungeeCord without reflection?
When LPBungeePlugin#registerApiOnPlatform is called, it does nothing with the given LuckPermsApi reference, so is my only my of getting this through reflecation?
If the only option is reflection, is there a maven dependency for the bungee implementation of luckperms?
There is the LP API on maven
And it has a static getter in the LuckPerms class @limber heath
Thanks! Not sure how i missed that
Me neither XD
Is it suggested to use that to get the API instance even on Bukkit, instead of using their ServicesManager?
Alright thanks
You’re welcome
do i still miss something with
plugin.getLuckpermsAPI().getUser(player.getUniqueId()).setPrimaryGroup("some-group");
?
the group isn't applied
save the user
how?
just found it, thanks .. sorry, did not read the full docs, only that part of how to modify things .. thanks again! 🙂
unfortunately that does not work
try {
User user = plugin.getLuckpermsAPI().getUser(player.getUniqueId());
user.setPrimaryGroup(config.getPlayerGroup());
plugin.getLuckpermsAPI().getUserManager().saveUser(user);
plugin.log(Level.INFO, "setting group " + config.getPlayerGroup());
} catch (NoSuchPluginException e) {
e.printStackTrace();
}
@vapid terrace setting the primary group only tells LP which of the current groups is the most important
You need to give the group to the player
but the user doesnt even have the "bewohner" group assigned, the only one is the default
And by default even setting that won't do anything, because the actual primary group is calculated
That's the idea
okay oO
Give them that group
Yes
alright thanks
From the groups the player has
If you want to set the group the player has, first remove all the group nodes, then add a group node of the respective group to the player
And not quite
You need to a fair bit of manual work
do you have a snippet for adding groups to a player?
The wiki has
it's not, or i'm too dumb to find it
however, i now let spigot execute a promote command, since this api is not really userfriendly
You need to create group node object and set it on the user
I'm writing a bit of code to copy the prefix and suffix nodes of a group to a user.
It all works on the bungeecord instance of LuckPerms, but the updates to the user arent being sent to the other bukkit servers.
both of the configs have these values set
server: global
storage-method: MySQL
sync-minutes: -1
watch-files: false
messaging-service: pluginmsg
auto-push-updates: true
include-global: true
(also the mysql servers are the same)
What might I be doing wrong?
I'm using User#TransientPermission and then UserManager#saveUser
both complete successfully, but the other servers dont get the updates
@limber heath transient permission are not what you want
They are a "magic" hidden layer of permissions. They are never saved (lost on server restart or simply running /lp sync), don't show up with any of the commands and another few weird things
Hmm the documentation said they were temporary permissions, that are removed when I player leaves a server. Should I just use normal Nodes and remove them manually when I player leaves?
I need the permissions that I set to be on all servers, but they need to be removed when the player leaves the network. So I'm guessing I have to remove them manually
Yes. They are removed when the player leaves. But they also are never synchronized. If you need them synchronized you need to either use normal nodes or perform your logic on the backend servers too
Alright thanks
hello again.... i'm still trying to add a group to a user, but I still don't get it
Can someone help with some piece of code please?`
Create a group node object using the NodeFactory
and then user.setPermission(node)?
assuming a track for regular players (name it player-track), containing the default group (for guests) and a player group - what is more effective/better to find out if a player is a guest - querying his nodes and filtering for not being in the player group - or querying the primary group since the player group has a higher weight?
Is an event triggered when a user changes the rank?
ok thanks
this event will not work
assuming a track for regular players (name it player-track), containing the default group (for guests) and a player group - what is more effective/better to find out if a player is a guest - querying his nodes and filtering for not being in the player group - or querying the primary group since the player group has a higher weight?
BrainStone, you answered my queston about mysql few days ago, you told me to never run sync mysql queries. I have 2 cases where I think I dont have async solution.
- I have join message, where I need player name and player tag.. tag is from placeholder.. this is my placeholder.. when I recieve request to get a tag, I do:
- check if I have data already.. if yes, return data..
- if not, run mysql query, await result, add it into data and return
but placeholder is sync, I need to return value immidietelly.. Player just joined so I dont have his data yet..
Second problem, lets say I need to store data into mysql when server goes offline - in onDisable.. I cant run async there - I cant schedule new tasks there. also I dont want to risk that server stops earlier than my plugin finishes queries
As I said back then, load your data in the async player join event
That's what it is for
And I've also told you that sync means synchronous on the main server thread/game loop
Startup and shutdown logic is not run on the main loop
And running queries sync to your current thread is ok too when your already async (aka not running on the main server thread/loop)
@astral loom
I've said this the 5th time already
I won't say it again
Hi again... What is the safest/best way to determine if a user is in the default group (first group in a track)?
i want to know if the user is still a guest to be able to promote him
is promoting also available via the api?
hello? someone there? please? >.<
DataMutateResult result = user.setPermission(node);```
This node goes away when the user logs out or the server restarts, even though it isn't a transient permission? I'm confused.
Make sure you use UserManager#saveUser()
Ah, thanks.
Good morning. Still trying (#3): How can I promote a user via the api?
Just looked at the documentation and there seems to be no direct way to achieve this. You could inspect the user's track, then manually promote them on that track, by setting their group to the next group from their current on that track.
that's the way I do it right now, but i don't need the API for this - or, the API should do that by itself (hence the word API).
I think the plugin command does this in a similar way, but then I would not use the API but make the server execute a promote command (which is easier)
Right - so the API is lacking features - but you're achieving it anyway so what's the issue?
Obviously it would be nice as a feature so you could always make a pull request on Github for it
the issue is, that the API is lacking features. Don't get me wrong, this seems to be the most promising plugin (of all plugins ever). it has a wide community, acceptance, usage and it is actively developed
but the API simply does not make any sense
I try to discuss that since 3 days, but you're the first one talking with me for more than one minute.
That's why I permanently repeat this issue and why I opened a github ticket
A pull request would be an option, but honestly I don't have the time to work myself into the plugin code, and the developers should have enough overview and knowledge of their plugin/api to decide if this is suitable or not
But I even don't get a statement on that
So things are starting to become frustrating
Fair enough, it's quite a large plugin from what I've seen so I'm sure their focuses are in other places asides from adding a small API method which can be achieved by a small subroutine.
Getting frustrated that they're not implementing features by your command in this discord channel is pretty silly though. If you cared so much you'd make a PR.
No point arguing about it though because you've implemented it yourself now, and learned that the API's lacking features I suppose
It's not only the promote thing, the API has more problems (from my [silly] point of view). For example, you can retrieve a Group object from the api, but parent groups can only be assigned through a constructed string permission. This does not make any sense
But I'm not sure why you think the API should directly reflect the in-game commands.
There's a reason wrapper libraries and extension libraries exist for APIs, they usually serve the minimum operations required, then further features are provided in extension libraries.
Instead of making a PR you could always make your own extension library for the API to ease these issues from future users of the API?
I could create my own extension for the API
But the plugin command handlers did that already - honestly I don't have a clue how they work together with the API - and if I have learned something over my years in developing software, then it is - API first. everything is in the API, then comes the application layer.
Developing software with that in mind, it is always much easier to (inter)connect the API to other tools and software
Have you checked out v5?
not yet. I guess you are the one who answered my ticket?
Yes. I don't do Java but I know Luck has been working on some big changes to the API for v5
I had a short look into the v5 branch, but to know what's going on I would need a week
But however, the only one who could answer that question is Luck
Yeah, most likely. Sadly he is busy a lot of the time.
Aren't we all busy 😉
in v5 it seems he's adding a promote method :)
Faith in plugin restored ^^
Why lucko no online
Hi!
I'm trying set/unset a permission in my bungee plugin and check for it in my spigot plugin. However, the permission on the client servers only get updated once i use /lp sync. I have the storage set to mysql on both servers and the messaging method set to pluginmsg. Any idea what could cause the issue?
YOu need to trigger the network sync on the bungee manually @gaunt pine
can i do that using the api?
Of course
Got it to work, thanks!
I have a problem with the prefix. somehow the entered prefix is not shown in the chat.
move that in #support-1 @novel citrus
hello
Is there an Event in the API that is called when a player doesnt have permission to use a command, so that I can handle that myself with sending them a message or doing something custom, etc?
No there is not
i need a bit of help with this
Node node = api.getNodeFactory().newBuilder("node.node").build();
if(!api.getUser(uuid).hasPermission(node).asBoolean()){
api.getUser(uuid).setPermission(node);
}
not sure why its not working and wont set the node
any idea what i am doing wrong?
oh ok
I believe its api#saveUser(User)
Does the network sync trigger the NodeAdded event on the client servers?
Basically I'm modifying the permissions of a User on my bungee server then saving and starting the sync. The sync does happen, on the spigot server the User will have the new permission but the event does not seem to fire.
are you using a MySQL for storage ? And if yes are you using the same Database ??
yes, yes. As i said, the sync does happen, checking the permission on the spigot server shows the new value
Ohh sorry
It's okay, I'm expecting it to be something trivial like this on my side 😄
Hey, is there's any way to access LuckPerms config? (LuckPermsConfiguration)
I've digging through several classes but the variable seems to be dependency injected via params..
@long wyvern (sorry for the late reply D: ) If you haven't found it yet, this class should suite your needs https://github.com/lucko/LuckPerms/blob/master/api/src/main/java/me/lucko/luckperms/api/LPConfiguration.java
I'll load up my pc and then type it out xD shouldn't be long
I didn't see this before, but the LuckPermsAPI instance should have a method called getConfiguration. So I'm not particularly sure that you need to get an instance of the config interface itself
Could you guys look at my code please? I'm still having the same issue.
Here is the code where I add the permission (using the addPermission method): https://pastebin.com/KEeHd6Ag
Here is the class where I register the event in the spigot plugin: https://pastebin.com/ZvsgjvsQ
LuckPerms config on BungeeCord: https://pastebin.com/8NPDHEAj
LuckPerms config on Spigot server: https://pastebin.com/8dMcj5mr
Basically when calling the addPermission method in the bungee plugin, the onNodeAdd function in the spigot plugin does not get called. The permission sync does happen, checking it on the spigot server shows the changed value. If I change a permission with the /lp user etc. command, the onNodeAdd function does get called. Do Nodes added this way not trigger the event or am I missing something?
The spigot plugin wouldn't be able to capture the NodeAdd event, no, the only events luckperms-spigot would really know of in this instance are the sync event and the user data recalculation event
So if I wanted to listen to a specific permission change I would need to listen to the UserDataRecalculateEvent and store the previous permissions of the user to see what changed?
Yep, that sounds right to me
I was hoping there was a simpler way to do it 😦 Thanks for the help!
You could use event.getdata which returns a UserData object. That should contain the permissions involved in the event
Oh, it only contains the changes? Thats neat
I'm honestly not too sure 😂 it's either the changed data or the UserData for that specific user. But since there is also a getUser method, I'm hoping it's the changes
No problem :)
Seems to contain everything :c
Ooooo, not fun then :/
Seeing as API 5 is round the corner, you could ask about the inclusion of that https://github.com/lucko/LuckPerms/pull/1537
Random question for the same code: Any idea why the NodeAdded event would trigger twice on the bungee server after using the addPermission method?
Would it be because you sync the addPermission method so its called once for the server and once for Bungee?
https://paste.helpch.at/wakaparari.java Anyone know of any reason why this wouldnt work when a player 'enters' vanish?
especially the java Group group = api.getGroupManager().getGroup(user.getPrimaryGroup()); for (Node node : group.getOwnNodes()) { String prefix = node.getPrefix().getValue(); Node toSet = api.getNodeFactory().makePrefixNode(100, prefix).build(); user.setPermission(toSet); save(user); part to get the users highest group's prefix
i only call the one on bungee
Hello I did not know or post but here since this morning I have a problem with but permission pixelextras.command.ivs all but permission of Pixelextras no longer works on Luckperms since this morning
can I listen for prefix changes in the API?
Hi, got a question, i try to get someone's rank name like ("getRank(player.getName()") <-- it actually don't work like that xD
But does someone have any ideas ? can't find it in the API ..
User user = api.getUserManager().getUser(A Player Object.getUniqueId());
String groupName = User.getPrimaryGroup();```
@iYordiiiDev#6062
Welp
He left
Random people have * perms on my server
How can I remove all the * perms from users with out resetting the ranks
@azure latch
^ bulk editing. Should do what you want
Why?
Ummmm
I don’t speak English
Xd
Wanna help me out
My friend
No idea
Xdd
Well, do you want to remove the permission from groups or users? That's <dataType>
Action is self explanatory
Users
Ok, so what command do you think you'd have to run?
1, this Should be in #support-1, and 2) we've been over this. You don't type dataType, you type users, then go to the next argument. Do you want to update or delete the permission? Type whichever. Then type your permission that you want to remove. It's really not that hard
lp bulkupdate users delete "permission=*"
...
Ummmm
You typed a working command at 2:38:09 but didn't confirm it
Ummmmmmm
l.p. bulkupdate users delete "permission == *" like 10% chance, but mabye. Also, try it without the "s as well
Good
Did you confirm it?
Thank youuuu
Now if you want to clear any other permissions, just change * to whatever permission.
Np
Your a god
I am confused. How can i get the permissions of an player with his uuid?
I get the User without an problem.
But i dont know how the permissioncheck should work...
Do you want to check single permissions or get all nodes a player has?
I want to check if he has a single permission or if he has the permission *.
If you want to check a single permission just use the platform permission checks
And checking for * works the same way
You mean the permissions check of Spigot/Bungeecord/Bukkit?
Yes
They wont work for me, because the Event state i dont have a User.
I just get the uuid.
Ok I will give it a try
If there's a chance that you get an offline player's UUID then you need to do it through the API
But that'll make it a whole lot more complicated as you need to load player data and everything needs to be async
attempting to convert from a custom group plugin into this, but it's not saving for some reason.
Code:
for (GlobalProfile globalProfile : getManager().getMongo().getDatastore().find(GlobalProfile.class)) {
UUID user = UUID.fromString(globalProfile.getUniqueId());
User lpUser = api.getUserManager().loadUser(user, globalProfile.getName().replace(" ", "")).join();
RankEntry rank = globalProfile.getHighestRank();
if (rank == null)
continue;
lpUser.setPrimaryGroup(rank.getName().toLowerCase());
api.getUserManager().cleanupUser(lpUser);
api.getUserManager().saveUser(lpUser);
System.out.println("Migrated " + userCount.incrementAndGet() + " users so far. (" + rank.getName() + ")");
}```
Output (obv from 0):
[00:44:58 INFO]: Migrated 16071 users so far. (Member)
[00:44:58 INFO]: Migrated 16072 users so far. (Member)
[00:44:58 INFO]: Migrated 16073 users so far. (Member)
[00:44:58 INFO]: Migrated 16074 users so far. (Member)
[00:44:58 INFO]: Migrated 16075 users so far. (Member)
[00:44:58 INFO]: Migrated 16076 users so far. (Member)
[00:44:58 INFO]: Migrated 16077 users so far. (Member)
[00:44:58 INFO]: Migrated 16078 users so far. (Member)
[00:44:58 INFO]: Migrated 16079 users so far. (Member)
[00:44:58 INFO]: Migrated 16080 users so far. (Member)
[00:44:58 INFO]: Migrated 16081 users so far. (Member)
[00:44:58 INFO]: Migrated 16082 users so far. (Member)
Also
1
^^ nvm, managed to fix it.
30079
how do I get player prefix
who i get player wight?
@minor hare Contexts contexts = LuckPerms.getApi().getContextManager().getApplicableContexts(s);
MetaData metaData = LuckPerms.getApi().getUser(s.getName()).getCachedData().getMetaData(contexts);
String prefix = metaData.getPrefix();
That should help on how to get weight: https://static.javadoc.io/me.lucko.luckperms/luckperms-api/4.4/me/lucko/luckperms/api/Group.html#getWeight--
can we use getApplicableContexts on OfflinePlayers? Trying to obtain the prefix of a potentially offline player here.
nvm found how to do it https://github.com/lucko/LuckPerms/issues/344 here but a bit odd there's no abstraction for that
were i find the event for luckprems what trigger if my parent changed?
Is there any way to get a Group object from a LocalizedNode? Node::isGroup is true, but, I can't just cast it
Nevermind, I figured it out. Use the Node::getGroupName and feed into LuckPermsAPI::getGroup (for any searchers wondering how to do)
@dusky wagon a bit late but thx
hi guys, anyone can help me?
I have problem with downloading preffix from group of player
"downloading"?
^?
what u mean, when say "downloading preffix"?
getting prefix style to display in another formatter, i mean moment when i need to display nick of player by on example getDisplayName()
but then im getting nick of player with default vanilla formater
on example ops have red nick
but i want get prefiix of rank and suffix for use in plugin
example:
@EventHandler
public void pisanie(AsyncPlayerChatEvent e) {
e.setCancelled(true);
if(pl.getLocation().distance(ploc) <= dis) {
pl.sendMessage(p.getDisplayName()+" "+e.getMessage());
}
dose anyone know why i can't give people /home and /sethome in my sever its a different plugin
:paperclip: https://github.com/lucko/LuckPerms/wiki/Verbose
Hey can I get some help with a couple things?
What things?
i need some help giving people certain permissions
and ive watched some videos etc and im still having a bit of trouble
How do I check all of a player's active permissions?
that they get from all their groups
Hey, i have one question how can i get Group prefix
Is there any event for group, prefix, suffix change for player?
NodeAddEvent/NodeRemoveEvent UserDataRecalculateEvent
Thanks!
Hello, i am very confused i want to set a certain permission for everyone on the server and everyone that will join the server. How do i do that
actually, i want to unset the permission
sorry
All new users automatically are members of the group "default". so set the permition you want in that group
/lp group default permission set bukkit.command.plugins false (for example)
ok
thanks
sorry to bother you again, i only recently got luck perms and when i inquire how many people have the 'default group' it says no one is in it. anyway to change that?
/lp group default listmembers
gives you 0 members ?
yes
have you logged in after installing the plugin ?
you moved yourself to another group ?
no
right now im restarting my entire minecraft
ok still no
it says there is 0 entries for it
than i am sorry, i dont know. wait for someone else to help you
ok thanks anyway
I want to remove a certain permission from everyone but my default says there is no on e in it
nevermind i fixed it
which command do you use to add members to a group? and also can it be used with @p
Please use #support-1 for these questions. This channel is meant for developers using the API.
is there any way you can like clone default and give everything default has to anther group (EX: Give all the perms that Default has to helper) how would i go about doing that? @thorny echo sorry for the tag
@stray frigate are you trying to do that with the plugin developer API?
It was cross posted on general too, so I assume not
I am just using the one for the sever I don’t think I got the dev one
just check if they have group.admin
is it possible to make the group show up in the tab list, so if i give someone [admin] in tab list it'll show up as [admin]tommankt
That would require a separate tab plugin
Hello I want to create several grades on my server (Sponge)
but to each command executed
I can't find a solution
If it just shows "Running LuckPerms vX.X.X" then you don't have permissions to execute any LuckPerms command
give yourself luckperms.*
The /op doesn't work aps
:paperclip: https://github.com/lucko/LuckPerms/wiki/Usage
I'm fine, thank you.
HI!
I am having some trouble setting up LuckPerms on my BungeeCord server.
Could someone talk me through the steps and give me some help?
Wait nvm
#support-1 for questions like that please
I want to ask what is the value of the ranks that I have or I need to use in the scoreboard
Can someone help me
Is there anyone?
A own scoreboard plugin or a general one like FeatherBoard?
If second one, then use PlaceholderAPI's vault expansion with %vault_group% (if supported)
hello i have a question. how can i get the highest group from a player
Can someone help me?
@idle seal try to get the primary group
If i have an Livetime group and a temporary group i became the temporary group and this is the lower group
@crystal sonnet
Hey Spark61 | PlaySpark.de! Please don't tag staff members.
Oh sry
Then you need to set the group weights correctly
Or iterate over all permission nodes to filter out the groups and work with that
How do I check if an OfflinePlayer has a permission?
User.hasPermission() requires a node
idk what to do
@crystal sonnet link?
Hey Viktoracri! Please don't tag staff members.
if(LuckPerms.getApi().getUserManager().getUser(player.getUniqueId()).hasPermission(LuckPerms.getApi().buildNode(Permission.BAN.getPermission()).build()) != Tristate.TRUE) { This returns an error for some reason
Permission.BAN.getPermission = "ban"
What error?
You need to load an offline player first
Thank you
i still have a problem, i have my own server on aternos i try to make ranks on this server with luck perms. But it doesn't work. I have watched a lot of explanation videos and asked friends but I couldn't figure it out. I would therefore like to kick perms from eg essnensials and a prefix and suffix.
Can you help me????
What have you tried
!usage
:paperclip: https://github.com/lucko/LuckPerms/wiki/Usage
Btw wrong channel. Use #support-1
!usage
:paperclip: https://github.com/lucko/LuckPerms/wiki/Usage
witch event trigger if a parent change?
@ripe thorn
Hey Meerpaluten! Please don't tag staff members.
jo
ok
hey muss ich luckypermsbungee in Bungeecord orderner ziehen???
@proper terrace programmierst du ein Plugin?
ne
Dann #support-1
yo how can i make this support luckperms
i cant find anything in the api website or im just blind
fuck im blind
i think i found it dw
nvm its not what i was looking for
There’s a page on the wiki that explains the API basics and one that has examples
sry
hello i have a problem with a seflmade plugin witch should return the expire time of a group Permisson.... can anybody help me there...???
i am a beginner in permissions
Get the permission node object and check the expiry time
have you a sample for me ...pls
There's a wiki page explaining the API and one with examples
yes but i didnt unerstand it right an so im here...
We are not here to do the work for you
no pls
Show us what you have and at what point you are struggling
public void onPlayerInteract(PlayerInteractEvent e)
{
if((e.getAction()==Action.RIGHT_CLICK_BLOCK)&&((e.getClickedBlock().getState() instanceof Sign)))
{
Sign s=(Sign)e.getClickedBlock().getState();
Player p=(Player)e.getPlayer();
if(s.getLine(1).equals("VIP")){
p.sendMessage("Vip Staus ist :" + getPlayerGroup(null,null));
}
}
So nothing
i know
wich term should i use for it
you know waht i want to do?? shure i think but i dont know how to...pls help me..!!
"Term"?
Function...
ok..i will do this
Take a look at the examples
if found some helps but i cant get it to a running version...
ok...but it is not mutch
this one is to read the permissions right??
public boolean hasPermission(User user, String permission) {
ContextManager contextManager = api.getContextManager();
Contexts contexts = contextManager.lookupApplicableContexts(user).orElseGet(contextManager::getStaticContexts);
PermissionData permissionData = user.getCachedData().getPermissionData(contexts);
return permissionData.getPermissionValue(permission).asBoolean();
}
That would be checking a permission
wich one ist the right one to get the expire time of a permission...
This is the right help for me???
no help possible...
People aren't sitting around waiting for questions to answer for people who don't wanna go look themselves
No idea if luck hosts the javadocs himself somewhere, but quick 2 second google found a site hosting them, or you coulda gone to look at the repo itself
maven just tries every repo until it finds it
dmulloy was the protocollib one? There was people having issues with that
That could stall maven in general
maven just tries every repo