Skip to content

Instantly share code, notes, and snippets.

Created June 10, 2014 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/69fbabe111b562b5da3f to your computer and use it in GitHub Desktop.
Save anonymous/69fbabe111b562b5da3f to your computer and use it in GitHub Desktop.
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.event.player.PlayerInteractEvent;
public class Ability implements Listener {
/*
* .... snip
*/
@EventHandler
public void onAbility (PlayerAbilityEvent e) {
if(e.isInteractEvent()) {
PlayerInteractEvent event = e.getPlayerInteractEvent();
//Do stuff with event
}else if(e.isEntityShootBowEvent()) {
EntityShootBowEvent event = e.getEntityShootBowEvent();
//Do stuff with event
}else if(e.isProjectileLaunchEvent()) {
ProjectileLaunchEvent event = e.getProjectileLaunchEvent();
//Do stuff with event
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment