Solved Need help with BukkitRunnable

Discussion in 'Plugin Development' started by Dubehh, Jun 18, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Dubehh

    Hi,

    I have this runnable class where I want to spawn particles after a fireball (after every second for example).

    I have this listener when I fire a fireball:
    Code:java
    1.  
    2. @EventHandler
    3. public void onWandUse(PlayerInteractEvent e){
    4. Player p = e.getPlayer();
    5. ItemStack wand = p.getItemInHand();
    6. if(wand == null || wand.getType() == Material.AIR) return;
    7. if (wand.getType().equals(Material.BLAZE_ROD)
    8. && wand.getItemMeta().getDisplayName() != null) {
    9. if(!(wand.getItemMeta().getDisplayName().equals(ChatColor.AQUA + "Illusional Wand"))) return;
    10. if(e.getAction() == Action.LEFT_CLICK_AIR || e.getAction() == Action.LEFT_CLICK_BLOCK){
    11. final Fireball ball = p.launchProjectile(Fireball.class);
    12.  


    In this listener I can use the variable 'ball' to spawn effects on its location (ball.getLocation).
    However, in a BukkitRunnable I can't use THIS variable to do something with it.

    Code:java
    1. public class IllusionistBeam extends BukkitRunnable {
    2.  
    3. public void run() {
    4. //I need to acces the 'Ball' shot from the Listener :)
    5.  
    6.  
    7. }
    8.  
    9. }


    Thanks!

    Fixed. nvm

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
Thread Status:
Not open for further replies.

Share This Page