• 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

[SOLVED] Execute a console command when a player start avatarstate.

poma123

New Member
Hello.
I have a question. How can I use the AbilityStartEvent with AvatarState? I want to when a player start the avatarstate, the console execute a command (e.g. "m " + event.getPlayer().getName() + " AvatarState started.").
I have seen the projectkorra java documentations, and i found the AbilityStartEvent. But i didn't understand it. Can anyone help me?
 

Sobki

Staff member
Lead Developer
Plugin Developer
Verified Member
As we can see on the AbilityStartEvent page, the event contains an Ability which can be used with the getAbility() method.

upload_2018-2-2_8-1-18.png

All you would need to do is simply check if this Ability is an instance of the AvatarState ability.
From there you can print whatever information you like.
 
Top