diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 826f269b2..878e6c9ed 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -554,7 +554,7 @@ abstract class Entity{ } if($amount <= 0){ - if($this->isAlive()){ + if($this->isAlive() and !$this->justCreated){ $this->kill(); } }elseif($amount <= $this->getMaxHealth() or $amount < $this->health){ @@ -591,7 +591,12 @@ abstract class Entity{ protected function entityBaseTick(int $tickDiff = 1) : bool{ //TODO: check vehicles - $this->justCreated = false; + if($this->justCreated){ + $this->justCreated = false; + if(!$this->isAlive()){ + $this->kill(); + } + } $changedProperties = $this->getSyncedNetworkData(true); if(count($changedProperties) > 0){ diff --git a/src/player/Player.php b/src/player/Player.php index 7d6a37f1c..c4891d155 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -2105,9 +2105,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, } protected function onDeath() : void{ - if(!$this->spawned){ //TODO: drop this hack - return; - } //Crafting grid must always be evacuated even if keep-inventory is true. This dumps the contents into the //main inventory and drops the rest on the ground. $this->doCloseInventory();