I was looking at source and I can't understand why this one was changed and stripped most of the important parts. I looked at AddActorPacket and the variables I need are there but not in AddEntityPacket, is there a workaround or a new way of using this packet please let me know *smiley face*
I found out how to do it all you have to do is change use PHP: use pocketmine\network\mcpe\protocol\AddEntityPacket; to either the faster way Code: use pocketmine\network\mcpe\protocol\AddActorPacket as AddEntityPacket; or better change all your code EXAMPLE: Code: case "polarbear": //player manager $player->teleport(new Vector3(0 + 0.5,63,89 + 0.5)); $player->setImmobile(true); //spawn entity $pk = new AddActorPacket(); $pk->type = 28; $pk->entityRuntimeId = 500; $pk->yaw = 180; $pk->headYaw = 180; $pk->pitch = 0; $pk->position = new Vector3(0 + 0.5, 63, 93 + 0.5); $this->plugin->getServer()->broadcastPacket([$player], $pk); return true;
All of the code shown above is correct for pocketmine builds under 3.9.0... In 3.9.0 it is no longer and entity packet but an actor packet.. Hope this helps