jedk1
New Member
DO NOT FOLLOW THIS TUTORIAL! IT IS VERY OUTDATED!
FOLLOW THE VIDEO IN MY SIGNATURE!
Ok so most of you have probably seen this thread:FOLLOW THE VIDEO IN MY SIGNATURE!
The amazing tutorial made by @Coolade for how to make a basic ability.
Now, that tutorial is good, but it doesn't expand on much other than making you set people on fire. Nothing fancy really. Now lets say you want something that's fancy. You want something that tells you how to use Particles, how to do other Damage to the enemy other than setting them alight, how to set Permissions to default and how to do Cool downs.
What I am going to try and teach you in this tutorial is how to make a move that includes:
Particles
Damaging a target
Setting the Permissions to be default
Setting a Cool down
Before we start, please make sure you have read the following threads:
How to design an Ability - Concept Design - Creating a basic Ability
Ok now lets get started.
Currently in this tutorial:Part 1 - The Main File & Path.yml
Part 2 - The Permission Class
Part 3 - The Listener. Oh boy...
Part 4 - Particle Types
Part 5 - Adding Config Options
PART 1 - The Main File & Path.yml
(Yes this is just taken from Coolade's tutorial, I'm just adding it here for ease of access)
In this tutorial I will be making a move called 'Discharge' which was suggested by @Gahshunk
Link to his suggestion: http://projectkorra.com/threads/fire-discharge.503/
I'm going to assume you have your build paths set up already and your project structure set up already. Firstly you want to create a file called 'path.yml' in your src folder. Inside your 'path.yml' file you need to have:(Yes this is just taken from Coolade's tutorial, I'm just adding it here for ease of access)
In this tutorial I will be making a move called 'Discharge' which was suggested by @Gahshunk
Link to his suggestion: http://projectkorra.com/threads/fire-discharge.503/
Once you have that, save that file and close it because we won't be needing it again. Now in your package which I'm assuming is calledmain-class: <your package name>.korra.abilities.<your move name>Information
you need to create 3 class files.<your package name>.korra.abilties
Now you have your files made, open up <your move name>Information.class. Then you want to put the following inside it (This part is mostly taken from Coolade's tutorial):<your move name>Information.class
<your move name>Listener.class
<your move name>Permissions.class
Now, there are 3 lines that are different in this class, 2 in the onThisLoad() method:(Please do not just copy and paste the code as you won't learn if you do)
Pastebin - DischargeInformation.java
Code:
ProjectKorra.plugin.getServer().getPluginManager().addPermission(new DischargePermissions().dischargeDefault);
ProjectKorra.plugin.getServer().getPluginManager().getPermission("bending.ability.Discharge").setDefault(PermissionDefault.TRUE);
Code:
ProjectKorra.plugin.getServer().getPluginManager().removePermission(new DischargePermissions().dischargeDefault);
Code:
/*
* Decide if this ability can be used in a protected area or not, much like deciding if its Blaze or Tremorsense.
*/
public boolean isHarmlessAbility(){
return false;
}
The permission will be loaded and set to default every time the move is loaded, and then removed on unloading. This makes it easier for server owners as they won't have to set-up perms.bending.ability.Discharge
PART 2 - The Permissions Class
Ok this is gonna be nice and simple. Open up your <your move name>Permissions.class and what you want to enter is this:
Code:
package <your package name>.korra.abilities;
import org.bukkit.permissions.Permission;
public class DischargePermissions{
//Register our default permission variable
public Permission dischargeDefault;
public DischargePermissions(){
super();
//Register our permission
dischargeDefault = new Permission("bending.ability.Discharge");
}
//...what? That's it, seriously... for this file anyway
}
Code:
public Permission anotherPermission;
and:
anotherPermission = new Permission("bending.ability.AnotherPermission");
Last edited: