I have Linux Mint, but it should fit any Ubuntu-based distributive.
What I did is:
Install it according to this article — https://retropie.org.uk/docs/Debian/.
Add games for Super Nintendo to
~/RetroPie/roms/snes. Then restart RetroPie and you will see an option for Super Nintendo.
That’s how you can install Java edition — https://tipsonubuntu.com/2016/08/04/install-minecraft-ubuntu-16-04-ubuntu-16-10/.
It has free demo limited to 100 minutes (it’s easy to remove this limit, but it’s out of scope for this article).
Now you can play with your keyboard and mouse.
Add joystick drivers on Ubuntu like that:
sudo apt install xboxdrv joystick
sudo apt install jstest-gtk
And you can use your joysticks (from XBox, PS or other) by launching Minecraft via Steam. That’s free and will use your previously installed Minecraft Java version. That’s the explanation —