So my plugin needs to assign permissions. I've been using LuckPerms for a while so I'm not a total noob with it. I know about contexts and all that and for the most part I've used it successfully. But I have one problem - every time i assign a permission, it only stays on until the user logs out. So right now I have 2 plugins that check UserJoinEvent to fix all un-granted permissions. It works but it's not a permanent solution. In my mind what i need to do is get the global context from the user, but I can't seem to find the method for that. This is what I have: Code (Java): User user = Plugin.Permissions.getUserManager().getUser(playerId); Node node = Plugin.Permissions.getNodeFactory().newBuilder(permString) .clearExpiry() .setValue(true) .setWorld(null) .build(); user.setPermission(node); Thanks in advance!!
https://javadoc.io/doc/net.luckperms/api/latest/net/luckperms/api/model/user/UserManager.html I believe UserManager.saveUser should persist the permissions.
Hey im new in programming in Java Spigot and i have a question about how to set a user a permission and how to remove these? I have implemented the LuckPerms plugin to my project libraries already. I don't find any beginner friendly tutorial for this
I'd recommend making your own thread. EDIT: look at this https://luckperms.net/wiki/Developer-API-Usage