All resource packs and worlds are saved in "resourcepacks" (for any created or downloaded resource packs) and "saves" (for any created or downloaded worlds). You have to move them all manually from ".minecraft" folder from the previous computer to the other ".minecraft" folder in the new computer.
Can be done by copying first and then saving the worlds and resource packs (resourcepacks and saves folders that are inside the .minecraft folder) and transfer those into any storage device (Can be any, like USB Flash Drive, external hard drive, etc.) or using cloud storage such as Google Drive, OneDrive, Dropbox, etc. as long has the required space to save them. Also make sure you also have Minecraft installed on the new computer, will generate a new ".minecraft" folder as a new.
Then, once has finished copying (for stroage devices) or uploading the folders (for cloud storage), you can:
- If used using storage device, plug the storage device into the PC, newly copy the transferred files into the new computer somewhere and then replace the empty "resourcepacks" and "saves" to the ones you want to have into your new computer.
- If used cloud storage, download the files into the new computer and replace the empty "resourcepacks" and "saves" to the ones you want to have into your new computer.
If you do the same process but with the entire ".minecraft" folder and replace the newly installed ".minecraft" with the one from the previous computer, you also going to transfer any files mods may generate (if used mods with the ".minecraft" directory), screenshots, settings, downloaded versions... just to name a few.