From 1d4bafb6ff3e768dc8fed0de414779ddc5e4ddb0 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 24 Jan 2018 12:27:10 +0000 Subject: [PATCH] Fixed players getting full health on rejoin after quitting on death This makes #1567 less exploitable. Now, players who attempt to exploit this bug will get stuck - they won't be able to move or do anything. Not ideal, because they won't be able to respawn either - but it's better than nothing. --- src/pocketmine/entity/Entity.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index ad9421517..a34039458 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -922,6 +922,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ if($amount <= 0){ if($this->isAlive()){ + $this->health = 0; $this->kill(); } }elseif($amount <= $this->getMaxHealth() or $amount < $this->health){