1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Change entity nametag for player

Discussion in 'Development' started by Kyd, Oct 21, 2018.

  1. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    I'm trying to change entity nametag for just one player, but nothing happens
    PHP:
    $packet = new SetEntityDataPacket();
    $packet->entityRuntimeId $entity->getId();
    $packet->metadata = [Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING$name[0] . "\n" TextFormat::GREEN "Unlocked"]];
    $player->dataPacket($packet);
     
  2. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    PHP:
    $packet = new SetEntityDataPacket();
    $packet->entityRuntimeId $entity->getId();
    $packet->metadata = [Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING$name[0] . "\n" TextFormat::GREEN "Unlocked"]];
    $player->dataPacket($packet);
    $entity->despawnFromAll();
    $entity->spawnToAll();
    The nametag bug on 1.6 and 1.7
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.