Some tutorial on the Persmissions Api

I want to use the permissions Api but there isnt too much info out there like how to give some permission node to someone.

Thanks.

First of all: To completely utilize the permission API, a permission plugin is needed.

If a permission plugin is installed:

Player implements Subject, which contains all methods related to permissions.

Other important classes are SubjectData, Tristate and PermissionService

//permission data of player
SubjectData permData = player.getData();

//only works if a perm plugin is installed
permData.setPermission(SubjectData.GLOBAL_CONTEXT, "myplugin.kill", Tristate.TRUE);
2 Likes

So if I only check if someone hasPermission() I dont have to worry about anything else?

Yep. That’s just player.hasPermission(...)