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

Get TNT, which damaged/killed player

Comments in 'Plugin Development' started by MyNameIsTriXz, Apr 29, 2016.

  1. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    How do I do that? I mean through EntityDamageEvent or EntityExplodeEvent.
  2. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    PHP:
    $lastCause $event->getEntity()->getLastDamageCause();
    if(
    $lastCause instanceof EntityDamageByChildEntityEvent and $lastCause->getChild() instanceof PrimedTNT)
    And then get
    Skullex and MyNameIsTriXz like this.
  3. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Um getLastDamageCause returns null...
  4. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Means, this or a previous method, had already returned null.
  5. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    I know :D

Share This Page

Advertisement