LuckPerms

LuckPerms

41.4k Downloads

Promote via the API

d1rty-pixel opened this issue ยท 6 comments

commented

Hi,

how can I promote a user along a track via the API? This is not documented and I cannot find anything in the API to do so.

Thanks

commented

Example:

public void givePermission(UUID uuid, String permission) {
UserManager userManager = luckPermsApi.getUserManager();
CompletableFuture<User> userFuture = userManager.loadUser(uuid);
userFuture.thenAcceptAsync(user -> {
user.addPermission(permission);
});
}
commented

Node: to add a player in a group set the permission "group.groupName"

Sent from my Galaxy S8 using FastHub

commented

This is not a real promotion. The plugin already knows which groups are in which track (including their order) and it should definitely find the next group by itself, without me explicitly telling the API what to do (although it should know what to do).
Sorry, but this is complete nonsense and the current API does not give pragmatic access to plugin funtionality. Besides, your example only covers the part of adding the group, but you omitted the unsetPermission part (which is also part of the promotion).

So if the API cannot promote users along a track, see this as a feature request.

commented

Luck has overhauled the API for v5, it probably has already been done.