104 switch($deathCause === null ?
EntityDamageEvent::CAUSE_CUSTOM : $deathCause->getCause()){
105 case EntityDamageEvent::CAUSE_ENTITY_ATTACK:
107 $e = $deathCause->getDamager();
109 return KnownTranslationFactory::death_attack_player($name, $e->getDisplayName());
110 }elseif($e instanceof
Living){
111 return KnownTranslationFactory::death_attack_mob($name, $e->getDisplayName());
115 case EntityDamageEvent::CAUSE_PROJECTILE:
117 $e = $deathCause->getDamager();
119 return KnownTranslationFactory::death_attack_arrow($name, $e->getDisplayName());
123 case EntityDamageEvent::CAUSE_SUICIDE:
124 return KnownTranslationFactory::death_attack_generic($name);
125 case EntityDamageEvent::CAUSE_VOID:
126 return KnownTranslationFactory::death_attack_outOfWorld($name);
127 case EntityDamageEvent::CAUSE_FALL:
128 if($deathCause instanceof
EntityDamageEvent && $deathCause->getFinalDamage() > 2){
129 return KnownTranslationFactory::death_fell_accident_generic($name);
131 return KnownTranslationFactory::death_attack_fall($name);
133 case EntityDamageEvent::CAUSE_SUFFOCATION:
134 return KnownTranslationFactory::death_attack_inWall($name);
136 case EntityDamageEvent::CAUSE_LAVA:
137 return KnownTranslationFactory::death_attack_lava($name);
139 case EntityDamageEvent::CAUSE_FIRE:
140 return KnownTranslationFactory::death_attack_onFire($name);
142 case EntityDamageEvent::CAUSE_FIRE_TICK:
143 return KnownTranslationFactory::death_attack_inFire($name);
145 case EntityDamageEvent::CAUSE_DROWNING:
146 return KnownTranslationFactory::death_attack_drown($name);
148 case EntityDamageEvent::CAUSE_CONTACT:
150 if($deathCause->getDamager()->getTypeId() === BlockTypeIds::CACTUS){
151 return KnownTranslationFactory::death_attack_cactus($name);
156 case EntityDamageEvent::CAUSE_BLOCK_EXPLOSION:
157 case EntityDamageEvent::CAUSE_ENTITY_EXPLOSION:
159 $e = $deathCause->getDamager();
161 return KnownTranslationFactory::death_attack_explosion_player($name, $e->getDisplayName());
164 return KnownTranslationFactory::death_attack_explosion($name);
166 case EntityDamageEvent::CAUSE_MAGIC:
167 return KnownTranslationFactory::death_attack_magic($name);
169 case EntityDamageEvent::CAUSE_FALLING_BLOCK:
171 $e = $deathCause->getDamager();
173 if($e->getBlock()->getTypeId() === BlockTypeIds::ANVIL){
174 return KnownTranslationFactory::death_attack_anvil($name);
176 return KnownTranslationFactory::death_attack_fallingBlock($name);
182 case EntityDamageEvent::CAUSE_CUSTOM:
189 return KnownTranslationFactory::death_attack_generic($name);