mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
This occurs if the player had very high levels of Health Boost or other weird modifications. It doesn't really make sense to apply damage modifiers to suicide anyway. Really I'm doubtful that suicide should even be considered a damage type (perhaps we should add an EntitySuicideEvent), but that's a discussion for another time.
This commit is contained in:
parent
86810c5e1c
commit
24d979bd08
@ -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{
|
||||
|
@ -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 ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user