107 switch($deathCause === null ?
EntityDamageEvent::CAUSE_CUSTOM : $deathCause->getCause()){
108 case EntityDamageEvent::CAUSE_ENTITY_ATTACK:
110 $e = $deathCause->getDamager();
112 return KnownTranslationFactory::death_attack_player($name, $e->getDisplayName());
113 }elseif($e instanceof
Living){
114 return KnownTranslationFactory::death_attack_mob($name, $e->getDisplayName());
118 case EntityDamageEvent::CAUSE_PROJECTILE:
120 $e = $deathCause->getDamager();
122 $child = $deathCause->getChild();
124 return KnownTranslationFactory::death_attack_trident($name, $e->getDisplayName());
126 return KnownTranslationFactory::death_attack_arrow($name, $e->getDisplayName());
131 case EntityDamageEvent::CAUSE_SUICIDE:
132 return KnownTranslationFactory::death_attack_generic($name);
133 case EntityDamageEvent::CAUSE_VOID:
134 return KnownTranslationFactory::death_attack_outOfWorld($name);
135 case EntityDamageEvent::CAUSE_FALL:
136 if($deathCause instanceof
EntityDamageEvent && $deathCause->getFinalDamage() > 2){
137 return KnownTranslationFactory::death_fell_accident_generic($name);
139 return KnownTranslationFactory::death_attack_fall($name);
141 case EntityDamageEvent::CAUSE_SUFFOCATION:
142 return KnownTranslationFactory::death_attack_inWall($name);
144 case EntityDamageEvent::CAUSE_LAVA:
145 return KnownTranslationFactory::death_attack_lava($name);
147 case EntityDamageEvent::CAUSE_FIRE:
148 return KnownTranslationFactory::death_attack_onFire($name);
150 case EntityDamageEvent::CAUSE_FIRE_TICK:
151 return KnownTranslationFactory::death_attack_inFire($name);
153 case EntityDamageEvent::CAUSE_DROWNING:
154 return KnownTranslationFactory::death_attack_drown($name);
156 case EntityDamageEvent::CAUSE_CONTACT:
158 if($deathCause->getDamager()->getTypeId() === BlockTypeIds::CACTUS){
159 return KnownTranslationFactory::death_attack_cactus($name);
164 case EntityDamageEvent::CAUSE_BLOCK_EXPLOSION:
165 case EntityDamageEvent::CAUSE_ENTITY_EXPLOSION:
167 $e = $deathCause->getDamager();
169 return KnownTranslationFactory::death_attack_fireworks($name);
170 }elseif($e instanceof
Living){
171 return KnownTranslationFactory::death_attack_explosion_player($name, $e->getDisplayName());
174 return KnownTranslationFactory::death_attack_explosion($name);
176 case EntityDamageEvent::CAUSE_MAGIC:
177 return KnownTranslationFactory::death_attack_magic($name);
179 case EntityDamageEvent::CAUSE_FALLING_BLOCK:
181 $e = $deathCause->getDamager();
183 if($e->getBlock()->getTypeId() === BlockTypeIds::ANVIL){
184 return KnownTranslationFactory::death_attack_anvil($name);
186 return KnownTranslationFactory::death_attack_fallingBlock($name);
192 case EntityDamageEvent::CAUSE_CUSTOM:
199 return KnownTranslationFactory::death_attack_generic($name);