diff --git a/src/command/defaults/KillCommand.php b/src/command/defaults/KillCommand.php index e58234ead..fbc743690 100644 --- a/src/command/defaults/KillCommand.php +++ b/src/command/defaults/KillCommand.php @@ -53,7 +53,7 @@ class KillCommand extends VanillaCommand{ return true; } - $player->attack(new EntityDamageEvent($player, EntityDamageEvent::CAUSE_SUICIDE, 1000)); + $player->attack(new EntityDamageEvent($player, EntityDamageEvent::CAUSE_SUICIDE, $player->getHealth())); if($player === $sender){ $sender->sendMessage(KnownTranslationFactory::commands_kill_successful($sender->getName())); }else{ diff --git a/src/entity/Living.php b/src/entity/Living.php index e615e4148..c6fdf34a7 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -517,7 +517,9 @@ abstract class Living extends Entity{ $source->cancel(); } - $this->applyDamageModifiers($source); + if($source->getCause() !== EntityDamageEvent::CAUSE_SUICIDE){ + $this->applyDamageModifiers($source); + } if($source instanceof EntityDamageByEntityEvent && ( $source->getCause() === EntityDamageEvent::CAUSE_BLOCK_EXPLOSION ||