Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

in Lightning?

Comments in 'Plugin Development' started by Skullex, Mar 19, 2016.

  1. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    How exactly would I be able to know when a player gets struck by lightning and pass events? The events part I can do but how would I know when a player gets struck??

    What i mean is when a player gets struck by lightning this and that happens like a message
    Last edited: Mar 19, 2016
  2. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    EntityDamageByEntityEvent getDamager() instanceof Projectile
    Skullex likes this.
  3. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    Thanks, just verifying
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Are you sure?

    Lightning isn't implemented by PocketMine yet. How come there would be damage from lightning?
    Skullex and PocketKiller like this.
  5. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Oh yeah, forgot that
    Then you would have to listen all packets and get the position of the lightnings
    (Some plugins are generating lightnings with packets)
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The fact is, you can't. It is totally dependent on the code that does the damage.
  7. TheDeibo
    Offline

    TheDeibo Notable Member

    Joined:
    Sep 8, 2014
    Posts:
    693
    Minecraft User:
    TheDeibo
    Just as a little reference for lightning, look into the code of this. https://forums.pocketmine.net/plugins/lightning-strike.1697/

    It basically does a lightning strike upon death, and join. So, i suppose, if you imagine /kill <playerName> really strikes them with lightning, and the lightning kills them. ( although that really doesnt happen)

Share This Page

Advertisement