LuckPerms

LuckPerms

41.4k Downloads

Promote User Along Track Using API

chuushi opened this issue ยท 3 comments

commented

Hello!

I was wondering if there's any way to promote a player using the developer API. I know you can add or remove groups from a player, but I can't find a way to promote a user using the API other than by forcing the promote command.

Thank you,
~Simon

commented

No, there's not an "easy to use" method which will do it all for you - the promote functionality is a bit too specific and intricate to implement into a method with predictable behaviour.

However, that said, tracks are exposed in the API.

Your best bet is to try replicating the behaviour of the promote command as a utility method within your plugin.

https://github.com/lucko/LuckPerms/blob/master/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserPromote.java

commented

Also - sorry it took so long to reply.

I kept writing out half a response then getting side-tracked with something else. My apologies. :)