For set custom entity name for current player I use: PHP: $pk = new SetEntityDataPacket(); $pk->entityRuntimeId = $entity->getId(); $pk->metadata = [ Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING, $name] ]; $player->dataPacket($pk); All ok, if player and entity in one chunk, otherwise the name does not change. How I can check if entity and player in one chunk? (Ex.: on move event)
This wouldn't work as your expecting it to even if you figure out how you can check if two entities are in the same chunk. You'll need to intercept all SetEntityDataPackets the server is sending the player and do the modifications. One way is by overriding the setNameTag function using a custom player class if it isn't hurting anyone.
Thanks! Do you have info or links on how to do this? (intercept all SetEntityDataPackets or content for new setNameTag)