From 2e0dd574e0ca8e8fa81606b0124b18744ac1d6c3 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 17 Feb 2019 17:06:32 +0000 Subject: [PATCH] Set default health attribute value when changing max health, closes #2771 --- src/pocketmine/entity/Living.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index b2e1dbed6..c9030152f 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -152,7 +152,7 @@ abstract class Living extends Entity implements Damageable{ } public function setMaxHealth(int $amount) : void{ - $this->attributeMap->getAttribute(Attribute::HEALTH)->setMaxValue($amount); + $this->attributeMap->getAttribute(Attribute::HEALTH)->setMaxValue($amount)->setDefaultValue($amount); } public function getAbsorption() : float{