mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-14 15:35:31 +00:00
Living: do not apply noDamageTicks to suicide damage
suicide damage is a voluntary damage source, which noDamageTicks is intended to prevent getting damaged while the player gets their bearings after (re)spawning.
This commit is contained in:
parent
f38aee1fc5
commit
4637aae621
@ -504,7 +504,7 @@ abstract class Living extends Entity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function attack(EntityDamageEvent $source) : void{
|
public function attack(EntityDamageEvent $source) : void{
|
||||||
if($this->noDamageTicks > 0){
|
if($this->noDamageTicks > 0 && $source->getCause() !== EntityDamageEvent::CAUSE_SUICIDE){
|
||||||
$source->cancel();
|
$source->cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user