Skip to content
Sign upLog in
← Back to Community

Minecraft in JavaScript

Profile icon
repl-account

Minecraft in JavaScript

Update: Removed faulty game loop library, sped up game by 1000%

Controls:

Up - Space
Down - Left or Right Shift
Horizontal Movement - wasd
Camera Movement - Mouse
Switch Blocks - Number Keys
Place Block - Right Click
Destroy Block - Left Click

If the repl won't load use this URL instead: https://minecraft.repl-account.repl.co/

Voters
Profile icon
JamesFriley
Profile icon
VivianLi21
Profile icon
PhoenixBruno
Profile icon
RickyHernandez3
Profile icon
Pro6836Rather
Profile icon
TYCHOTHEUNER
Profile icon
Grei
Profile icon
MaxwellRose101
Profile icon
MARQUARIUSJONES
Profile icon
WilliamShackelf
Comments
hotnewtop
Profile icon
Nayoar

This (on notblockedgames.cf) is illegal. You have to give an option to opt out of cookies.
image


Edit: Ok, your entire website is very dodgy. Why does it give an unstoppable alert when I try to use inspect element?
Also, nice job obfuscating your IP-grabbing code. Nope nope nope.

Profile icon
tussiez

@minx28
Yikes

Profile icon
repl-account

@minx28
Added an opt-out option, and no, I am not actually logging the IPs that I get.

Profile icon
tussiez

@DarthVader29
@lilpeen

DarthVader29, I'm the SortaCraft dev and no, this is not my game.

Profile icon
kikuo

@minx28
huh it doesnt for me, F12, ctrl + shift + i, all work

Profile icon
beeYeeter

@LukeShomper
you may have a nice house...
but do you have a house with a bomb shelter???

Screenshot 2020-12-17 at 12.13.13 PM


Screenshot 2020-12-17 at 12.11.59 PM

Profile icon
[deleted]

@RowanLong1
I built an underground city in my house but I didn't screenshot it

Profile icon
FriendlyGooseMan

@RowanLong1
You make me sick, Do you have a house in a castle wall with a bomb shelter?
Minecraft - Google Chrome 12_18_2020 8_21_50 PM

Minecraft - Google Chrome 12_18_2020 8_21_22 PM

Profile icon
FriendlyGooseMan

This means war

@RowanLong1

Profile icon
PyCoder01

@LukeShomper
bois play real minecraft with RTX for the best experience.

Profile icon
beeYeeter

@LukeShomper
War? your castle shall fall under the fire of my bedrock stone launcher
Screenshot 2021-01-07 at 8.45.41 AM

Profile icon
ahkid7674

@LukeShomper
@RowanLong1
i was ging to make a doggo pixel art to beat both of yall but i accidentally deleted the tab T-T

Profile icon
ConnerSchulz

The warp pipe of death!
Screenshot 2022-05-20 2.38.30 PM


Screenshot 2022-05-20 2.38.34 PM

Profile icon
Baconman321

LOL looks like we got competition. In our (Ok, tussiez mostly made it, I just helped him make it work offline and such) minecraft (sortacraft), we are making gravitational pull (with terminal velocity), as well as light blocks. We are planning to add other cool stuff too!

Ok

@tussiez
come check out our competition!

Btw, nice! My school blocks anything with minecraft in the url (not this post tho...), but from what I have seen in the pics gives the impression hard work.
Keep it up!

Profile icon
repl-account

@Baconman321
Thanks! May I have a link to your Minecraft?

Profile icon
Baconman321

