[MOD] Problem with commands permissions

Hello, i have few commands in my forge mod :


In my server, i use LuckPerms for permission management but because my permission nodes are not register, i can’t interact with it in my mod with LuckPerms API. I want to know how i can register this commands nodes, thanks


The bottom comments may help you :slight_smile:

The question is actually

I want to know how i can register this commands nodes, thanks

so those comments won’t help.

Sponge hooks into the Forge permission manager. Just call PermissionAPI#registerNode and it should be passed through to the Sponge permission manager.

Alternatively, if you are using LP’s API directly, you can assume that Sponge is present, and just import the SpongeAPI too and use PermissionService#newDescriptionBuilder(PluginContainer) (using Sponge.getPluginManager().getPlugin(<your id>); to get the PluginContainer). You can have a hybrid mod that uses the API.


Thanks for all, it works ^^

1 Like

On the other hand, I think that there are only permissions generated for my commands “roots” ie those which extends CommandTreeBase, I have for example a root command “arm” and sub commands “create” and “delete”. When I try to make “/arm create” I do not have permission whereas with LuckPerms I get permission:
“saoarms.command.arm. *” and to try: “saoarms.command.arm.create”. I do not know if it’s a sponge problem where Luck Perms but I still warn ^^

There is only one “outside” permission which is created, I remind that I use the “/ lp tree” to see the available permissions