Minecraft in JavaScript
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 usethis URL instead: https://minecraft.repl-account.repl.co/
@LukeShomper you may have a nice house...
but do you have a house with a bomb shelter???
@RowanLong1 I built an underground city in my house but I didn't screenshot it
@RowanLong1 You make me sick, Do you have a house in a castle wall with a bomb shelter?
This means war @RowanLong1
@LukeShomper bois play real minecraft with RTX for the best experience.
@LukeShomper War? your castle shall fall under the fire of my bedrock stone launcher
@LukeShomper @RowanLong1 i was ging to make a doggo pixel art to beat both of yall but i accidentally deleted the tab T-T
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!
@Baconman321 Thanks! May I have a link to your Minecraft?
@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).
@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.
@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).
@Baconman321 The comments section chat isn't really time-efficient. If I shared the Minecraft repl with you, you wouldn't sabotage it right?
@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.
@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.
@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
@tussiez I can share it with you too if you want to check out the code.
@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!
@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.
@tussiez Yes chromebooks are slow. You are definately doing better than me on performance, especially with block destruction.
@tussiez There's so much more to do, the performance can still get much faster...
@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.
@Baconman321 Oof yeah
Especially geometry data generation
It's all math and could be done on the GPU
@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)?
@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
@tussiez Same time-zone eastern standard time. I can research webworker myself it's fine but thank you.
@tussiez XD, ok yea see u at 2-3 CST. I should make a tutorial on web workers and such...
@Baconman321 @tussiez The slownessof this comment section is killing me!! Use the chat file in the repl I shared!!
@Baconman321 That's a great idea!
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]
Wow no offense but that load time is [email protected]
Been like that for hours lol (like 2 minutes now)
@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?
@sojs World gen is amazing though
@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).
The tussiez and u one. Also I'm on a chromebook so it would be slow with features or not lol. @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).
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.
Most schools think use chromebooks now. And yes, I'm on a school [email protected]
@sojs Here is pretty cool proxy https://repl.it/@lilpeen/stuff?lite=true&outputonly=1 I didn't make it though
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.
@sojs XD school blocks anything with "proxy" in it.
hehew. ur school is tough. Hold [email protected]
@sojs Don't come to my school if u wanna learn coding. Also, it's for autistic kids so.... (ye Im autistic)
@Baconman321 I'm on a chromebook and it's a school chromebook the fps isn't that good
@BCP That's the problem we are trying to fix. We want performance to be really good.
@Baconman321 oh ok =)
@Baconman321
Well, you got more competition now.
@JRStudios4 From who?
@lilpeen Me. Another one is https://repl.it/@JRStudios4/Minecraft-JS-edition
@JRStudios4 I NEED to know how it is that fast. Also, how long did it take and what 3D rendering library are you using?
@lilpeen It uses webGl and it took about three years of coding 8 hours a day and debugging. It uses a type of cookie that helps speed up the loading process significantly. The cookie also handles storage, so that I don't have to use PHP or something to do it. PHP pauses to load, so it is a bit slower. Also, the strategy of JS that I used is a certain order that does the slowest thing first, and speeds it up. So with the cookie and the JS that it uses, the loading is shared, and ultimately sped up.
@JRStudios4 Explain the speed?
@lilpeen just did :)
@JRStudios4 I am only on my 4th month, so you just wait!
@lilpeen I am updating mine as I am typing this. It will soon have commands and mobs.
@lilpeen Updating as i'm typing. It will soon have mobs.
@JRStudios4 Can you maybe send me an MDN article or something on this cookie you speak of?
@JRStudios4 It's minekahn but you modified it, didn't you? (It says minekahn at the top)
@lilpeen A cookie is just a way of storing things in the browser on the client side.
@Baconman321 Yea I was wondering what he was talking about when he said cookie.
@JRStudios4 Did you just copy this from Khan Academy or what ._.
@lilpeen Since it's actually my project, I'll answer your question about how it's so fast.
As JR says, I am indeed using WebGL for it. I store every visible block face in 1 buffer for each chunk. The faces are stored as world coordinates so that I don't need to perform any translations or transformations on them at render time.
Textures are stored in what's called a "texture atlas", which is 1 giant texture with all the other textures arranged in a grid inside it. Then when I'm building my buffers, I pass in the coordinates of the specific block texture I want to render.
At render time, I set uniforms for the camera matrix and player position (for the fog) once at the beginning of the frame. After that, I don't touch uniforms again because they're so slow. WebGL is very interesting in that it can render millions of textured triangles per frame, but it maxes out between 1,000 and 10,000 function calls per frame. So the trick is to render as much as possible in as few draw calls as possible.
@Willard21 Thanks!
@Lushlesss In a way. The code is at least 94% different.
@JRStudios4 So, you deleted it for what reason?
@Lushlesss Hold on guys.
So it's @Willard21's project, and not @JRStudios4?
@tussiez @Willard21, after looking at the Repl, are you the original writer of MineKhan? Amazing job!
@Unzor Yea exactly stfu that is what a license is for. You do not realize your stupidity your accusations are all based off things that prove that I made it.
@Lushlesss It's not mine, my friend gave it to me, and gave me all the credit. My explanatory was just what the code looked like a lot. His name is will, so I supposed that it was a nickname he gave himself. I don't have a khan academy account.
@JRStudios4 I spoke to @Willard21, the original creator, he does not know you nor did he give you permission to claim any credit.
@jakel181 I have already explained this.
@JRStudios4 What kind of friend would just give you thousands of lines of codes and not ask to be given any credit. Way too generous of a friend in my books.
@lilpeen Woah, watch your language please. I know he swore first, but that doesn't give the excuse to swear back. At least, don't use the very vulgar words.
@Lushlesss Hey, we've known each other for almost our whole life. When I met him I had LITERALLY just turned two. (plus he's a nice guy)
@JRStudios4 You need to stop,
@jakel181 Yes. Piracy is punishable, both by repl TOS and by state/country law! @JRStudios4
@Baconman321 Ok sorry, I'll delete the comments
@Baconman321 Don't I know that?
@jakel181 Isn't that what I did when I deleted it?
@JRStudios4 Why do it though?
@Baconman321 Why do what?
@JRStudios4 Claim that the MineKhan game is yours?
@Baconman321 WHAT DID I SAY? I ALREADY EXPLAINED THIS
@JRStudios4 Huh, I didn't see an explanation. I'll look again.
From what I see, you are claiming that he "gave" the entire credit to you for his game, and you made the same game just different code. Can you verify this? Because it seems pretty skeptical right now NGL.
@JRStudios4 Look, dude. You're literally just digging yourself into a deeper hole at this point. You should either admit to copying this or keep trying to pretend to be the innocent user.
@Lushlesss I like holes! J EJE JU
@JRStudios4 Take that out of context lmao. But seriously just admit to copying the code, Joseph Romriell. 10/10 name btw
@Lushlesss Wait... what... how?
@JRStudios4 lmao magic I'm joking. You should really think twice before putting your full name in your code
@Lushlesss My full name? Oh. That was when I was operating publicly, and I got to brag to my buddy that I can code, but then covid hit, so I switched to repl. I did it. That is what I said. Are you not familiar with the ceaser cipher?
@JRStudios4 I'm confused that made no sense to me at all. You were bragging to your friend that you could code and when covid happened you switched to repl and then you said "I did it." Wdym. What did you say. Also, yes, I'm familiar with Ceaser cypher
@Lushlesss Im confusing. I know. I did it means "I plagiarized minekhan" and I asked if you know the ceaser cipher because I put it in that comment that you said to delete. The ceaser cipher part of that breaks into "I DID IT".
I just looked over this thread, @Unzor jeez with the swearing, but then saying "imagine being toxic" and you'd already dropped at least 1 F bomb and a few other curse words.
@JRStudios4 you cant say he plagiarized without any proof -_-
@dabombdgdzjr @JRStudios4 @Lushless @jackel181 @lilpeen
Sorry about the ping, but this situation escalated really quickly. Afaik, JRStudios4 plagiarized Willard21's MineKhan?
Plus, why all the swearing? I thought Repl.it was kid-friendly..
@Unzor "tuss didn't even make it" - no I didn't make @lilpeen's game, I wrote https://sortacraft-1.tussiez.repl.co
@dabombdgdzjr yes?
Ȩ̵̧̨̡̨̨̡̨̨̛̥͇͈̜̞̣̥̘͖̗̹̰̜̱̖̪͖̟͖̬̤͙̝̼̠͔̼̖̻̹̘̭̮̤͔͙͍̟̟͍̼͙͙̖͍̳̪͇̦͈͈̙͚̳̹͙̻̟͍̖̹̼̻̱̙̱͔͙͉̤̤̳͉̺͖̻͙͔̹̭̠̥͓̜̣̱̭̫̜̮̻̙͉̻̬͇̫̦͎̖̙̼̫̣̳͍̘̀͛͛́̅́͂̔̀̽̿͊̈́̓͛̎̎̄̏͌͆̏̅̀͗̀͂̚͜͜͝ͅͅͅͅE̸̢̛͚̞͙̙̱̙͓̲̺͎̻̲͎̟͔͇̦̮͉̣̻͇͂͗̔͐̈́̅̍̀͒̀͋̄̉͌̌̅̓̔̉̋̋̏̾̒́̉̎̄̄̕͘͝͠͝ͅẸ̶̢̡̢̧̨̱̙̟̳̝̣̹̣̪̮̣̱̯͙͕̭̼̦̟̝͇̞̮̦͙̻̤̣̻͕̞͉̣̪̪̬͓̠̰̪̪̦̲̲̟̱͉͉̩͓͍͕̲͔̭͚̟̼̙̬̬̳͚̮̭̤͓̟͖̮̗͈͍̜̝̗͎̤͓̱̟̭͖͉͔̩̹͇̪͇̎͆̐̄̄͜ͅͅḜ̵̛̼̤͓͔̙̰̫̩̖̫̗̳̱̩̈́̌̎̓͐̂͐̾̀̔̈͛́̈́̓̃̈́̾̀͑̇̓͌̌̈́̃̈́͊̈́̎͒͂͊̀̿̒̆̉̐̈́̔̕͘̕̚͝͠͝͝Ě̸̡̢̨̛̛̛̜̲̤̟̠̜̻̞̘̲̥̠̞̭̖̬͉͉̻̪̬̞͖͎͈̯̪̝̻̖̙̹̭̰̪̥̣̰̞̪̙̝̦̟̭̲̥͙̤̘̼̺͍͈̲͕͇̗̻͈͖͇͚̀̔̌̔̈́̋̿̃̀̐̆̍͊͐͋̂̓́̃̇͒̿̽̏̾̀͂͛͌̃̀̋͋͗̀̉̊̒͆̀̔̈́̓̊͒̀̄͌̑́͆̓̃̇́̀͊̓͌̂̑̃̏̊̓͛̄̓̓̒̂̄̾̿̀̑͑͛̉͆͛̋̉̍̌̌͗́̀̔͗̓̃̋̏̈́̈̈́͊̈́̿͗̇́͊̂̏̍͋̊̆̈́̀̀̀̈́͆̇͂͐̐̒̒͘̕͘̚͘͘̕̕̕̚͜͝͝͠͠͝͠͝ͅȨ̵̢̢̢̨̛̭̤̟̗̠̣̲̗͎̱̳̯̺̪͈̙͙̝̱̹͈̩̫̲͔̳͎͍̺̭͉̞̫̼͉̙̬̝͉͓̲̲̫͉͈͈͉̠̳̠̩̏̀̃̾̅̀͋̅͆̑̈́̈́̔͗͑̎̈͒̽̆͂̏̅͛̄͐́̈́̅͘͝͠͝͝ͅĘ̶̧̡͕͎̘̪͍̟̯͖̣̘̞̘̪̜̰̬̤̤͎͎͖̫̟̤̪͍̠̖̪̼̲͓͙͇̲̞͇̰̤͙͉͍̱̘̝͍̥̬̹͊̃͜͜͜E̸̡̧̡̨̧̧̧̧̢̧̛̛̛̛̲͍̝̼͔̝͇͕̳̳͉̯͕̙̻̹͓̬͔̫͇̻͈̗̳͔̻͍̩̮̼̯͎̙̯̙͙̝͙̰͇̯̗̺̝̥͈͉̖̖͉͔̞̘̤̱̪̪̝̰̣̯̟̟̝͎͓̝̞̳̱̤̮̲͕̜̰͌͑̏̐̉̑̈́̓̋͑͑̓̇͑̈̋̆͌͌̎̄̈́͗́̋̎̀̋̀͌͂̓͋̀̒̋̑̈́̇̂͗̍̈́̿̾̌̈̓̃̌̊͑͋̊̂̽̃̍̄̌͗̆̓̅́͐͂̃͂͗̐̎̿̄̿̍̽̐̌̅̈́̌̓̒͛̍̆̓̈́̂̓͛̏͗̏́̇̈́͊̊̾̅̓̃̓̒̂͌͆͐͐̌̈̿̅͐̎̏͘̚̕̚͘̕͘̕͘̕͜͝͝͝͠͠͠͠͝͠͠͝͝͠͝͠͝͝ͅͅͅͅĘ̸̡̢̡̨̢̡̡̡̨̢̧̨̺͈̞͈̺͇̹̙̙̗̹̞̺̼̼͕̱̺̹̩͉̩̩̗̞̭̜͔͇̠̫̤̭̻̝͕̳̭̠̹̬̱̝̭̝̭̹̝̗̦̟̭̳͕̤͚̻̮͔̗̜͚̯̼͚̯̪̣̠͓̺͖̻̤͖̣̫̥̗͉͚͍͈̳̯͎̦͚̹͖̰͉̺͕͚͈̬̟͎̪͚͖͍̜͇͖͖͕̼͕̯͙͎̹̈́̈̽̊̏̾̉́́̂̒͒̏̅̽͑̓̔̈̔̉̈͑̂̒̅̕̚̕͘͜͜͜͜ͅͅͅͅͅͅ @tussiez
@tussiez NO DON'T RESPOND MORE OR HE'LL GO "E" CRAZY
@Baconman321 AAAH
@tussiez What? Yes, I did.
@JRStudios4 uh nice ._.
@Lushlesss Thank you.
@ridark The entire website is blocked!?!
@ridark That would be kinda difficult. I would have to copy evey single one of my game files and put them in a repl.
@ridark Yea ik. I was thinking about making a new game website anyway; one that is easier to manage. I would still use other hosting because it gives me access to things like apache configuration through .htaccess
files but I might make it somehow integrated with repl so you will be able to use either.
@PyCoder01 Nice!
@PyCoder01 searches "what is ddos router"
* ** NOOOOOO! ** * xD
** YES ** ha ha
@PyCoder01
You: :)
Me: >:(
@ridark Just look up "location from ip"
@PyCoder01
NOOOOOO
@PyCoder01 i have looked into the ip logger and found something...
>:)
lets stop using this post for commenting nonsense
@PyCoder01 i just kidding, i actually deleted the ip logger thing after i created it cause i was joking too.
lets stop using this post for commenting nonsense
yes lets stop
@PyCoder01 i didn't get ur fake ip or real ip in that case
@PyCoder01 I hope you don't mean that.
If you initiate a distributed-denial-of-service against replit, you could get ip banned.
@PyCoder01 Then don't threaten them?
@ridark How?
This appears to be copied from https://notblockedgames.cf/games/minecraft-updraded.html. Can you provide an explanation as to how these two are the same?
@fuzzyastrocat Woah your right! @lilpeen I also want to know how and why those are the same
@fuzzyastrocat @3DKTH3PR0 bruh that is my website lmao
@Unzor Thank you for correcting your mistake
@fuzzyastrocat Yes, I can confirm lilpeen is the creator of both notblockedgames and this minecraft re-creation
@lilpeen Ok, just wanted to make sure that this wasn't copied.
@ridark Thank you for your feedback, I have updated the controls!
@lilpeen make sure you update the controls in the description. Its still says q for up, and e for down
@NoahJospeh this is my version: minecraft
Control: Up: Space, Down: Shift, W: Forward, A: Left, D: Right, S: Backwards (everything else is the same)
Click to use the pointer in the middle of the screen
I'm delisting this for 3 reasons.
Number one: This appears to have noted upvotes.
Number two: The code is stolen, as @minx28 said
Number three: This has an IP logger, which is against ToS
@CodeLongAndPros not delisted lol
@HahaYes Yes there was just a misunderstanding so he un-delisted it.
@HahaYes I relisted it because of some confusion and innocent until proven guilty.
If you think this is good upvote this comment.
why 32x32 anyways?
a typical minecraft chunck is 16x 16. like you can make the entire world 16 16x16 chunks by 16 16x16 chunks.
@cowboyyall10 I'm not the creator of this game, but it doesn't make a real difference, other than load time.
@cowboyyall10
Load time, we plan to expand in the future.
TRENDING!!
@JBYT27 TRENDING!!! Wow this is amazing!
THIS IS AMAZING even though your limited in this game, its shown me what you can do with this website, i think everyone should upvote and say more than just "cool."
How do you upvote anyway :) @JULIODIAZ1
I actually don’t know how to upvote
@beginner10coder click in the arrow like box at the left side of the comment
Hmm one of my friends said you copied it but I guess they were wrong. No hard feelings! Good job anyways I still made some cool stuff with program And yo I should be the one who is replying with a mean comment. Cause dude calling a 14 year old dumb is really sucky. And yes a lot of your repls have syntax errors.
@DarthVader29 Do know how many accusations of stealing this code I have gotten? Anyone, including you, would be as angry if not more angry as me. And sorry about the insulting comment. If you or anyone else has questions about the copyright of this project, contact @jakel181#3600 on discord.
LOL i love minecraft and this make me love it more its brilliant see how you can do a game so similar with your own brain
@tussiez VERY helpful.
@tussiez Not copied check the post ^
not too laggy, 5 different blocks, my only critique is the world generation...
@DominicHuieWhit
We plan to add terrain generation later.
The best Minecraft copy I have EVER seen
When will the RTX feature come?
@Bookie0 The irregularaties are just ThreeJS drawing things at low quality. I'll find out how to get rid of them. Also sorry about the error I was probably working on something.
@Bookie0 Kind of fixed the irregularities.
@Bookie0 If you want the technical explanation, this is because your display doesn't have a high pixel density. This means you can see the individual pixels on your screen, and that's why it looks like diagonal lines drawn have jagged edges. One fix for this that I think @lilpeen has applied is Anti-Aliasing, which interpolates the jagged lines and adds a "blur" so these edges are less visible.
@Bookie0 Not copied check the post ^
@Bookie0 From the post, do you understand that this was not copied?
@Bookie0 Bruh go look at the website, I updated it to say I am the creator. Did you even follow the directions?
@Bookie0 Did you not see this in the post?
To everybody that is saying it was copied from https://notblockedgames.cf
It was not copied, that is my website and you can check the website yourself in the updates section. In fact, the game is embedded with an iFrame pointing to this exact repl.
I've been trying to make a minecraft of my own, and was wondering how you calculated what block to break.
@msgaalex So basically, I use a raycaster (in ThreeJS) and mark the interception point of the first target on the x axis.
const raycaster = new THREE.Raycaster();
raycaster.setFromCamera({x: 0, y: 0}, camera);
const targets = raycaster.intersectObjects(scene.children);
targets
is an array containing all of the intercepted objects. We only need the first target (target[0]
). Lets say the x interception point is 43.8. I divide that by the block size, lets say 20. It evaluates to 2.19. Truncate that (remove the decimals), and you have 2. That is the x block the raycaster just intercepted. Repeat for the y and z axes and you have the x, y and z coordinates for the block the player just clicked.
@msgaalex Not copied check the post ^
thanks, its a good game my friend.
Faulty, It's saying "replit.com refused to connect.
@chinthalapati That is a repl iframe problem. I don't know why they block their own sites but use this URL instead: https://minecraft.repl-account.repl.co/
Cool!
How did you make Javascript render this many polygons without lagging? Whenever I try to render more than like a thousand on the HTML Canvas, my computer starts dying.
@KittyCraft0 I use ThreeJS to handle all the 3d stuff and instead of using cubes I use planes and arrange them to form cubes. This means I can program it to only create faces where visible, and not inside blocks. Creating many faces on the inside of blocks may be the cause of your lag.
i reenforced my bedrock walls four times
cannot work
@CallumYiu Here is the link: https://Minecraft.repl-account.repl.co
. Also, you need to wait a few seconds for it to load, and the screen will be black during that period.
cool
This (on notblockedgames.cf) is illegal. You have to give an option to opt out of cookies.

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.
@minx28 Yikes
@minx28 Added an opt-out option, and no, I am not actually logging the IPs that I get.
@DarthVader29 @lilpeen
DarthVader29, I'm the SortaCraft dev and no, this is not my game.
@minx28 huh it doesnt for me, F12, ctrl + shift + i, all work