Is Java or Javascript used in creating games and mods like minecraft?

I want to create fun games and useful programs, and I'm currently learning Java, but I want to know which one is used for games. I believe that Java is more basic?

Java is used to make Minecraft. And it's likely that a fair amount of games on Android phones uses Java too (since that's the primary language used to make apps on Android). JavaScript is used more on websites. So generally, you'd make games with JavaScript, if you want the game to run on a web browser. It's also possible to make local native apps on computers (eg. UWP apps on Windows 10 can be made with JavaScript or use Electron with web languages (HTML, CSS and JavaScript with Node.js.