@lilpeen
not mine (although tussiez credits me a whole lot thanks tussiez :D), but yeh. It's really buggy right now, can't move (jumping has caused you to glitch up in the air and stay there), but come back later (tussiez and I are working on getting jumping done) and it might just work. Also, we might just use WASM to speed up the game. We also use web workers to make the game run faster (although it's still slow cuz it loads chunks), because web workers allow you to use multithreadedness. Overall, it's really laggy and buggy, but that's because of all the features we are putting in. Oh, it's also a PWA and works offline.

Link: https://sortacraft-1.tussiez.repl.co

(DISCLAIMER: NOT WORKING WELL YET).

Profile icon
repl-account

@Baconman321
World generation is great! Just need to fix the fact that you can walk through half slabs. Also, it may be a good idea to draw text to the canvas instead of in HTML elements because it's faster. Or at least disable highlighting for a better user experience. Just add another canvas right on top of the other one. All of the DOM events will go right through to the lower canvas. And what 3D rendering library are you using? I am using ThreeJS.

Profile icon
Baconman321

@lilpeen
He (tussiez) is using threejs. What text? It goes to another file for the new world generation. The only text I know of is the version display, which shouldn't take up as much power. Actually, putting it in canvas may be worse, since canvas is the element that gets constantly updated. As for the user select, I don't think that would be a good idea to turn it off, in case they want to copy/paste version, but yeah it might be a good idea. As for half slabs, he's working on that. Combining two slabs makes water (for a test he was doing).

Profile icon
repl-account

@Baconman321
The comments section chat isn't really time-efficient. If I shared the Minecraft repl with you, you wouldn't sabotage it right?

Profile icon
Baconman321

@lilpeen
XD no (I don't do that, besides u can revert changes if someone did happen to sabotage it). I can't really chat rn, but if u want help I can make it work offline by using recycled code from our service worker on our game.

Profile icon
repl-account

@Baconman321
I have shared it with you. There is a file in the root directory called chat.txt. If you or me have any questions we can leave them there.

Profile icon
tussiez

@lilpeen
I'm the owner :)

Profile icon
Baconman321

@tussiez
He thought I was the owner XD. I had to give u credit where he thought I made the game. As I stated, I'm the math man, and the guy who helps with physics and performance, nothing more, nothing less :D. It has still been an honor (not saying I'm quitting, saying it has been an honor) to work with u on this :D

Profile icon
repl-account

@tussiez
I can share it with you too if you want to check out the code.

Profile icon
tussiez

@tussiez
On your thoughts about the GUI, the inventory is dependent on HTML elements since I'm too lazy to write down positions (e.g 254,542), however that's a good idea anyway. I am using CSS to animate the tools though, and that's why I'm using elements. Half slabs were actually a test, and it works :) The collisions don't check for slabs, however I could simply do ".5" instead of "1". Disabling highlighting isn't too hard..

I wouldn't say the game is laggy.. it typically runs about 30-40 fps on Chromebooks, but works fine on more powerful devices. Keep in mind Chromebooks can't handle Minecraft very well (They've released Education Edition for the Chromebook, but it's a very "lightweight" version of the game)

Thanks for the feedback!

Profile icon
tussiez

@Baconman321
Yeah :) I cannot thank you enough for all the help, SortaCraft wouldn't be where it is today if it weren't for you. I think we're almost "done" on physics.

Profile icon
repl-account

@tussiez
Yes chromebooks are slow. You are definately doing better than me on performance, especially with block destruction.

Profile icon
tussiez

