diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index d8abaaac6..5260c3887 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -537,7 +537,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ } public function canBeCollidedWith() : bool{ - return !$this->isSpectator(); + return !$this->isSpectator() and parent::canBeCollidedWith(); } public function resetFallDistance() : void{ diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 078d84665..ddde4903f 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -1101,7 +1101,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ } public function canBeCollidedWith() : bool{ - return true; + return $this->isAlive(); } protected function updateMovement(bool $teleport = false) : void{ diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index dc9e133a9..8c9d6071d 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -582,8 +582,6 @@ abstract class Living extends Entity implements Damageable{ if($this->isAlive()){ $this->applyPostDamageEffects($source); $this->doHitAnimation(); - }else{ - $this->startDeathAnimation(); } } @@ -622,6 +620,7 @@ abstract class Living extends Entity implements Damageable{ public function kill() : void{ parent::kill(); $this->onDeath(); + $this->startDeathAnimation(); } protected function onDeath() : void{