User#setPrimaryGroup() broken as well?
Aerodog opened this issue ยท 4 comments
getPrimaryGroup works, but setPrimaryGroup does nothing and never returns null unless the user is null.
https://paste.md-5.net/vikewasubu.java
I've tried groupName.getFriendlyName(), groupName.toString(), groupName.getDisplayName()... it broadcasts the message but doesn't change the group.
You need to make a call to UserManager#saveUser
after setting the primary group.
Also consider that setPrimaryGroup doesn't actually add the membership. You need to do that bit first as well.
See here for more info: https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage
I suggest reading all of the sections up until the bit you're interested in. It introduces a lot of important concepts within the API. :)