The best solution would be to install Prism Launcher from Flathub. This method is better than relying on downstream projects like PollyMC which may have delayed updates and be abandoned anytime: To avoid having to sign in to Microsoft spyware to play, do the following, credits to this guide:
First, open Prism Launcher, then close it. This is to ensure that the account data has been initialized.
Second, run this command on the terminal:
echo '{"accounts": [{"entitlement": {"canPlayMinecraft": true,"ownsMinecraft": true},"type": "Offline"}],"formatVersion": 3}' > ~/.var/app/org.prismlauncher.PrismLauncher/data/PrismLauncher/accounts.json
Third, open Prism Launcher, press the account button on the top right, create an offline account, and set it as the default account by pressing the Set as Default
button on the right side of the list. After this, delete the No Profile
account by pressing its entry on the list and selecting Delete
on the right side of the list.
Done! You can now play Minecraft without the Microsoft account BS.
~~Note that I do not support piracy, but I cannot tell you to buy Minecraft first before doing this because I don't want to be a hypocrite.~~ lmao i didn't notice what community i'm on lol