Solved Death Cause

Discussion in 'Plugin Development' started by bubblefat_, May 28, 2015.

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

    bubblefat_

    How do I get the death cause?
     
  2. Offline

    shades161

  3. Offline

    bwfcwalshy Retired Staff

  4. Offline

    bubblefat_

  5. Offline

    bwfcwalshy Retired Staff

    Moved to Plugin Development.
     
  6. @bubblefat_ To get a player's cause of death, you'd have to check under the PlayerDeathEvent. You would use this line to get a player's cause of death:
    Code:
    event.getCause();
     
  7. Offline

    Konato_K

  8. Offline

    bubblefat_

    @CodePlaysMinecraft

    There is no such thing as event.getCause() user PlayerDeathEvent, its the first thing I tried to do.
     
  9. Offline

    Konato_K

    @bubblefat_ Use getEntity and call getLastDamageCause, this will return an EntityDamageEvent or null, then you can call getCause in there
     
    jaccck likes this.
Thread Status:
Not open for further replies.

Share This Page