Harun Selim GEDİKLİ
Verified Member
Hi guys. How can i create a new element in BETA 12 ?
Thanks.
Thanks.
Yes. I am coding abilities.Do you have any experience coding for ProjectKorra?
Okay, cool.Yes. I am coding abilities.
public static Element yourElementName = new Element("yourElementName");
package com.yourname.newelement;
public class YourelementAbility extends ElementalAbility
{
public YourelementAbility(Player player)
{
super(player);
}
@Override
public Element getElement()
{
return YourPlugin.yourElementName;
}
}
OMG ! Thanks for this. I understand. Sooo i will try Thanks again.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:After that, you will want to make an ability class for all your abilities to extend.Code:public static Element yourElementName = new Element("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.Code:package com.yourname.newelement; public class YourelementAbility extends ElementalAbility { public YourelementAbility(Player player) { super(player); } @Override public Element getElement() { return YourPlugin.yourElementName; } }
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