I tried to set different names for a player. For example: for player1 player has the name "Hello1" and for player2 player's name ist "Hello2". But. Don't know how to do that :/ I already tried SetEntityDataPacket. But it didn't change anything
https://forums.pmmp.io/threads/lack-of-help-in-simple-requests.2604/ http://xyproblem.info http://www.catb.org/esr/faqs/smart-questions.html
how are you trying to set their names? do you mean their nametags, their display list name, or something else?
I wrote I want to set it different for every player. The nametag should not be the same for $player1 and $player2.
okay, then set the nametags different lol $player1->setNameTag("Steve"); $player2->setNameTag("Alex");
You didn't understand my problem... I only want to set the nametag for $player! But $player1 sees the nametag "Text1" and $player2 sees "Text2"
Okay, so you are asking for the needed code to make a player's nametag appear differently to different players?
PHP: $pk = new \pocketmine\network\mcpe\protocol\SetEntityDataPacket();$pk->entityRuntimeId = $player1->getId();$pk->metadata = [ \pocketmine\entity\Entity::DATA_NAMETAG => [\pocketmine\entity\Entity::DATA_TYPE_STRING, "player1 new name"]];$player2->dataPacket($pk);