#luckperms-api
1 messages Β· Page 30 of 1
!pastebin for files like that
Seeing a paste of the problem makes everything so much easier! Use https://bytebin.lucko.me/ for easy pasting!
Pastebin any relevant segments of the console log. If it's a startup error, this includes the entire startup log!
Pastebin the entire LuckPerms config file (passwords removed) as well as any other relevant files!
sorry
it's ok
and I have spigot and luckyperm
before you can use luckperms you need to include it's API as a dependency in your java project
oh as dependencies?
api-5.1.jar
yes
yeah, add it as an external jar
okay
I remove Luckperms ?
yeah
done
okay
so you can read all about the luckperms API and what you can do with it on that wiki page
i'll give you the first, least confusing step and that is running LuckPerms api = LuckPermsProvider.get();
that'll give you an instance of the api which you can do all sorts of stuff with
well that depends on what you're trying to do i suppose
what is it
Syntax error on token '.'
...
@expected after
can i see your code for a moment
yeah
package fr.Phosphate.rankplus;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;
import fr.Phosphate.rankplus.commands.CommandTest;
LuckPerms api = LuckPermsProvider.get();
//Plugin Rank+ by Phosphate_ for Radeon
/*Ce plugin a pour but de permettre au op (Admin, Dev) de pouvoir tout de mΓͺme jouer en tant que
* joueur sans perm.
* Il permet de supprimer son rank, tout en gardant ou non son titre. Il permet de limiter l'abus de give
* ou autre commande permettant de s'avantager en Γ©tant op.
*/
public class Main extends JavaPlugin {
public void onEnable(){
getServer().getConsoleSender().sendMessage(ChatColor.GREEN+"Plugin Rank+ by Phosphate_ is now online");
getCommand("test").setExecutor(new CommandTest());
getCommand("alert").setExecutor(new CommandTest());
}
public void onDisable() {
getServer().getConsoleSender().sendMessage(ChatColor.RED+"Plugin Rank+ by Phosphate_ is now offline");
}
}
i see
erm
i think it'll be a good idea for you to find some simple tutorials on how to get started with java
oh
i suggest you try making some simple standalone programs, it'll be much easier to jump into plugins after that
I just don't understand the importation of dependancies
since plugins are a bit harder and slower to debug than a simpler program
you've already done that part haven't you?
you already imported the code related to the api
but I have an error
now all you need to do is use it (and of course import the proper classes)
yes you do
and the error is very, very simple
i'm scared for how long it will take you to put your plugin together if you can't find this error and fix it
but i believe in you
i will help you if you have any questions with luckperms-api related stuff π
...
but what i think you should aim for right now
is a solid understanding of how code in java is structured
Just can you tell me how to import the api?
what all the bits and bobs mean and where they belong
what do you mean by import? you've already done the grunt of the work regarding that
at least, that's what you've led me to believe xd
I mean to be able to use the elements of the plugins.
alright
without fail
basically
you put that line of code outside of the class
so of course the ide is going to complain
move that line inside of your main class
Oh, yeah, that's right, but I thought it was the import line. There's no need to do an import...
.
?
also Main is a really unfortunate name for your class
the line of code i gave you is not an import
notice the distinct lack of the keyword import π
Yes, but I'm trying to figure out exactly how to import it.
do you mean actually have a line like import java.utils.*
if you're on eclipse (which i think you are) you should just be able to hover your mouse over the LuckPermsword in that line
and it will give you an option to import it
it's done
nice
you are a god
that's quite a stretch
I have another error
okay
LuckPermPrvider cannot be solved
hover over it and import that as well
it's done
oh nice
π
you're learning π
yeah
whenever you see an error you should hover over it
so now i have a variable api
Learn how to use the LuckPerms API in your project.
look at the second link for examples of all the stuff you can use it for
hm?
Is there an api.Something to change the player's rank?
yes, you can use that very api to do that
no problem :3
? the same way you imported the other two
?
what does the error say
press ctrl+s
java.utils ?
xd no problem
What's the point of Override
it doesn't really affect the code itself
package fr.Phosphate.rankplus.commands;
import java.util.Collection;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.CommandExecutor;
import org.bukkit.entity.Player;
import net.luckperms.api.LuckPerms;
import net.luckperms.api.LuckPermsProvider;
public class CommandTest implements CommandExecutor {
LuckPerms api = LuckPermsProvider.get();
@Override
public static String getPlayerGroup(Player player, Collection<String> possibleGroups) {
for (String group : possibleGroups) {
if (player.hasPermission("group." + group)) {
return group;
}
}
return null;
}
public boolean onCommand(CommandSender sender, Command cmd, String msg, String[] args) {
if (sender instanceof Player)
{
api.getUserManager().
Player player = (Player)sender;
player.sendMessage(ChatColor.RED+player.getDisplayName()+"is now player");
}
return false;
}
} ```
it's just to remind you that you are overriding the function
the error is here
where
public static String getPlayerGroup(Player player, Collection<String> possibleGroups) {
for (String group : possibleGroups) {
if (player.hasPermission("group." + group)) {
return group;
}
}
return null;
}
```
first line
oh the collection
3 errors
...
xD
use it instead of your phone i beg of you
use the snipping tool please π XD
why's that?
I can snipping and click on error
ah i see
fine i'll allow it xd
first things first
you really should not have that @override there
ok
ok
how many errors are there now
but?
you mean the blue thing
yep
it doesn't mean anything
just ignore it
it's basically just there to make reading the code a tiny bit easier
ok
now if you have any other questions that are not specifically about the LP api
you should turn to other sources
like a tutorial for java
because that will make what you are doing go like 20 times faster
?
no problem lol
white thing
ignore it
is it an LP API question?
any last words of help?
no
π¦
pleassssssssse
im a little shit
and u are a god
helpp meeee
π
i don't know why you think you're magically going to not run into any more issues
you are so much better off learning at least the basics, and reaping the rewards
Collection<String> coll = new ArrayList<String>();
coll.add("developpeur") ;
coll.add("administrateur") ; ```
?
review your code
ok
If you get a bunch of syntax errors from the same file always check the first error. The following ones typically are just the compiler tripping up.
@hexed fiber
And I can only agree with Ivan8or. Learn Java first. MC is not the place to learn Java or programming
Ok
And what donβt you understand?
Ok
Hey Antoine! Please don't tag helpful/staff members directly.
I looked everywhere but I really couldn't find it.
c bon
merci le net
j'ai rΓ©ussi
Look for the first syntax error in the file @hexed fiber
@crystal sonnet
Hey Antoine! Please don't tag helpful/staff members directly.
it's done
but
I have a new question
I don't find command to add player to category
I don't find command to add player to category
@hexed fiber https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#modifying-usergroup-data
thanks
@nocturne elbow
DataMutateResult result = user.data().add(Node.builder("your.node.here").build()); ```
in need to replace "your.node.here" by what ?
the category ? or a permission ?
its a permission node
so for exemple
to add player to a group, the perm node is group.GROUPNAME
DataMutateResult result = user.data().add(Node.builder("*").build()); ```
for give admin permission
that gives permissions to everything
oh
Some plugins are created in a way which results in odd behaviour when the root '*' wildcard is used.
DataMutateResult result = user.data().add(Node.builder("dev.'*'").build()); ```
and that ?
that doesnt nothing unless you have a plugin named dev
I have a category named dev
to add player to a group, the perm node is
group.GROUPNAME
and another name admin
DataMutateResult result = user.data().add(Node.builder("group.dev'").build());
that ?
yea but im very sure you need more code to like first load the user data and then save the userdata afterwards
ok
How can we help
what doubt do you have?
I want to know if, in some way, MySql can synchronize everything, but only some ranges cannot.
Example: i want the vip to sync, but the "Boss" rank does not. :i
!context you can use this system, called contexts, to limit things so they only apply in certain servers
You can set a permission or group on a per-world/per-server basis, through what we call "contexts".
is it possible to add time to a temporary permission? obviously i will check if they have it with hasPerm("...")
I think you just reconstruct the node
or at least indirectly, by getting the time left then setting a new time
You do mean with the devapi right
yes
Basically run the permission settemp command with the accumulate modifier, but in your program
So don't run the command but find out how to use accumulate so it adds
sorry i dont understand what you mean
do the command more times?
Find out how the command does it, and do that :p
alright
what am i meant to use in place of LuckPermsPlugin plugin?
String LPCommand = String.format("lp group pothead permission settemp boosters.secretden true 1h accumulate");
plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), LPCommand);
```wow this is truly beautiful code
hrmm
Learn how to use the LuckPerms API in your project.
that isnt using the lp api lol, arrent you just running a luckperms command in console?
i meant "api" in terms of it's not really using the api, just copying your code
of course what i sent is not using the api
Those two should be sufficient to explain how to do it? I hope?
basically set the node again with the intended amount of duration to extend and use the second link
absolutely not lol, but thanks
the second link will allow you specify that the node should be added to the existing one
I think you've just pulled a classic X/Y on me and I missed it
what are you trying to do, specifically?
https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#the-basics-of-node maybe you should read this on how to "build" a perm node first
PermissionNode node = PermissionNode.builder("boosters.secretden").expiry(Duration.ofHours(1)).build(); i think its like this for expiry time?
it's like a word that fills in for a constant so it can be used in several places easily
so TemporaryNodeMergeStrategy.valueOf(ADD_NEW_DURATION_TO_EXISTING) will do just that
it'll get you that merge strategy
do i need something like
api.getGroupManager().modifyGroup("pothead", (Group group) -> {
PermissionNode node = PermissionNode.builder("boosters.secretden").expiry(Duration.ofHours(1)).build();
// modify node to make accumulate, add existing duration
group.data().add(node);
});
i think so, yeah,and then you save the group π
what do i actually do with TemporaryNodeMergeStrategy.valueOf("ADD_NEW_DURATION_TO_EXISTING");?
hi
uh i think that will only return the value
how I can check the permission of a player ?
found it @warm garnet https://i.imgur.com/1JVr89j.png
just change "group." + group to a perm node
i need to find out what a nodemap is
that's probably on the wiki :p
indeed
api.getGroupManager().modifyGroup("pothead", (Group group) -> {
PermissionNode node = PermissionNode.builder("boosters.secretden").expiry(Duration.ofHours(1)).build();
group.data().add(node, TemporaryNodeMergeStrategy.valueOf("ADD_NEW_DURATION_TO_EXISTING"));
});
does mr ide say that will work
maybe not every api change π
but when you add/remove a node, as the wiki says, save to storage provider
some day i should learn java haha
you're probably about as far along as I am at this point if not further
never too late to dedicate!
did you code clippy v2 with java lol
yeeaaahhh
is this the best way to check if a group has a permission?
Group group = api.getGroupManager().getGroup("pothead");
PermissionNode secretDenNode = PermissionNode.builder("boosters.secretden").build();
Collection<Node> groupNodes = group.getNodes();
if (groupNodes.contains(secretDenNode)) {
}
i think you can use hasPermission?
i mean i guess i can do it with vault but this should be fine?
yes, but why are you checking if the group has the node?
the plugin im making is a custom "boosters" plugin that adds temporary permissions to every player when someone buys the package on buycraft. so in my onEnable(), i was going to check if they have the permission, and if they do then i add 1minute to it
in order to make up for the lost time due to restart
so you want practically ingame-time instead of realtime rewards?
yes
I don't know if that's really the way to do it, but I cant think of a better way so I can't really criticize lol
indeed
alright, so i'm working on a plugin that disallows players to pay (using a vault-hooked economy plugin) other players who are a lower rank than them in a luckperms track. i have it working so far, but i recently realised that my economy plugin allows the paying of offline players. so instead of using Player#hasPermission to check for permissions (to check which group a player is in), i've hooked into vault to allow me to check the permissions of offline players. but now i've encountered this problem - luckperms seems to be warning me that it's unsafe to check for permissions of a player who has not joined the server in the current session:
i don't really want to enable the property it suggests if it can cause lag, but i have no idea how to do things asynchronously, i'm still pretty new to plugin development
any help is appreciated :)
So either you do the vault check async, which is a bit too much to just type out, you'd have to do some research/learning , or you load the user and check with LP. Up to you, but either way explaining the entirety of async processing is kinda hard. I'd suggest taking a look at other plugins and see if they already do it.
If you would rather use LPAPI, https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#loading-data-for-players is what to do, basically
i can check permissions with lpapi?
ah i assumed not since where it says to check if a player is in a group, it says to use Player#hasPermission
i'll look into doing that then, thanks :)
https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#creating-new-node-instances you can see examples on building a prefix node
you should also look at this to add the node to a user: https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#modifying-usergroup-data
and then finally saving the added perm node: https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#saving-changes
mrc
hi
PrefixNode node = PrefixNode.builder(100, "[Some Prefix]").build(); ```
in this, oh to change color of prefix ?
@obtuse jolt
Hey Antoine! Please don't tag helpful/staff members directly.
@warm garnet
yes?
!color
Sorry! I do not understand the command !color
Type !help for a list of commands.
!colour
Sorry! I do not understand the command !colour
Type !help for a list of commands.
!colours
ah yea ^^
PrefixNode node = PrefixNode.builder(100, "[Some Prefix]").build();
just add the colour code
there are no arg for that
api.getUserManager().modifyUser(uuid, (User user) -> {
user.data().clear(NodeType.PREFIX::matches); // if you want to clear old prefixes
Node node = PrefixNode.builder(finalNewRankPrefix, finalNewRankPrefixWeight).build();
user.data().add(node);
api.getUserManager().saveUser(user);
});
i think
it's done
There's a getExpiryTime method iirc
to read in user/group perm node data here is an example: https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#reading-usergroup-data
yeah i don't really understand how to get the node for a permission for a specific group
I have a problem with save data of player
i have a variable for my player called player
but I need a User type of variable
but my player variable is a Player type
@obtuse jolt
Hey Antoine! Please don't tag helpful/staff members directly.
@hexed fiber that's a warning, you've been told by the bot several times to follow the rules and continue to disregard them
sry xD
send your code fuck
Please use https://bytebin.lucko.me to send files in the future. I have automatically uploaded message.txt for you: https://bytebin.lucko.me/hcYG83kKcI
^^
Player player = (Player)sender;
api.getUserManager().saveUser(User player);
Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_BLUE+"TEST"); ```
Idk it was just a suggestion to look into
on way to do it i guess is to save after every time you do user.data() method to modify perms
api.getUserManager().saveUser((api.getUserManager().loadUser(player.getUniqueId()));
why it doesn't work
try api.getUserManager().saveUser(api.getUserManager().loadUser(player.getUniqueId()));
i think you added one too many (
maybe
The method saveUser(User) in the type UserManager is not applicable for the arguments (CompletableFuture<User>)
hmm why not just save the data after every user.data() method
You can also use modify user in 5.1:
user.modifyUser((User user) -> {
// saves automatically
});
userFuture.thenAcceptAsync(user -> {
user.data().add(Node.builder("group."+groupname).build())
});```
for exemple
I want to save the change
how I do this ?
either try what tobi said or uh try add api.getUserManager().saveUser(user) after the user.data() line
does it work?
I am running the server
bcu i am also not very familar with the api lol
Hey Antoine! Please don't tag helpful/staff members directly.
Btw you shouldnt ghost ping people
i know
Antoine I'm feeling kind today, but if you keep pinging staff/helpers you're out of here, k?
are you saving
yeah
So you should send your code again, using either pastebin or just discord's feature to send your method:
format like this if using discord:
```java
<code goes here>
```
so which prefix are you trying to remove?
pretty sure you need to specify that
instead of add, use remove
You're asking LP to remove a prefix but it doesn't know which
yeah
players can have several prefixes
you need to either get their highest weighted or loop through them all afaik
or lowest weighted i suppose, but by weight or by name or by all
loop through them all
but how ?
.getNodes and loop through them, putting each prefix.<anything> node through the removePrefix method https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#reading-usergroup-data
oh I can remove my suffic IN game ?
you can use commands to do anything LP-wise ingame
yeah but I don't know how to remove my preffix
lp user <name> meta removesuffix [weight]/[prefix]
You need to specify the prefix's weight, or the prefix
so how can I find all preffix
loop antoine
if you want to do it in code
you need to loop through all of a user's prefix nodes
i think there's even a node filter you can use
!api
Learn how to use the LuckPerms API in your project.
look at the javadocs for that one
!commands
Find all of the available LuckPerms commands on the wiki.
β
thx
I don't think there's a single command to clear all of one user's prefixes in one go
an easy fix is to use meta setprefix and then remove the one you just set. setprefix will remove all prefixes and replace them with just the one prefix
I don't find how to remove player from a group
it's done !!!!!!
Larry
is a preffix linked with group ?
Use the console
yeah I can't
when I write deop Pseudo
deop Phosphate_
Could not de-op Phosphate_
like if I was already deoped
what rank/group are you in?
np
thx for help
developer for what ?
?
how I can check if a player as a permission ?
helps to ask before you start pinging ppl
do /lp user (username) permission info
oh yeah Doug maybe don't offer DM services like a back alley kinda ad 
back alley lmao
xD
wdym in api
what do you mean in api
i want to check if a player have a permission in my plugin
!api
Learn how to use the LuckPerms API in your project.
it's on the second link here
I don't find
you just have to read it
It's literally its own category
@gusty hull ? the gh avatar?
ye
That's Luck, the guy who made LP
ohhhh
:p
just... click on it lol it gets bigger
shhhh
I need help
If you want a faster answer, start with the problem rather than saying you need help
I need help my servers dont sync fast with perms but work alitle and is synced
This is not the channel for that
what is
The general channels I presume
ok
Did you do the command /lp <group> meta addprefix <weight> βprefix β
Ok well try in game
Oh well idk how to help you then sorry
ping larry
@rustic laurel
Hey Antoine! Please don't tag helpful/staff members directly.
sry for pink Larry
Hehh you knew better
me?
okie yea sorry i havent been on this server in a while π¦
yea?
i forgot im rly sorry
np
You know better, you can think for yourself
You say you have an error? Which error
no I don't have error
juste i don't have the suffix
//function to set Preffix (dev, admin), (ex : /todev true => need to set an additional preffix because permission is removed) :
public void setPrefix(UUID uniqueId, Integer prefixplace,String groupname) {
//Get User variable for changes :
UserManager userManager = api.getUserManager();
CompletableFuture<User> userFuture = userManager.loadUser(uniqueId);
userFuture.thenAcceptAsync(user -> {
//Add prefix to player when his perm is removed and he want to keep preffix :
user.data().add(PrefixNode.builder(groupname,prefixplace).build());
api.getUserManager().saveUser(user);
});
} ```
Larry ?
That's snippet doesn't really tell me much
I cant send u the entire code
I know
I will send u tomorrow
What you need to do is look at the javadocs and see what the problem is
Because i go to bed
I can't look at / test / fix the entire code either so I'm not really sure what to say
IDEA?!
I did exactly what it says on the documentation but the prefix just doesn't show up.
Yep sounds about right
Hello ivan
i wish i knew enough about maven to be able to figure out exactly why it wasn't working before
hi Antoine
I've solved a lot of problems
You're adding a prefix that is made up of groupname and prefixplace
No
Groupname is the prefix name
Prefix place is the rank : 100,50,20 ...
And it is (prefix name, place)
The weight?
Yeah
Hmm I'm not at my PC rn tbh so can't be searching the javadocs ( @neat jackal pls bb) but I'll take a look when I can
Just saying you quite misleading to name your variables that doesnβt correspond to its actual thing they store lol.
Does user.getPrimaryGroup() get the highest ranking group the user is in or the first one on the track?
LuckPerms allows you to set weights in order to determine the priority of certain nodes, like permissions and even prefixes. A higher weight number is a higher priority.
Ok, cool
Hey, does anyone know how to fix the colour of my name?
https://gyazo.com/ae328d0d8b09a00e1c316ca43d16f4e4
https://gyazo.com/ac891e155fe9c92a0ff04c28b8ac09ce
@plain hill this doesn't really belong in #luckperms-api but you need to get rid of that &b for a &f
unless wait
oh you know it's probably actually your chat plugin; you should check wherever it makes you set up how the name looks and how the prefix is separated
what's the problem?
Hum
I can't display prefix
I don't have error but dont have preffix
//function to set Preffix (dev, admin), (ex : /todev true => need to set an additional preffix because permission is removed) :
public void setPrefix(UUID uniqueId, Integer prefixplace,String groupname) {
//Get User variable for changes :
UserManager userManager = api.getUserManager();
CompletableFuture<User> userFuture = userManager.loadUser(uniqueId);
userFuture.thenAcceptAsync(user -> {
//Add prefix to player when his perm is removed and he want to keep preffix :
user.data().add(PrefixNode.builder(groupname,prefixplace).build());
api.getUserManager().saveUser(user);
});
} ```
what string value are you passing into groupname
Do you use Bungeecord or Velocity or smth like that?
?
I ll tell u wait 2 sec
setPrefix(player.getUniqueId(),10,"Β§4[Administrateur] PREFIX SET"); ```
@tribal wave
"PREFIX SET" is juste for dΓ©bugging
that'll be why your code isn't working i bet
at least partially
did you read the api wiki at all?
yeah
i will once again recommend you do so
okay so take a look at your code
yep
see that user.data.add(... line near the bottom of what you pasted
do you understand what that line does
correct
nice π€©
now - what is a node? what does it look like?
hum ...
wait a sec
The Node interface is the core data class in LuckPerms.
Most simply, it represents a "permission node". However, it actually encapsulates far more than just permission assignments. Nodes are used to store data about inherited groups, as well as assigned prefixes, suffixes and meta values.
Combining these various states into one object (a "node") means that a holder only has to have one type of data set (a set of nodes) in order to take on various properties.
The Node interface provides a number of methods to read the attributes of the node, as well as methods to query and extract additional state and properties from these settings.
tadam
show me an example of a node
that is not a node
PrefixNode
that is a line of code
π€
show me an actual node string which you would feed into that line of code
a realistic one
don't just use exemple
user.data().add(PrefixNode.builder(10,&4[admin]).build());
oh ..
i am not asking you to show me any code; just show me a permission node
import net.luckperms.api.node.Node;
that is also a line of code
that is what a node is; it is a permission string that takes the form of some.words.a.plugin.cares.about
oh ok ..
do you remember how you set up prefixes in the luckperms editor for the first time
or did you use a command for that
lp editor ?
yeah
yeah?
okay; what does a prefix permission node look like?
Itβs prefix.<weight>.<prefix>
very nice
displayname is an alias name for groupname
what ?
prefix is usually the thing that is displayed in chat
Antoine do you now understand why your code from earlier did not work
so displayname.dev = groupname.dev in the code
no...
@tribal wave Let me think for two minutes.
No
oh
I KNOWWWW
@tribal wave
I need to write :
user.data().add(PrefixNode.builder(prefix.20.Β§4[dev]).build()); ```
Uh...
not quite but you get the idea
oh ...
once again i STRONGLY recommend taking a tutorial on java
yep, that should maybe work now
i'm honestly not sure if the fancy & character works correctly but it might
You know, I've been coding for four years. It was just a mistake of inattention.
have you been coding in java for 4 years?
Heβs been doing Pascal
xD
Just kidding hahaha
thx for all @tribal wave
hmm
Description Resource Path Location Type
The method builder() in the type PrefixNode is not applicable for the arguments (String)
π€
are you sure you worked with python, C++, and C# for 4 years?
yeah xD
what you're dealing with right now is not a problem unique to java
it is a very simple mistake that people can make in any language
builder take PrefixNode value
I think use PermissionNode instead of PrefixNode
Bcu PrefixNode takes in 2 parameter, weight number and prefix string iirc
i said that a node was a string
so... i never told you that prefix node only takes a single argument? o.o
Actually now I confused myself as well rip
same xd
xD
user.data().add(PrefixNode.builder("prefix."+prefixplace+"."+groupname)).build();
how I can resolve error ?
you still only have one parameter
remember how ben said the prefixnode builder takes 2? our lengthy discussion about that no less than a few minutes ago
π
user.data().add(PrefixNode.builder("prefix."+prefixplace+"."+groupname, prefixplace)).build();
so ?
so..? try it
Description Resource Path Location Type
The method add(Node) in the type NodeMap is not applicable for the arguments (NodeBuilder<capture#9-of ?,capture#10-of ?>)
sigh
that happened because you deleted more of your code from before than you needed to
"prefix."+prefixplace+"."+groupname
user.data().add(PrefixNode.builder(groupname,prefixplace).build());
I juste replace groupname by
you changed something else
i would hope that with your 4 years of experience you'd be able to find what π
well you're not wrong
user.data().add(PrefixNode.builder("prefix."+prefixplace+"."+groupname,prefixplace).build());
user.data().add(PrefixNode.builder("prefix."+prefixplace+"."+groupname, prefixplace)).build();
here
it's done
if it's done you should run it
you really should be going through this debugging process on your own
i'd imagine you can deal with errors on your own when you work in python
so you have never had to debug your own code?
so of course, but java is pretty far away from python
you said you work in c++ and c#
those have like 99% of the same syntax as java
or i guess it's the other way around really
in fact I don't do much C++ and C# is only for unity and it's still different.
have you ever had to debug your code for unity
you need to attach a &f to the end of the prefix you are setting
also wait
i guess PrefixNode doesn't actually take a node as a parameter
that makes sense.... oof
in that case you can just put the prefix you want instead of the entire node
yeah ;-;
i kinda try to explain but i confused myself jn oop
XD well no harm done
you need to attach a
&fto the end of the prefix you are setting
@tribal wave what
?
?
user.data().add(PrefixNode.builder("prefix."+prefixplace+"."+groupname&f,prefixplace).build());
like this ?
i mean append the &f as a string... to the end of the prefix
as in if you dont want the colour of the prefix to be in your playname, put &f at the back of your prefix
and also get rid of the "prefix."+prefixplace+"."+ portion of that line of code
since we have now realized the prefixnode builder doesn't need that
like that ?
user.data().add(PrefixNode.builder(groupname+"&f",prefixplace).build());
try running it
you need to debug your own code in the future
ye
for my sanity as well as everyone elses
i refuse without a shred of guilt
haha
debugging alway make me drop a ton of hair
me debugging for an hour to realise i miss a +1 somewhere
real talk though; +1's are actually some of the hardest things to catch
yea it is
!api
Learn how to use the LuckPerms API in your project.
could i change like /lp user [user] parent set [group]
wdymmm
oops
wait
could i change like /lp user [user] parent set [group] to /setrank [player] [group]
in the configs
either create an alias to map the lp command to what to want it to be, or use a rankup plugin
also it should be in #support-1 or #support-2 unless you are refering to coding out a plugin with such a feature use LPAPI
oh k srry
It doesn't really deal with the developer api, but that's a mysql error.
!errors try the solutions here
Here's a page with some common storage system errors.
Oh, xd, well, to the next trip to another channel, thanks.
is there a chance I could talk to someone about how luckperms handles permission nodes for a plugin?
using Luckperms API?
I mean yes formguy but if you have a q it's always good to ask straight up
yeah, just saw Player for hasPermission or isplayer in group, but just curious what kind of player
I'm assuming when you capture a command event, luckperms captures the person who sent the command as that kind of player?
or am I able to create a player object via a uuid
You can once the player is loaded, anytime during or after PlayerLoginEvent, though that's a bukkit thing and not an LP thing if I am correct in understanding you
it uses the bukkit player Player?
I think so? Not certain but I believe it does. You'd be able to find it easily by looking at the javadocs here
First link
!api
Learn how to use the LuckPerms API in your project.
just found loadUser, so I think that's what I'm looking for? cause hasPermission takes a User not a Player, my mistake ^^
Try the second link as well tbh, just read both of those pages they'll serve you well
you can see this on loading user fro luckperms: https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#loading-data-for-players
I'm not sure what you need cause I can't read your mind :p
Hehe, just trying to do a simple permissions check
taking a player who I have the uuid for and checking the luckperms database and seeing if they have the permission
Then the two wiki pages I linked and maayybbe a little bit of javadocs is all you need
alrighty, I think I see what I need from the wiki page, thanks Larry and ben ^^
np!
is there a primarygroup-change event?
You there should be a SetPrimaryGroup method, but it will only work if you set parent-group-calculation to stored on lp config. Else primary group will b edge group of highest weight and we usually just use this
@dim saddle have you tried debugging with verbose ?
no
Then try that