8 ms·
Browsercraft: Java Minecraft in the browser
- AlphaWeaver 2y agoAnother comment mentions MinecraftForFree.com... In middle school, in an attempt to get around the school firewall, I copied the HTML code from that website to my own to play Minecraft at school. Since my domain wasn't on the blocklist, it worked! But when my friends started using it to play, even after they hadn't bought the game, I resolved to add a login wall. I built a backend proxy in PHP that would POST their credentials to the Minecraft API to make sure they had purchased the game. I still think it's funny to think I had no ethical qualms about circumventing the school firewall, but piracy was where I drew the line.
- bobdigit 2y agoWe've gone full circle! Java was originally created to run apps in the browser.
- greatgib 2y agoAnd in the meantime, this shitty Roblox still doesn't run on Linux...
- burgerone 2y agoThere's a similar but "illegal" other client called eaglercraft. It bumps this up a notch with a much more "recent" version of MC, by compiling java to javascript
- pidgeon_lover 2y agoIs this at all related to Eaglercraft (web: https://eaglercraft.com/ https://eaglercraft.com/, src: https://git.eaglercraft.rip/eaglercraft https://git.eaglercraft.rip/eaglercraft), which is also browser-based Minecraft?
- apignotti 2y agoNo, this is the unmodified Minecraft JAR running on top of CheerpJ, a WebAssembly-based JVM.
- whalesalad 2y agoWe have come full circle #applets Twenty years ago running java in the browser would have just been called "using the internet"
- hombre_fatal 2y agoIt's not full circle. It's using built-in browser capabilities instead of a special sideloaded runtime granted by a browser extension. An example of full circle would be if wasm apps needed a browser extension so that they could access APIs not allowed by the browser.
- Ajedi32 2y agoYep, the original Minecraft ran in the browser in a Java applet so this is particularly fun example. Though obviously there are significant security benefits to the JVM running within the browser's WASM sandbox instead of directly on the host.
- lxgr 2y ago> there are significant security benefits to the JVM running within the browser's WASM sandbox instead of directly on the host. The JVM originally also had the goal of providing a security boundary, and even had a relatively complicated permissions/security model enforced via call stack inspection. That security model was ultimately too complicated for developers to work with, but I don't think the sandbox itself was particularly insecure.
- jcranmer 2y agoMy recollection is that the SecurityManager was notorious for being relatively easy to work around. Definitely one of the common questions people had when working on the richer HTML5 APIs was "how is your sandboxing going to be more effective than the Java applet model, given that that's known to be full of holes?"
- philipwhiuk 2y agoUntil they want features and punch holes in the sandbox. Audio/video codecs are a great example.
- SunkBellySamuel 2y agoThis is the main way I used to play Minecraft in the Beta days, thanks!
- lxgr 2y agoWow, same here, but I somehow completely forgot about that!
- spicybright 2y agoThere's a very funny story behind MinecraftForFree.com which is what most people used back then. Notch (the creator of minecraft) was angry someone was posting his game online for free. He emailed the owner, Dylan, of the site threatening legal action. Instead of going down a legal route, Dylan challenged him play a game of quake3 to settle the dispute. If notch won, Dylan would take the site down. If Dylan won, notch would would leave him alone and let him keep hosting the site. Notch agreed, won the match, and Dylan followed the promise and took it down forever!
- mzajc 2y agoThere are even recordings of their match (in two parts), they're quite funny: https://www.youtube.com/watch?v=g_Fu0SZ7PN8 https://www.youtube.com/watch?v=g_Fu0SZ7PN8
- awkwardpotato 2y ago> If Dylan won, notch would would leave him alone and let him keep hosting the site. Small correction, Dylan always planned to take the site down. They were playing for Minecraft capes[0] for him and his two teammates. The original livestream of the match is still up on Twitch also.[1] [0] Cosmetics that used to be very rare and only given out by devs or at MineCon [1] https://twitch.tv/videos/38469359 https://twitch.tv/videos/38469359
- spicybright 2y agoThank you for the correction! The story is basically minecraft folklore, so the details get exaggerated.
- __jonas 2y agoHuh, is Minecraft Java edition free now? I haven't played in a long time but I thought when you download the regular client you only get to play after signing in with an account that purchased the game, how is this thing just starting the game directly?
- looperhacks 2y agoYou could always play Minecraft without an account. But you can't join most servers that enable authentication checks
- h4x0rr 2y agoWell yeah you could play without an account with a cracked launcher
- lelandbatey 2y agoAt first, there was no launcher there was just the Minecraft.jar file which you could launch to start playing. That's what the parent page is doing; it's just having us download and run the game, no need for a launcher.
- immibis 2y agoYes. Downloading a game file you don't own and running it is called piracy, so beware of possible legal ramifications.
- __jonas 2y agoAh cool I didn't know, I thought the download of the actual full client was gated behind a login since even third party launchers seemed to require you to log in to play, good to know!
- immibis 2y agoNope, this is piracy. Which you may or may not consider a bad thing, but there will be lawyers in this person's future.
- kevmo314 2y agoIt crashed for me :( [failed to get system properties (java.lang.RuntimeException: No OpenGL context found in the current thread.)] Applets were a real vibe. The gradient-blue UI that came out of the box is true nostalgia.
- momojo 2y agoI get that when my GPU is disabled, although it usually falls back to CPU...
- butz 2y agoPlaying Minecraft without Microsoft account? That doesn't look safe.
- HideousKojima 2y agoWhy?
- immibis 2y agoIt's safe for the player, unsafe for the one hosting it, who risks prison time.
- jillyboel 2y agoDownloading a publicly available jar (https://piston-data.mojang.com/v1/objects/4a2fac7504182a97dcbcd7560c6392d7c8139928/client.jar https://piston-data.mojang.com/v1/objects/4a2fac7504182a97dc...), that gets linked on the minecraft wiki (https://minecraft.wiki/w/Java_Edition_1.2.5 https://minecraft.wiki/w/Java_Edition_1.2.5) and running it unmodified is "risking prison time"?
- earth2mars 2y agohow to do fullscreen?
- gavinray 2y ago5 years ago, I watched a YouTube recording of a meetup talk given by one of the CheerpX engineers: https://www.youtube.com/watch?v=7JUs4c99-mo https://www.youtube.com/watch?v=7JUs4c99-mo In it, they showed a functional demo of porting an OSS multiplayer C++ game entirely to the browser with WASM. Afterwards, I read some of their engineering content and was blown away. It's been fascinating to watch the CheerpX/CheerpJ progress from afar over the years.
- apignotti 2y agoThanks for your kind words, appreciated. Link to our blog, we try to regularly publish high quality content: https://labs.leaningtech.com/blog https://labs.leaningtech.com/blog
- waveringana 2y agoWhen I was in fourth grade, I'd take the half a mile walk to the library almost daily which always made my parents happy because they assumed I was going to read, but instead I was hopping onto their computers, going to http://minecraft.net http://minecraft.net, and playing minecraft on IE :) Thanks for the nostalgia
- porphyra 2y agoI used to do that except it was to play Runescape lol. The local library got some really nice Pentium 4 computers too.
- deleted 2y ago[deleted]
- afavour 2y agoThe longevity of Minecraft blows my mind. I was always aware of its existence but never looked into it. Now my kid is getting into it. So many generations of kids! It's incredible really. That said, it has been a little sad digging into the current state of Java vs Bedrock, Bedrock iPad vs Bedrock Switch. The platform ubiquity is wonderful and the tradeoffs are what they are. But if folks were able to create a touch-capable web-powered Java Minecraft that would be a great fit for the iPad.
- naikrovek 2y agoThe children yearn for the mines, apparently.
- eddd-ddde 2y agoAlso, Minecraft is like a gateway drug into Factorio. Dangerous stuff!
- immibis 2y agoAn interesting fact about Minecraft is that when it came out, storing the block IDs for the loaded area used up a big chunk of your computer's RAM and had to be optimized as much as possible. So it was 8 bits per block space, and when they expanded to 12 bits, they added on another array with 8 bits per 2 spaces. Now, it doesn't even use block IDs any more. It uses one whole object per block type, one pointer to one of those objects per block space, and has a lot more block types. The on-disk format stores the entire string name of the block, once per 16x16x16 region it occurs in.
- nullbyte 2y agoFunny enough, the original version of minecraft used to run in the browser too! It used Java applets. That was a long time ago, I remember playing it as a kid
- neuroelectron 2y agoYes that's how notch was able to distribute it while circumventing publishers. Very smart move at the time.
- diggan 2y agoJava Applets weren't some magical "workaround" for distributing without publishers, lots (well, subjective) of indie developers were distributing binaries via websites at the point of the first alphas of Minecraft. Of course, way more popular nowadays as there are dedicated platforms for it.
- 8note 2y agothe initial scope of minecraft was also in line with the java applet games of ~2005, like the ski simulator. minecraft came well after the applet era, almost to the end of the flash. huh. Minecraft is the taylor swift of video games. the last big star before big tech took over discovery and access for an industry.
- laidoffamazon 2y agoVery astute comparison. Yet somehow still both huge!
- schindlabua 2y agoI got into Minecraft via 4chan, of all places. People used to make posts about it and how cool it was and others would naturally talk crap about the game.
- pfoof 2y agoThe craziest part is that it executes on my iPhone SE 2020 in Safari. Textures work, shading works, pretty insane. I even managed to break a block.
- apignotti 2y agoMobile is indeed supported, although the performance is not yet as nice as we would like. The trickiest issue is input, since the "look around with your mouse" interaction maps very poorly on a mobile platform where "mousemove" implies touching / clicking. We plan to eventually figure out a mobile-optimize UX, but we will most likely prioritize improving the performance first.
- neuroelectron 2y agoThere already is Minecraft in the browser implementations that are quite performant https://map.realismc.com/#world:-87986:65:-25312:0:-0.01:1.57:0:0:free https://map.realismc.com/#world:-87986:65:-25312:0:-0.01:1.5... This is a world featuring llm powered players that make their own plans and constructions (using the terminal)
- CobrastanJorji 2y agoGreat. We brought back Applets.
- freedomben 2y agoNow we just need to popularize Swing again and we'll be golden
- api 2y agoIt's too bad that this kind of thing is using x86 as the actually-pseudocode for this. I understand why -- ease of porting, etc. -- but using either WASM (w/WALI?) directly with a kernel compiled to WASM (there are efforts to do this) or something open like RISC-V would be better long term.
- apignotti 2y agoThis is actually running on top of a WebAssembly-based Java Virtual Machine (CheerpJ). You are probably thinking about our independent x86 virtualization product CheerpX (https://cheerpx.io https://cheerpx.io)
- api 2y agoNo, I'm thinking about porting the Linux kernel to WASM itself and not using a VM written in WASM but WASM directly: https://wasmlinux-demo.pages.dev https://wasmlinux-demo.pages.dev In other words, using WASM as if it were the CPU architecture in the VM.
- Jotalea 2y agoThere's also Eaglercraft, which achieves the same result, but it has functioning multiplayer, and runs up to version 1.8.9, though you'll need a beefy computer.
- TeaVMFan 2y ago+1 for Eaglercraft. It's based on the open source TeaVM project ( https://teavm.org/ https://teavm.org/ ), which transpiles Java to JS or WASM to run efficiently in modern browsers. With numerous shipped production Java-in-the-browser projects, TeaVM is my preferred option for Java in the browser thanks to its performance, build speed, and Apache license.
- satoshinm 2y agoThis looks amazing! Both Eaglercraft and Browsercraft (though Eaglercraft seems to be further along) — the closest realization to the dream I've had for years of running a fully-featured Minecraft in the browser. Quite promising, I can only wonder where these projects will end up as they develop further, wishing for the best...! Why is this so exciting to me? I started playing Minecraft back in the Java modding days, which really picked up steam around 1.2.5 and, by my estimations, peaked around 1.7.10. There was a veritable cornucopia of mods widely available, to enhance the game in a plethora of ways. I modded my game so hard I undoubtedly ran more third-party code than first-party/Mojang. Minecraft was a platform for creative expression, freeform and unconstrained. The golden age of Minecraft modding! But it wasn't all unicorns and rainbows. There was a dark side of modding: the ease of use, or lack thereof in getting mods setup. Modpacks helped, but you still had to run untrusted code, and you still had to have a compatible PC. This is what (nearly) killed Minecraft for me. I wanted to play with my friend, but his PC had Windows upgraded and lost Java or OpenGL compatibility, and he eventually dropped his desktop and switched to tablets, phones, and consoles. My highly curated developed modded technical world became inaccessible. Contrast this unfortunate situation with the browser: with "load and go" functionality as Douglas Crockford calls it, you can just visit a website and play, provided sufficient specs. What if we could play modded Minecraft (preferably 1.7.10), with all the mods to our hearts content, right in the browser, accessible to anyone?! And anyone could develop and distribute their own mods without concern, being safely executed within the browser sandbox. I don't know how close Eaglercraft is to this utopia, but I find the possibility very enticing.
- OsrsNeedsf2P 2y agoThe fact I'm playing this at 20 FPS on Firefox with a RX 7600 shows how much web browsers have regressed in 10 years, not how much they've advanced.
- Ralo 2y agoThis implementation isn't using webworkers either. Moving the java VM to a webworker would likely improve performance 10 fold.
- TeeMassive 2y agoIt's basically java -> wasm/webgl -> your computer A 10 times hit compared to a native C implementation on performance doesn't really matter anymore, but a compounded 10x10 times will.
- zimpenfish 2y ago> The fact I'm playing this at 20 FPS on Firefox with a RX 7600 Vanilla Minecraft is known for being awful for FPS even outside of a browser. There's a reason most people use a whole slate of performance mods just to get actual decent performance. (I've got a Ryzen 7 with a 3080 and it would frequently hover between 40-50fps even with graphics turned down. Install the performance mods and I can get >120fps with fancy graphics and shaders.)
- InMice 2y agoA longstanding performance effecting bug was fixed in the recently released 1.21.5 and the difference is night and day at least for vanilla clients. This one: https://bugs.mojang.com/browse/MC/issues/MC-170134 https://bugs.mojang.com/browse/MC/issues/MC-170134 I now never see below 60 fps when for all my years of playing this bug would bring down my FPS to the teens or 0 all the time no matter what hardware.
- zimpenfish 2y ago> A longstanding performance effecting bug was fixed in the recently released 1.21.5 Good to know that they're finally considering performance fixes but obviously involves moving to 1.21.5 and until there's mods to disable the bits I don't like, I'll be sticking with 1.20+mods.
- resurrected 2y ago[flagged]
- apignotti 2y agoHi everybody, happy to see our CheerpJ demo is appreciated. CheerpJ is a WebAssembly-based JVM that can run unmodified Java 8 and Java 11 applications. Java 17 will be supported later in year. I am the lead developer of CheerpJ and CTO of Leaning Technologies. AMA.
- henrycrutcher 2y agoHow much is the licensing for a small company wanting external users to use it to use an app hosted online?
- apignotti 2y agoSmall Business licenses will be available with the release of CheerpJ 4.0, expected in mid April 2025. They will allow self-hosting and will be priced on a per application / per website basis. They will be priced to be affordable and ensure that CheerpJ enjoys a wide reach. If you are interested before the release, please do get in touch (info@leaningtech.com).
- skrebbel 2y agoCool stuff! Hey I saw a typo on https://cheerpj.com/cheerpj-core-licenses/ https://cheerpj.com/cheerpj-core-licenses/, it says "liencesees" halfway the page
- apignotti 2y agoThanks for spotting this, we'll get it fixed ASAP
- geokon 2y agoWould it work for a JavaFX app? (not sure I'd be able to shrink the bundle size enough for it to make sense though)
- apignotti 2y agoJavaFX is not yet supported, but we plan to get it to work soon. The issue here is that there is very little Java in JavaFX, it's mostly native C++ code. This makes it actually quite similar to the LWJGL library used by Minecraft. Our plan is to use for JavaFX the same technology we have developed for LWJGL.
- ConfusedDog 2y agoI used to love Minecraft as a kid until my kid ruined it for me. This 5-year-old loves to be in Creative mode and put me in Survival mode and set up traps and rounds of enemies for me to fight my way out. Not relaxing at all anymore.
- doubled112 2y agoMy 7 year old's favourite activity in Minecraft is to blow stuff up. I don't know whether to be concerned or not, but at least we've convinced him that it's really not cool to blow other people's stuff up. Like you say, not very relaxing.
- kulahan 2y agoSend that child to the demolition career. There’s good money in blowing up buildings!
- doubled112 2y agoExactly! There is a demand for constructive deconstruction. Consent is everything?
- bulldojuu 2y ago[flagged]