Lightning effect arround player.

Discussion in 'Plugin Development' started by klofno1, Jul 24, 2013.

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

    klofno1

    Hi!

    How do I add a lightning effect 10 block behind, left from, right from and in front of the player?
     
  2. Offline

    etaxi341

    klofno1 Is your problem geting the locations or making the Lightning effect?
     
  3. Offline

    klofno1

    The locations, I only know how to edit the X Y and Z of the lightning but not how the add 4 lightning effects @each side of the player (Left, Rigth, Front Back)
     
  4. Offline

    etaxi341

    @klofno1Just do something like this:
    Code:java
    1. Location loc = player.getLocation();
    2. Location locxminus = loc.subtract(10,0,0);
    3. Location loczminus = loc.subtract(0,0,10);
    4. Location locxplus = loc.add(10,0,0);
    5. Location loczplus = loc.add(0,0,10);
    6.  
    7. player.getWorld().strikeLightning(locxminus);
    8. player.getWorld().strikeLightning(loczminus);
    9. player.getWorld().strikeLightning(locxplus);
    10. player.getWorld().strikeLightning(loczplus);
     
  5. Offline

    klofno1

    they all hit me
     
  6. Offline

    etaxi341

    klofno1 they are exactly at you?
     
  7. Offline

    klofno1

    Yep
     
  8. Offline

    etaxi341

    klofno1 Try this:
    Code:java
    1. Location locxminus = player.getLocation().subtract(10,0,0);
    2. Location loczminus = player.getLocation().subtract(0,0,10);
    3. Location locxplus = player.getLocation().add(10,0,0);
    4. Location loczplus = player.getLocation().add(0,0,10);
    5.  
    6. player.getWorld().strikeLightning(locxminus);
    7. player.getWorld().strikeLightning(loczminus);
    8. player.getWorld().strikeLightning(locxplus);
    9. player.getWorld().strikeLightning(loczplus);


    I am not sure if it works but you could try it.
     
Thread Status:
Not open for further replies.

Share This Page