Can’t promote user via API [Nukkit]
Closed this issue · 2 comments
PromotionResult#wasSuccess
was true, but my player never got promoted. Here’s my code
public static PormotionResult rankup(Player player) {
Track track = luckPermsAPI.getTrack(getCurrentConfig().getString("rankuptrack"));
return track.promote(luckPermsAPI.getUser(player.getUniqueId()), luckPermsAPI.getContectForPlayer(player));
}
rankuptrack was set in the config properly, and if I do /lp user <user> promote rankuptrack
in console, then it will promote them properly.
There are a number of typos in your code - it won't even compile.
Anyway, I suspect the reason it doesn't work is because you're not (it appears) making a call to save the user after promoting them.
See: https://github.com/lucko/LuckPerms/wiki/Developer-API:-Usage#saving-changes