1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How do I get the player dead? To judge whether it's SUFFOCATION, DROWNING, etc.

Discussion in 'Facepalm' started by caibin, Jul 16, 2017.

  1. caibin

    caibin Creeper

    Messages:
    2
    GitHub:
    caibin
    I need to write a custom death message, but like SUFFOCATION, DROWNING, I don't write know these events. I just write about killing now,as shown in the figure QQ图片20170716123906.png
     
  2. Keith

    Keith Spider Jockey

    Messages:
    42
    GitHub:
    k3ithos
    $ldamage->getDamager() returns an entity, so you should check if it's a player before then running getName() on it directly.
     
  3. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Suffocation is not an EntityDamageByEntityEvent.
     
  4. caibin

    caibin Creeper

    Messages:
    2
    GitHub:
    caibin
    Yes, I think so. I just want to know how to write SUFFOCATION, DROWNING, and these events
     
  5. caibin

    caibin Creeper

    Messages:
    2
    GitHub:
    caibin
    You can ignore that picture andI "just write about killing now,as shown in the figure" this sentence
     
  6. caibin

    caibin Creeper

    Messages:
    2
    GitHub:
    caibin
    I just want to know how to write SUFFOCATION, DROWNING, and these events
     
  7. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
  8. Daniktheboss

    Daniktheboss Baby Zombie

    Messages:
    144
    GitHub:
    daniktheboss
    getCause()
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.