After update to 1.11.0 function for set title on boss bar not worked... Why? PHP: public static function setTitle(string $title, int $eid, $players = []){ if (!count(Server::getInstance()->getOnlinePlayers()) > 0) return; $npk = new SetEntityDataPacket(); $npk->metadata = [Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING, $title]]; $npk->entityRuntimeId = $eid; Server::getInstance()->broadcastPacket($players, $npk); $bpk = new BossEventPacket(); // This updates the bar $bpk->bossEid = $eid; $bpk->eventType = BossEventPacket::TYPE_SHOW; $bpk->title = $title; $bpk->healthPercent = 1; $bpk->unknownShort = 0; $bpk->color = 0; $bpk->overlay = 0; $bpk->playerEid = 0; Server::getInstance()->broadcastPacket($players, $bpk); }
In 1.11 many people have experienced problems with bossbars, hopefully they will be fixed soon / someone has a fix for them. I don't think they work for anyone in 1.11
if I change PHP: $bpk->eventType = BossEventPacket::TYPE_SHOW; to PHP: $bpk->eventType = BossEventPacket::TYPE_TITLE; it worked