diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index ad9421517..6dff0d938 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -848,7 +848,14 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ if($this->namedtag->hasTag("CustomName", StringTag::class)){ $this->setNameTag($this->namedtag->getString("CustomName")); - $this->setNameTagVisible($this->namedtag->getByte("CustomNameVisible", 1) !== 0); + + if($this->namedtag->hasTag("CustomNameVisible", StringTag::class)){ + //Older versions incorrectly saved this as a string (see 890f72dbf23a77f294169b79590770470041adc4) + $this->setNameTagVisible($this->namedtag->getString("CustomNameVisible") !== ""); + $this->namedtag->removeTag("CustomNameVisible"); + }else{ + $this->setNameTagVisible($this->namedtag->getByte("CustomNameVisible", 1) !== 0); + } } $this->scheduleUpdate();