• 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

How can i create an element ?

StrangeOne101

Staff member
Plugin Developer
Moderator
Verified Member
Yes. I am coding abilities.
Okay, cool.

First off, you want to make it a side plugin. Then you're gonna want to define a new static Element field in the class like this:
Code:
public static Element yourElementName = new Element("yourElementName");
After that, you will want to make an ability class for all your abilities to extend.
Code:
package com.yourname.newelement;

public class YourelementAbility extends ElementalAbility
{
    public YourelementAbility(Player player)
    {
        super(player);
    }

    @Override
    public Element getElement()
    {
        return YourPlugin.yourElementName;
    }
}
After that, you can make all the abilities you want by extending that class. Make sure to give them listeners and stuff as well. Don't make them implement AddonAbility, though, since this is a side plugin. You can register stuff in onEnable() instead.

Hope that helps slightly! I did do this without an IDE and from memory, however. So you will need to import things and possibly add a thing or two I missed. Sorry about that :p
 

Harun Selim GEDİKLİ

Verified Member
Okay, cool.

First off, you want to make it a side plugin. Then you're gonna want to define a new static Element field in the class like this:
Code:
public static Element yourElementName = new Element("yourElementName");
After that, you will want to make an ability class for all your abilities to extend.
Code:
package com.yourname.newelement;

public class YourelementAbility extends ElementalAbility
{
    public YourelementAbility(Player player)
    {
        super(player);
    }

    @Override
    public Element getElement()
    {
        return YourPlugin.yourElementName;
    }
}
After that, you can make all the abilities you want by extending that class. Make sure to give them listeners and stuff as well. Don't make them implement AddonAbility, though, since this is a side plugin. You can register stuff in onEnable() instead.

Hope that helps slightly! I did do this without an IDE and from memory, however. So you will need to import things and possibly add a thing or two I missed. Sorry about that :p
OMG ! Thanks for this. I understand. Sooo i will try :p Thanks again.
 
Top