mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 20:07:09 +00:00
Set default health attribute value when changing max health, closes #2771
This commit is contained in:
parent
3c93a57397
commit
2e0dd574e0
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user