Skip to content

Standalone Minecraft-style voxel demo (single HTML + generator)#3

Open
hzsw1234 wants to merge 1 commit into
mainfrom
cursor/minecraft-game-clone-f7cb
Open

Standalone Minecraft-style voxel demo (single HTML + generator)#3
hzsw1234 wants to merge 1 commit into
mainfrom
cursor/minecraft-game-clone-f7cb

Conversation

@hzsw1234

Copy link
Copy Markdown
Owner

Summary

Adds a standalone single-file voxel sandbox at the repo root: minecraft-clone.html. It is not wired into existing static pages; open the file in a browser (with network for the Three.js import map CDN).

Contents

  • minecraft-clone.html (~3960 lines): Three.js module game — procedural terrain (2D/3D noise, biomes, height table), caves, ores, trees, rare ruin pillars + crafting table, merged chunk meshes with atlas UVs, day/night sky and fog, zombies/skeletons/spiders/creepers (colored boxes), mining/placing, hotbar, hunger/health, particles, respawn.
  • tools/generate_minecraft_clone.py: Regenerates the large embedded data sections (biome LUT, ore depth weights, sky stops, spawn weights, decoration rules, structure offsets, crafting recipes, block defs, drop table) plus the engine source, then splices into HTML if the marker /* ==== MC_CLONE_CHUNK_MARKER_START ==== */ is present in a template. The committed HTML is already fully expanded so the script is optional for edits.

Fixes applied in the shipped HTML

  • Texture UVs span full 16×16 atlas cells (was 1px quads).
  • Chunk neighbor rebuild only when the adjacent chunk exists and is generated.
  • world.updateAround before spawn so ground query sees terrain.
  • Melee uses look direction vs. horizontal vector to mob (no bogus keys.Mouse0).

How to run

Serve the file or open via file:// (import map may require a local server depending on browser). Example: python3 -m http.server in the repo root, then open /minecraft-clone.html.

Open in Web Open in Cursor 

Single-file demo with procedural terrain, biomes, caves, trees, ruins,
chunk meshes, day/night cycle, mobs, combat, mining/placing, hotbar, and
data-driven tables. Python generator expands meaningful lookup tables;
HTML exceeds 3000 lines. Fix UV mapping, chunk border rebuilds, spawn
chunk loading, and melee hit detection.

Co-authored-by: hzsw1234 <hzsw1234@users.noreply.github.com>
@cursor

cursor Bot commented Mar 23, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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