@tussiez
With your help, SortaCraft is over 2x faster, offline, and we can jump! (However it isn't working right now)

Profile icon
Baconman321

@tussiez
There's so much more to do, the performance can still get much faster...

Profile icon
Baconman321

@lilpeen
Ez fix. Cache main file that deals with game, that way it is served over internet faster. If course, this only helps on startup time, but can still help improve. The rest, try using web workers because then you have multiple threads doing different things (especially good for math). You can also do WASM which speeds up things faster since its an assembly language, meaning it can run faster than javascript and is also compiled instead of interpreted.

Profile icon
tussiez

@lilpeen
I can help you with Web Workers - they're a big help
I'm available sometime after 2-3 EST

Profile icon
tussiez

@Baconman321
Oof yeah
Especially geometry data generation
It's all math and could be done on the GPU

Profile icon
Baconman321

@tussiez
When I first read that, I was like "Oh, no are we not gonna work on physics?", then I saw "after 2-3 EST" (XD). Uhm, also I can work 2-3 CST, but did u say u are available 2-3 EST (I forgot if u said we can collab on ur game 2-3 CST or 2-3 EST)?

Profile icon
tussiez

@Baconman321
If
@lilpeen
wants to, I could write down some quick instructions on how to use Web Workers today, but that's probably it. I still need to fix jumping, so I'm still available at 2-3 CST.
The reason why I put EST is because I don't know what time zone
@lilpeen
is in.. 2 EST = 1 CST
Sorry about all the confusion, I'm in school right now

Profile icon
repl-account

@tussiez
Same time-zone eastern standard time. I can research webworker myself it's fine but thank you.

Profile icon
Baconman321

@tussiez
XD, ok yea see u at 2-3 CST. I should make a tutorial on web workers and such...

Profile icon
repl-account

@Baconman321
@tussiez
The slownessof this comment section is killing me!! Use the chat file in the repl I shared!!

Profile icon
tussiez

@Baconman321
That's a great idea!

Profile icon
tussiez

@lilpeen
Got it! Feel free to ask for help anytime.

Profile icon
tussiez
Profile icon
sojs

Nice job Baconmans school. My schools proxy and firewall I bypass uber-easily. It is absolute trash. There technique is just blocking certain sites that they choose, doesn't matter the URL. Feel bad for [email protected]

Profile icon
sojs

Wow no offense but that load time is [email protected]

image

Been like that for hours lol (like 2 minutes now)

Profile icon
Baconman321

@sojs
It's a game with more features, that's why it's slower. Plus, I have some ideas on how to make it faster.
Wait, this game, or the one tussiez and I made?

Profile icon
repl-account

@sojs
World gen is amazing though

Profile icon
Baconman321

@sojs
XD its on a chromebook, so the extension only blocks "actual" requests (one you type in the address/search bar) and Iframes that need to be blocked. I just fetch the website then put it as a srcdoc attribute XD (ofc I can't load external file resources, but good for reading articles).

Profile icon
sojs

The tussiez and u one. Also I'm on a chromebook so it would be slow with features or not lol.

@Baconman321

Profile icon
Baconman321

@sojs
Funny, you, tussiez and I are on chromebooks for school (u on school chromebook?), yet I have not heard of a school except for mine that uses chromebooks (ok I've only been to two schools and the current one has chromebooks but still).

Profile icon
sojs

Nice. I created and a proxy server myself. It would not work in your case though, because in you need to put the url you want to go to in the URL. (such as https://proxy.sojs.repl.co/proxy/https:/slither.io)
You also cant log into stuff with google on it, because google is very particular about what sites you are able to login to it [email protected] Also super glitchy if u r playing multiplayer. Cant guarantee it will work.

Profile icon
sojs

Most schools think use chromebooks now. And yes, I'm on a school [email protected]

Profile icon
repl-account

@sojs
Here is pretty cool proxy https://repl.it/@lilpeen/stuff?lite=true&outputonly=1 I didn't make it though

Profile icon
sojs

I've made one like that at https://repl.it/@sojs/chromium-browser-1. The problem with chromium unblockers is that if u dont have hacker plan it you cant load to many sites on it otherwise it crashes (repl memory used up)[email protected] And the shift key doesnt work so you have to look up "lowercase to capitol letters to get what you want lol.

Profile icon
Baconman321

@sojs
XD school blocks anything with "proxy" in it.

Profile icon
sojs

hehew. ur school is tough. Hold [email protected]

Profile icon
Baconman321

@sojs
Don't come to my school if u wanna learn coding. Also, it's for autistic kids so.... (ye Im autistic)

Profile icon
BCP

@Baconman321
I'm on a chromebook and it's a school chromebook the fps isn't that good

Profile icon
Baconman321

@BCP
That's the problem we are trying to fix. We want performance to be really good.

Profile icon
BCP

@Baconman321
oh ok =)

Profile icon
JRStudios4

@Baconman321

Well, you got more competition now.

Profile icon
repl-account