• 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

Addon Developers - Let's Discuss Expanding the API

moo3oo3oo3

Verified Member
ow ow ow! I got a good one now!
Code:
if(Methods.isUsingAbility(player, ability)){
//Stuff
}
It would be useful to check if someone is using waterspout for example.
If you're looking to remove someone's spout you could use:
Code:
removeSpouts(Location location, double radius, Player sourceplayer)
Otherwise you could tap into water spout's instance hash map to get players using water spout:
Code:
ConcurrentHashMap<Player, WaterSpout> players = WaterSpout.instances;
Or use:
Code:
bPlayer.getAbilities()
and get the currently sellected slot to get the ability.
 
Last edited:

dookoo782

Verified Member
Hey, I'd just like to know if there is a event for when an ability is used.

If there isn't an event for when an ability is used then:

I need an event that will listen for when an ability is used and allows me to know what that ability is and who used it.
 

moo3oo3oo3

Verified Member
Hey, I'd just like to know if there is a event for when an ability is used.

If there isn't an event for when an ability is used then:

I need an event that will listen for when an ability is used and allows me to know what that ability is and who used it.
Couldn't you just test if a move is in cooldown?
 

Mist

Staff member
Administrator
Create a suggestion, when we start developing stuff for 1.7.0, that is where we will look.
Hey, I'd just like to know if there is a event for when an ability is used.

If there isn't an event for when an ability is used then:

I need an event that will listen for when an ability is used and allows me to know what that ability is and who used it.
 

jedk1

New Member
Hey, I'd just like to know if there is a event for when an ability is used.

If there isn't an event for when an ability is used then:

I need an event that will listen for when an ability is used and allows me to know what that ability is and who used it.
this exists... its called using the combomanager for a different purpose :p

example:
Code:
List<AbilityInformation> lastUsedAbility = ComboManager.getRecentlyUsedAbilities(player, 1);
                if(!lastUsedAbility.isEmpty()){
                    if(System.currentTimeMillis() < lastUsedAbility.get(0).getTime() + 100L){
                        String ability = lastUsedAbility.get(0).getAbilityName();
                        ProjectKorra.log.info(player.getName() + " used" + ability);
                    }
                }
put that in a loop or something.
 

dookoo782

Verified Member
I see but I'm doing a leveling side-plugin thing for a server. I think an event would be a lot more cleaner instead of running that code constantly in a thread. I'm just going to make that suggestion now.
 

jedk1

New Member
I see but I'm doing a leveling side-plugin thing for a server. I think an event would be a lot more cleaner instead of running that code constantly in a thread. I'm just going to make that suggestion now.
take a look at how the combo manager works then, it uses sneak and left click listeners
 

Finn_Bueno_

Staff member
Plugin Developer
Verified Member
There's Methods.getWaterSourceBlock(); , Methods.getEarthSourceBlock(); , Methods.getLavaSourceBlock(); , etc. but there's isn't Methods.getPlantSourceBlock();
You can see it coming, could that be added :p
 

jedk1

New Member
There's Methods.getWaterSourceBlock(); , Methods.getEarthSourceBlock(); , Methods.getLavaSourceBlock(); , etc. but there's isn't Methods.getPlantSourceBlock();
You can see it coming, could that be added :p
Code:
Block source = Methods.getWaterSourceBlock(player, range, true);
if(Methods.isPlant(source)){
//Do Shit
}
 

Finn_Bueno_

Staff member
Plugin Developer
Verified Member
Code:
Block source = Methods.getWaterSourceBlock(player, range, true);
if(Methods.isPlant(source)){
//Do Shit
}
Im already using that, but then you could do the same for lava, but it's still there. THIS IS PLANT RACISM
 

Finn_Bueno_

Staff member
Plugin Developer
Verified Member
it would be VERY useful if there was an option in Methods.getBlocksAroundPoint to make it hollow!
Code:
for(Block blocks : Methods.getBlocksAroundPoint(player.getLocation(), 5, true)){
//shit
}
would make it hollow for example :)
 

LeafHD_

Verified Member
Hello everyone, in ProjectKorra (Core) v1.6.0 we will be working to make the addon ability API much more extensive and easy to use. I created the modular ability system back in June, and made it more of a 'learning as I go' though. The API has grown into something huge and dozens of custom abilities have been made with it. I did find, however, upon further investigation into the API that it is missing some features. That's where you guys come in.

Through the course of developing add-on abilities, are there any features you felt the Modular Ability API needed to have? Did you have to find some clever workaround for it?

Please do share all you have.

@Carbogen is responsible for the API development in 1.6.0. I'd like to get the opinions of other addon developers in here as well, so I'll tag them just to send them a notification:

@jedk1 @Blaze590 @OmniCypher @AlexTheCoder @Coolade @SkitzCrafter @Orion_Solus @Fuzzy
@finnbon wasn't inculded D':
 

Finn_Bueno_

Staff member
Plugin Developer
Verified Member
Code:
Methods.hasWaterSource(Player player, Boolean isPlant);
I think, it's pretty obvious :3
It would allow to set it so a player has selected a water source, even if they haven't.
 

FearlessPie121

Verified Member
Some of you know me, some of you don't; well anyways, I'm starting to develop maybe simple moves for now just to learn; I would love if you guys could maybe make some stuff easier, or maybe it's already easy xD As a beginner, you kinda get overwhelmed, but I'm excited to get to know this whole other side of the plugin.
 

jedk1

New Member
Some of you know me, some of you don't; well anyways, I'm starting to develop maybe simple moves for now just to learn; I would love if you guys could maybe make some stuff easier, or maybe it's already easy xD As a beginner, you kinda get overwhelmed, but I'm excited to get to know this whole other side of the plugin.
if they make it too easy the community gets flooded with shit devs. And yes it is already easy.
 

FearlessPie121

Verified Member
if they make it too easy the community gets flooded with shit devs. And yes it is already easy.
True xD I'll just try my best, I hope maybe some of you guys could help me out if I get super stuck on something... I mean I have like 9 of your custom moves xD (amazing work by the way)
 
Top