• Hello Guest! Did you know that ProjectKorra has an official Discord server? A lot of discussion about the official server, development process, and community discussion happens over there. Feel free to join now by clicking the link below.

    Join the Discord Server

[Important] Notice For Developers

AlexTheCoder

Staff member
Plugin Developer
Verified Member
There is an important thing I need to tell any developer making an addon ability! If you wish to make your ability enabled by default for any air/fire/water/earth bender (depending on the element you choose for your ability), then you will need to do a few extra things!

Firstly, you will need to create a permission, either in a separate class file (recommended) or in any class file you currently have! All you need to do is add the line:
Code:
public Permission yourPermName = new Permission("bending.ability.AbiltiyName");
to any class file!

Once that is done, there is some more you need to do. First, you need to modify your onThisLoad().
You just need to add these two lines to it!
Code:
ProjectKorra.plugin.getServer().getPluginManager().addPermission(new yourPermissionsClassName().yourPermissionName);
 
ProjectKorra.plugin.getServer().getPluginManager().getPermission("bending.ability.AbilityName").setDefault(PermissionDefault.TRUE);
Finally, you need to modify your stop()! Add this one line:
Code:
ProjectKorra.plugin.getServer().getPluginManager().removePermission(new YourPermissionsCLass().yourPermissionName);
AAAND YOUR DONE :D
 

Mist

Staff member
Administrator
The plugin automatically creates bending.ability.ABILITYNAME for all abilities loaded. You do not have to register your own permissions.
 

Mist

Staff member
Administrator
The plugin automatically creates bending.ability.ABILITYNAME for all abilities loaded. You do not have to register your own permissions.
 

AlexTheCoder

Staff member
Plugin Developer
Verified Member
Yeah, even though the plugin registers the permission, that permission isn't enabled by default. My method makes it enabled by default.
 
Top