Lightning strike help.

Discussion in 'Plugin Development' started by AbsolutePotato, Jan 2, 2013.

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

    AbsolutePotato

    I'm trying to make a plugin in which a user clicks a block with a wooden axe, and lightning strikes it. I have the basic code, down but I need someone to help disabled the fire, and put a 6 second cooldown on the strike. Code :
    Code:
     package com.lightniinja.EliteKits;
     
    import org.bukkit.Material;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerInteractEvent;
     
    public class ThorLightning
    implements Listener {
     
    @EventHandler
        public void onPlayerInteractBlock(PlayerInteractEvent evt){
            if(evt.getPlayer().getItemInHand().getTypeId() == Material.WOOD_AXE.getId()){
                //maximal distance between player and thunder is 200 blocks
                evt.getPlayer().getWorld().strikeLightning(evt.getPlayer().getTargetBlock(null, 6).getLocation());
            }
        }
    }
    
     
  2. Offline

    DJSanderrr

    try to add broadcast's and see where it goed wrong cuz i can't see it that fast by my own
     
  3. Offline

    gyroninja

    .strikeLightningEffect() Is what you are looking for.
     
  4. Offline

    pyraetos

Thread Status:
Not open for further replies.

Share This Page