I recently had a virus on my computer, but I coped with it and the virustotal site helped me in this and I decided to scan minecraft for fun and was surprised. I’ll say right away that virustotal scans files with more than 50 antiviruses. and found that there was a trojan in the launcher of minecraft and the malware I was worried about this and I reinstalled minecraft and erased all its files not only the launcher but also the .minecraft folder and downloaded everything again and still there were viruses. what’s funny is that if you download the launcher but don’t open it and check it, then there will be other viruses.
Those are most likely false positives. The download for Minecraft is perfectly safe. Just make sure you're downloading it from the official website: https://minecraft.net/download