Lightning to specific player

Discussion in 'Plugin Development' started by CorrieKay, Dec 16, 2012.

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

    CorrieKay

    How would i send a lightning strike to a specific player? I figure i just have to find the lightning packet, and send it to the player, right? Which packet is that?
     
  2. Offline

    tommycake50

    you want to strike a player?
    player.getWorld().strikeLightenning(player.getLocation());
     
  3. Offline

    Hoolean

    No, that's nothing to do with the OP :p

    Reread it :D
     
  4. Offline

    tommycake50

    its kinda hard to understand :/.
     
  5. Offline

    CorrieKay

    i want to send a lightning packet to a specific player. Basically, only they would see the lightning.
     
  6. Offline

    fireblast709

  7. Offline

    CorrieKay

    :confused: do i have to build my own packet?
     
  8. Offline

    fireblast709

    If you want to send it to one player only, I think you have.
    Code:java
    1. net.minecraft.server.EntityLightning el = new net.minecraft.server.EntityLightning(((CraftWorld)world).getHandle(), 0,0,0, true);
    2. net.minecraft.server.Packet71Weather packet = new net.minecraft.server.Packet71Weather(el);
    3. ((CraftPlayer)player).getHandle().netServerHandler.sendPacket(packet);

    Just felt like writing it for you :p. Untested
     
  9. Offline

    CorrieKay

    Thanks a ton :D
     
  10. Offline

    fireblast709

Thread Status:
Not open for further replies.

Share This Page