mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Implement a Living::getDisplayName()
(#5384)
This commit is contained in:
@ -184,6 +184,13 @@ abstract class Living extends Entity{
|
||||
$this->attributeMap->add($this->absorptionAttr = AttributeFactory::getInstance()->mustGet(Attribute::ABSORPTION));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name used to describe this entity in chat and command outputs.
|
||||
*/
|
||||
public function getDisplayName() : string{
|
||||
return $this->nameTag !== "" ? $this->nameTag : $this->getName();
|
||||
}
|
||||
|
||||
public function setHealth(float $amount) : void{
|
||||
$wasAlive = $this->isAlive();
|
||||
parent::setHealth($amount);
|
||||
|
Reference in New Issue
Block a user