"Cannot access dynamic field "Pos": Dynamic field access on pocketmine\nbt\tag\CompoundTag is no longer supported"
Dynamic access was deprecated in god know which version. Use this instead PHP: $nbt->getTag('Pos'); // iirc
I can spawn the NPC but in a couple of milliseconds it's disappear PHP: $nbt = new CompoundTag;$nbt->setTag(new ListTag('Pos', [ new DoubleTag("", $player->getX() + 0.5), new DoubleTag("", $player->getY()), new DoubleTag("", $player->getZ() + 0.5)]));$nbt->setTag(new ListTag('Motion', [ new DoubleTag("", 0), new DoubleTag("", 0), new DoubleTag("", 0)]));$nbt->setTag(new ListTag('Rotation', [ new DoubleTag("", 0), new DoubleTag("", 0)]));$nbt->setTag(new ShortTag('Health', 20));$nbt->setTag(new StringTag('Name', $player->getLowerCaseName()));$nbt->setTag(new CompoundTag('Skin', [ "Data" => new ByteArrayTag("Data", $player->getSkin()->getSkinData()), "Name" => new StringTag("Name", $player->getSkin()->getSkinId())]));$npc = new Human($player->getLevel(), $nbt);$npc->setNameTagVisible(false);$npc->spawnTo($player); And also the skin of NPC is not player skin