API - im trying to get a players ownnodes using the API
Closed this issue ยท 10 comments
int permsamount = Main.lp.getUser(target.getUniqueId()).getOwnNodes().size();
List<Node> perms = Main.lp.getUser(target.getUniqueId()).getOwnNodes();
this is the way im getting the permissions but it shows other stuff aswell which i dont want how would i fix this?
With node you mean the permission of a user?
In that case you may want to use me.lucko.luckperms.api.PermissionHolder#getPermissions
I never used the API, so I can't say if that would be the right/better way to do.
It would be a good thing to join the Discord and ask in the #api channel for support if you aren't on it.
ive asked in the discord channel and havent had any help with it ive tried #getPermissions but that also has alot more information that i dont need all i need is all the players permissions with group perms
The getOwnNodes method should do what you need.
You can then extract the permission from the Node
object using the getPermission
method.
what would i do though?
List node = Main.lp.getUser(target.getUniqueId()).getOwnNodes();
node.getPermission();
would it be like this?
The Javadoc (and your IDE) should help you figure out which method is the correct one (I don't know by heart)
ive already looked at it ive found out how to get the nodes but it shows other stuff aswell i just want the list to show like perm.test.1, permtest2