A performant Minecraft-like voxel world built with React, Three.js, and Vite.
- Infinite, procedurally generated world using web workers
- Greedy meshing for efficient rendering
- Physics with cannon-es and @react-three/cannon
- Block placement, removal, and inventory system
- Hotbar, main menu, pause menu, and debug HUD
- Optimized for smooth gameplay in the browser
- Game data (worlds, player state) saved in browser localStorage
- React 19 + TypeScript
- Vite (build tool)
- Three.js (3D rendering)
- @react-three/fiber, @react-three/drei (React bindings for Three.js)
- Zustand (state management)
- cannon-es (physics)
- Node.js (v18 or newer recommended)
- npm or yarn
Clone the repository and install dependencies:
git clone <your-repo-url>
cd minecraft-clone
npm install
# or
yarn installStart the development server:
npm run dev
# or
yarn devOpen the local URL shown in your terminal (usually http://localhost:5173).
npm run build
# or
yarn buildThe output will be in the dist/ folder.
npm run lint
# or
yarn lint- Push your code to GitHub, GitLab, or Bitbucket.
- Go to Vercel, import your repository, and follow the prompts.
- Vercel will auto-detect Vite and set up the correct build settings.
- No backend or database setup is required—game data is saved in the user's browser.
src/— Main source codecomponents/— UI and game components (world, player, menus, etc.)systems/— World generation, chunk management, texture atlasworkers/— Web workers for chunk generation and meshinghooks/— Custom React hooksstores/— Zustand state storestypes/— TypeScript typesutils/— Utility functions
All game data (such as saved worlds and player state) is stored in the browser's localStorage under the key minecraft-clone-storage. This means data is local to each browser and device, and is not synced online.
- Inspired by Minecraft by Mojang
- Built with open-source libraries: React, Three.js, Vite, Zustand, cannon-es, and more
Feel free to open issues or contribute!