LuckPerms

LuckPerms

41.4k Downloads

Can’t promote user via API [Nukkit]

funniray opened this issue · 2 comments

commented

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.

commented

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

commented

The type wouldn't be there in the original code because my iPad wouldn't let me copy/paste however I didn't know I had to save the changes.