I'm still running Minecraft on my Fedora laptop, and I know my way around Ubuntu fairly well.
I recently migrated Minecraft from a Mojang login to a Microsoft one (as we are all apparently forced to do that now).
The only hassle was that Microsoft create a fake security alert in order to require me to provide them my phone number. I read elsewhere that's something Microsoft commonly do.
Perhaps you could share some details of your problem?
EDIT: it just occurred to me that you're probably lacking Java 17, which is the minimum for Minecraft 17 and later.
It should be just a matter of:
sudo apt-get install openjdk-17-jre
sudo update-alternatives --config java
and set Java 17 as the default JRE.
But if not, you will need a PPA from Matthias Klose, here:
<https://launchpad.net/ubuntu/focal/+package/openjdk-17-jre>
<https://askubuntu.com/questions/705072/is-the-openjdk-r-ppa-...>
Should be:
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt update
and then the aforementioned steps to install the package and set Java 17 as default.