• 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

Example: Blocking abilities from within a custom ability

Coolade

Staff member
Plugin Developer
Verified Member
As of ProjectKorra 1.5.0:Beta 5 Methods.java has a simple ability blocking method called
Methods.blockAbilities(Player, List<String>, Location, double radius).
Player is the player attempting to block the other abilities.
List<String> is the list of ability names that you wish to block.
Location is the location that the blocking will occur.

This method works with the following abilities: FireBlast, EarthBlast, WaterManipulation, AirSwipe, Combustion, FireShield, AirShield, WaterSpout, and AirSpout.
If a collision occurs with one of these abilities then that ability will be destroyed, excluding AirShield and FireShield.

Here is an example of how to block specific abilities:

Code:
List<String> abilityNames = new List<String>();
abilityNames.add("FireBlast");
abilityNames.add("EarthBlast");
abilityNames.add("WaterManipulation");
abilityNames.add("AirSwipe");
abilityNames.add("FireShield");
abilityNames.add("AirShield");

boolean collision = Methods.blockAbilities(player, abilityNames, loc, 3);
if(collision)
{
    // Remove my ability here
}
 

jedk1

New Member
wait so would this be for say, if a player was using firebreath, and someone else used airswipe, it could cancel the firebreath?
 

Coolade

Staff member
Plugin Developer
Verified Member
wait so would this be for say, if a player was using firebreath, and someone else used airswipe, it could cancel the firebreath?
Yes you can use this to cancel out the airswipe and cancel out the firebreath, and it's easy to do.
 

Coolade

Staff member
Plugin Developer
Verified Member
No it will remove the airswipe and return true, then you can remove your ability if it returned true. Essentially it gives you the option to remove your own ability if you wanted to. Previously there weren't any methods that allowed for easy ability blocking. If you only wanted to block AirSwipe's then make sure that was the only string inside the list parameter.
 

jacklin213

Staff member
Plugin Developer
Verified Member
after seeing this post, it reminds me. We need a javadocs please !!!
 

jedk1

New Member
Will there be a method which makes it so that say airswipe would cancel out firebreath, but airswipe wouldnt be canceld?
 

Coolade

Staff member
Plugin Developer
Verified Member
Will there be a method which makes it so that say airswipe would cancel out firebreath, but airswipe wouldnt be canceld?
Perhaps in the future but for now it's just this simple method.
 
Top