My code doesn't works in Pocketmine 1.2 ALPHA8 i need to spawn in the same coordinates of x,y,z that is in $pk, please help CODE: PHP: $entityId5 = 20005; $pk5 = new AddEntityPacket(); $pk5->type = ItemEntity::NETWORK_ID; $pk5->username = ""; $pk5->entityRuntimeId = $entityId5; $pk5->eid = $entityId5; $pk5->x = -332; //COORDINATS $pk5->y = 35; //COORDINATS $pk5->z = 1306; //COORDINATS $pk5->speedX = $pk5->speedY = $pk5->speedZ = 0.0; $pk5->yaw = 0; $pk5->pitch = 0; $flags = ( (1 << Entity::DATA_FLAG_CAN_SHOW_NAMETAG) | (1 << Entity::DATA_FLAG_ALWAYS_SHOW_NAMETAG) | (1 << Entity::DATA_FLAG_IMMOBILE) ); $pk5->metadata = [ Entity::DATA_FLAGS => [Entity::DATA_TYPE_LONG, $flags], Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING, "...."], ]; $p->dataPacket($pk5);
use PHP: $pk->position;# instead of$pk->x;$pk->y;$pk->z; https://github.com/pmmp/PocketMine-...network/mcpe/protocol/AddEntityPacket.php#L42
$pk->position and optionally, $pk->motion, need to be an instance of pocketmine\math\Vector3. PHP: $pk->position = new pocketmine\math\Vector3(-332, 35, 1306);$pk->motion = new pocketmine\math\Vector3(0, 0, 0); // optional