mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Implemented Absorption effect
This is a little buggy due to a client-sided bug. https://bugs.mojang.com/browse/MCPE-20520 TODO: add attribute save/restore
This commit is contained in:
@ -85,6 +85,14 @@ abstract class Living extends Entity implements Damageable{
|
||||
$this->attributeMap->getAttribute(Attribute::HEALTH)->setMaxValue($amount);
|
||||
}
|
||||
|
||||
public function getAbsorption() : int{
|
||||
return (int) $this->attributeMap->getAttribute(Attribute::ABSORPTION)->getValue();
|
||||
}
|
||||
|
||||
public function setAbsorption(int $absorption){
|
||||
$this->attributeMap->getAttribute(Attribute::ABSORPTION)->setValue($absorption);
|
||||
}
|
||||
|
||||
public function saveNBT(){
|
||||
parent::saveNBT();
|
||||
$this->namedtag->Health = new ShortTag("Health", $this->getHealth());
|
||||
|
Reference in New Issue
Block a user