Hello, I have a problem: I use a Task to add an EntityPacket, but sometimes the nametag changes its position (it shifts from a block)... How can it keep the position that I put in my code ($x/$y/$z) ? PHP: $spawn = new AddEntityPacket(); $spawn->type = $type; $spawn->eid = $eid; $spawn->x = $x; $spawn->y = $y; $spawn->z = $z; $spawn->speedX = 0; $spawn->speedY = 0; $spawn->speedZ = 0; $spawn->yaw = 0; $spawn->pitch = 0; $spawn->metadata = [ Entity::DATA_FLAGS => [Entity::DATA_TYPE_LONG, $flags], Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING, $string], 38 => [Entity::DATA_TYPE_LONG, -1]]; foreach($this->owner->getServer()->getOnlinePlayers() as $player){ $player->dataPacket($spawn); } Thank you.
The namedtag (NBT tags) are processed server side, the position specified in NBT should not affect the position displayed to the client. I don't see why you need to directly send packets when you can easily extend PocketMine's Entity classes to achieve what you're trying to do. Just a quick note for your future posts, it'd be easier to help you achieve what you want if you provide us with the full code (or at least the class).