I want to change player nametag e.g. one player will see "player" and other players will see "name" So how can i do that?
1. i want to change nametag xD 2. i want to make change just for one player, setNameTag() change player's nametag for all players
It might be possible to accomplish this using packets. Please don't reply if you don't understand his question. And he's asking about nametags, not display names. Please read the first post thoroughly before you post with a "solution". You know how everyone sees the same nametag as you? He wants to make it so that one player sees his nametag as "player", and all the other players see it as "name". What works for you? Be more descriptive.
This might work. PHP: use pocketmine\Player;use pocketmine\entity\Entity;/*** @param Player $player* @param string $nametag* @param Player[]|Player $players*/public function customSetNameTag(Player $player, $nametag, $players){ $player->sendData($players, [Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING, $nametag]]);} Sources https://github.com/PocketMine/Pocke...9b5dcd7/src/pocketmine/entity/Entity.php#L295 https://github.com/PocketMine/Pocke...9b5dcd7/src/pocketmine/entity/Entity.php#L545 Edit: you should probably use the sendData function instead of making a custom one, it's just the custom method looks a bit cleaner and it looks slightly better.