Skip to content

Add BlockCraft: browser-based Minecraft clone built with three.js#8

Draft
ilikevibecoding wants to merge 4 commits into
mainfrom
cursor/minecraft-clone-0dfa
Draft

Add BlockCraft: browser-based Minecraft clone built with three.js#8
ilikevibecoding wants to merge 4 commits into
mainfrom
cursor/minecraft-clone-0dfa

Conversation

@ilikevibecoding

@ilikevibecoding ilikevibecoding commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

Adds minecraft/BlockCraft, a Minecraft-style voxel sandbox that runs entirely in the browser with no build step and no binary assets (textures, sounds, and the sky are all generated procedurally at runtime).

Spawn view with snowy mountains, trees and a sea channel

Features

  • Infinite procedural terrain streamed in 16×16×96 chunks around the player: hills, mountains, deserts, snow biomes, beaches, seas and lakes
  • Caves carved with 3D value noise, plus coal/iron ore deposits
  • Trees that generate deterministically across chunk borders
  • Block breaking/placing with a 9-slot hotbar (1–9 keys, mouse wheel, middle-click pick), block highlight outline and breaking particles
  • Lighting: per-vertex ambient occlusion, per-face shading and depth-based cave darkness
  • Day/night cycle with a square sun and moon, stars, drifting blocky clouds and dawn/dusk fog tinting
  • Physics: AABB collision, jumping, swimming with underwater fog, Minecraft-style climb-out-of-water assist, and a creative fly mode (F)
  • Persistence: block edits saved to localStorage per world seed (?seed=... supported); pause menu offers "New world" and "Reset changes"
  • Procedural audio for break/place/splash via WebAudio
Building Night Underwater
Placed cobblestone block Night sky with stars Underwater fog over a sandy seafloor

Performance / smoothness work

  • Chunk generation/meshing is time-budgeted per frame (~6 ms) so terrain streaming never tanks the frame rate
  • Pooled typed-array mesh builders — chunk rebuilds no longer allocate millions of array slots, eliminating GC hitches while flying/building
  • GPU upload pre-warm — fresh chunk meshes render un-culled for one frame so their buffers upload at build time instead of causing a hitch the first time the camera turns toward them
  • Far-chunk disposal is spread over multiple frames; edit-log saves to localStorage run via requestIdleCallback
  • Pointer lock uses unadjustedMovement (raw input, no OS mouse acceleration) plus movement-spike filtering
  • Measured while flying across entirely fresh terrain in headless Chromium/SwiftShader: world streaming costs p50 0.2 ms, p99 10 ms per frame on software rendering (a few ms worst-case on a real GPU)

Tech notes

  • three.js r165 vendored in minecraft/vendor/ (pinned version, works offline)
  • One opaque + one translucent mesh per chunk, built with face culling, AO and a canvas-painted texture atlas (with edge-replicated gutters to prevent MSAA bleed)
  • Seeded 2D simplex noise for terrain/biomes, 3D value noise for caves, Amanatides–Woo DDA for voxel raycasting
  • The GitHub Pages workflow now also publishes minecraft/, so the game will be live at /minecraft/ after merge

Testing

  • All modules pass node --check
  • Verified end-to-end in headless Chromium (SwiftShader): zero console errors, pointer lock, walking/jumping (lands exactly on block tops), flying, swimming, climbing out of water onto a shoreline block, block break/place recorded in the edit log, day/night cycle and underwater rendering

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Co-authored-by: ilikevibecoding <ilikevibecoding@users.noreply.github.com>
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
my-projects Ready Ready Preview, Comment Jun 9, 2026 7:40pm
my-projects-kf1f Ready Ready Preview, Comment Jun 9, 2026 7:40pm

Co-authored-by: ilikevibecoding <ilikevibecoding@users.noreply.github.com>
…to blocks

Co-authored-by: ilikevibecoding <ilikevibecoding@users.noreply.github.com>
…rottled unloads, idle saves

Co-authored-by: ilikevibecoding <ilikevibecoding@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants