Solved LightningStrike broken

Discussion in 'Plugin Development' started by Zenya4, Jun 5, 2017.

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

    Zenya4

    Hi all,

    Im making this plugin where a lightning bolt strikes where the player is looking at on a command. Here is my current code:
    Code:
    
    if(args[0].equalsIgnoreCase("Lightning_Bolt")) {
    
    Block block = player.getTargetBlock((Set<Material>) null, 300);
    
    int x = block.getLocation().getBlockX();
    
    int y = block.getLocation().getBlockY() + 1;
    
    int z = block.getLocation().getBlockZ();
    
    Block blockabove = player.getWorld().getBlockAt(x, y, z);
    
    player.getWorld().spawn(blockabove.getLocation(), LightningStrike.class);
    
    }
    
    However, it doesnt display the lightning bolt. I know it actually spawns it as it makes a creeper a charged creeper when I use it near a creeper and there is fire on the ground. But no lightning bolt. Is it something wrong with my code or something? Hope someone can answer thanks!
     
  2. Offline

    Zombie_Striker

  3. Offline

    Zenya4

    Solved. Thanks for your help!
     
Thread Status:
Not open for further replies.

Share This Page