A Minecraft-style voxel survival game that runs in the browser from one HTML file. No build step, no bundler, no server required: open index.html and play.
Built with Three.js (r128) and JSZip, both loaded from cdnjs. Everything else, including the noise functions, meshing, lighting, physics, textures and UI, is written from scratch inside index.html.
-
Simplest: double-click
index.html. Chrome, Edge and Firefox all work. -
With a resource pack that loads automatically: serve the folder over HTTP and drop a pack next to the page as
resourcepack.zip:python3 -m http.server 8765 # then open http://127.0.0.1:8765/index.htmlPacks can also be dragged onto the title screen or loaded from the pause menu at any time, including when the file is opened directly from disk.
World
- Chunked voxel world (16x128x16 chunks), streamed around the player, configurable render distance.
- Greedy meshing with per-face culling, ambient occlusion and smooth lighting, drawn with a custom atlas shader.
- Procedural terrain from inline simplex noise: ten biomes (plains, forest, birch forest, desert, mountains, snowy tundra, taiga, beach, ocean, deep ocean), rolling hills and ridged mountains, 3D-noise caves, ravines, depth-banded ore veins, bedrock, lava pools, oak/birch/spruce trees, flowers, tall grass, cacti, pumpkins.
- Generated structures: dungeons with monster spawners and loot chests, ruined portals.
Lighting and environment
- Separate sky-light and block-light propagation with incremental updates.
- Day/night cycle with sun, moon and stars; rain and snow by biome.
- Flowing water and lava (source/flow levels, infinite water, obsidian and cobblestone generation), fire spread, falling sand and gravel.
Gameplay
- Survival and creative modes (
Gto switch). Health, hunger, drowning, fire, lava and fall damage, respawn. - Mining with break-progress cracks, tool tiers and durability, block drops that bob and are picked up on contact.
- Full inventory with 2x2 crafting, crafting table (3x3, 60+ recipes), furnace (fuel, smelting, cooking), chests, doors, ladders, torches, buckets, hoes and farming with crop growth stages.
- Redstone basics: wire with signal falloff, redstone torches, levers, redstone lamps, doors, TNT.
- Passive mobs (pig, cow, sheep, chicken; sheep can be sheared) and hostile mobs (zombie, skeleton, creeper) that spawn in darkness, chase, shoot or explode, and burn in daylight. Melee and bow combat with knockback.
- Autosave to localStorage (deflated), plus JSON export and import. Worlds are reproducible from their seed.
Resource packs
- Loads standard Minecraft Java resource packs (
.zip). Block and item textures are matched by vanilla file name; 16x, 32x and 64x packs are handled; animated textures use their first frame; OptiFine/MCPatcher assets and.mcmetafiles are ignored; legacy (1.12) names are aliased. - Anything a pack does not provide falls back to procedurally generated 16x16 pixel art, so the game is fully playable with zero external files.
| Key | Action |
|---|---|
W A S D / mouse |
Move / look |
Space, Shift, Ctrl |
Jump or swim, sneak, sprint |
Double-tap Space |
Toggle flying (creative) |
| Left / right click | Mine or attack / place, use, eat |
1-9, scroll |
Select hotbar slot |
E, Q, F |
Inventory, drop item, pick block (creative) |
G, T, R, F3 |
Toggle mode, skip to morning, toggle weather, debug overlay |
Esc |
Pause menu, release the mouse |
Right-click crafting tables, furnaces, chests, doors and levers to use them. Flint and steel ignites TNT.
index.html is organised as numbered systems, each under a ==== banner, so it can be read top to bottom:
- Utilities (constants, seeded PRNG, simplex noise)
- Block and item registries
- Recipes
- Procedural textures
- Texture atlas and resource-pack loader
- World storage and the block-change pipeline
- Terrain generation
- Lighting engine
- Meshing (shader, greedy mesher, block models)
- Chunk manager
- Physics, input, player
- Interaction (raycast, mining, placing, using)
- Inventory and container screens
- Entities (drops, arrows, TNT, particles, explosions)
- Mobs
- Simulation (fluids, fire, random ticks, redstone)
- Sky and weather
- HUD, persistence, menus
- Bootstrap and main loop
Unfinished or simplified features are marked in the code with // STUB:; the full list is at the bottom of the script. Highlights of what is not there yet: the Nether and the End, villages and mineshafts, villager trading, enchanting and brewing, redstone repeaters and pistons, mob textures from resource packs, audio.
- Resource packs are not included. Most packs, including New Default+, carry their own licenses; download them yourself and place the zip next to
index.htmlasresourcepack.zip(it is git-ignored). - Voxelcraft is an independent project. "Minecraft" is a trademark of Mojang Studios / Microsoft; this project is not affiliated with or endorsed by them.
