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

Solved Death messages

Comments in 'Plugin Development' started by Jelly9912, Nov 16, 2015.

  1. Jelly9912
    Offline

    Jelly9912 Active Member

    Joined:
    Aug 8, 2015
    Posts:
    118
    Minecraft User:
    Jelly9912
    I don't know to what category i can add this thread, but this is for plugin so i posted this here.
    Where i can find all messages on death, e.g. Player123 drowned, or Player123 fell from a high place. I need all messages.
    thanks
  2. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Jelly9912 likes this.
  3. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    look into EntityDamageByEntityEvent

    Example:

    PHP:
    public function onPlayerDeath(PlayerDeathEvent $event){
    $player $event->getPlayer();
       
    $cid $player->getLastDamageCause()->getCause();
       switch(
    $cid){
         case 
    EntityDamageEvent::CAUSE_DROWNING:
           
    $event->getServer->broadcastMessage("/*message*/");
           break;
    /*keep going on*/
    *coded on my phone, there can be an error :p*
    Like if helped.
  4. Jelly9912
    Offline

    Jelly9912 Active Member

    Joined:
    Aug 8, 2015
    Posts:
    118
    Minecraft User:
    Jelly9912
    I mean just messages on death :p
    Anyway thanks xD
  5. Jelly9912
    Offline

    Jelly9912 Active Member

    Joined:
    Aug 8, 2015
    Posts:
    118
    Minecraft User:
    Jelly9912
    thebigsmileXD likes this.
  6. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Welcome (add the solved tag to the title if so :D)

Share This Page

Advertisement