Easy Cause of Death String?

Discussion in 'Plugin Development' started by funkystudios, Jun 23, 2012.

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

    funkystudios

    Is there an easy way to get a string of what caused a player's death? For example: spider, creeper, fall, cactus, drowning... etc. Or do I have to go through each and check if the last damage cause was a creeper or from falling, or something else? It would be nice to have just a couple lines of code for this.
     
  2. Offline

    evilmidget38

    Yes, there is. Cast EntityDeathEvent to PlayerDeathEvent, then use PlayerDeathEvent's .getDeathMessage() method.
     
  3. Offline

    funkystudios

    Will this return strings like, "spider", "fall", "drowned", "someone382" etc?
     
Thread Status:
Not open for further replies.

Share This Page