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

BossBar is not showing...

Discussion in 'Development' started by Levi, Jun 27, 2018.

  1. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    i tried
    PHP:
    $ak = new AddEntityPacket();
    $ak->type Entity::ZOMBIE;
    $ak->entityRuntimeId Entity::$entityCount++;
    $ak->position = new Vector3();
    $ak->metadata[Entity::DATA_NAMETAG] = [Entity::DATA_TYPE_STRING"Title for the bossbar"];
    $sender->dataPacket($ak);

    $pk = new BossEventPacket();
    /** @var Zombie $en */
    $en Entity::ZOMBIE;
    $pk->bossEid $en->getId();
    $pk->title "Title";//this will probably get overridden by $boss->getNameTag()
    $pk->playerEid $sender->getId();
    $pk->eventType BossEventPacket::TYPE_SHOW;
    $pk->healthPercent 50;
    $pk->unknownShort 1;
    $pk->color 1;
    $pk->overlay 1;
    $sender->dataPacket($pk);
    and it sends no bossbar. but if the $pk->bossEid is $pk->bossEid = $player->getId() it gives me bossbar but it sends the players nametag i dont want that unless i can change the title
     
  2. AshBull

    AshBull Spider Jockey

    Messages:
    31
    Hmm...
     
  3. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    I tried $ak->bossEid = Entity::ZOMBIE it dont work
     
  4. AshBull

    AshBull Spider Jockey

    Messages:
    31
    bossEid is supposed to be the runtime ID of a spawned entity, not the entity type
     
  5. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    how do i get that
     
  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.