Skip to main content

Overview

Minecraft Web Client includes a fully integrated JavaScript server (based on Flying Squid) that runs entirely in your browser. This enables true singleplayer gameplay with world generation, saving, and all the features you’d expect from a local Minecraft server.
Your singleplayer worlds run completely in your browser - no external server required!

Creating a New World

There are multiple ways to start a singleplayer world:
Use the ?singleplayer=1 or ?sp=1 query parameter to create an empty world instantly:
https://mcraft.fun/?singleplayer=1
Worlds created this way are not saved automatically. Use /export to download your progress.

World Generation

The integrated local server provides basic world generation capabilities:
  • Flat terrain generation - Simple world generation for quick building
  • Custom world types - Support for different generator options
  • Chunk loading - Generates new chunks as you explore
World generation is simpler than vanilla Minecraft. Complex terrain features may generate differently.

Generation Limitations

// From src/mcTypes.ts - World generation configuration
interface LevelDat {
  generatorName?: string;
  generatorVersion?: number;
  generatorOptions?: string;
  // ...
}
New chunks may be generated with basic terrain. For complex worlds, it’s recommended to:
  1. Import existing world files
  2. Stay within pre-generated areas
  3. Use /export frequently to backup progress

The Local Server

The integrated server is a full implementation that:
  • Runs entirely in JavaScript (via Flying Squid)
  • Handles all game logic server-side
  • Manages world data and persistence
  • Supports multiplayer via P2P (see P2P Multiplayer)
// From src/createLocalServer.ts
export const startLocalServer = (serverOptions) => {
  const passOptions = { ...serverOptions, Server: LocalServer }
  const server = createMCServer(passOptions)
  server.formatMessage = (message) => `[server] ${message}`
  return server
}

Unsupported Features

Some features are not available in the local server:
The following features are not supported:
  • Transaction packet handling
  • Some advanced teleport mechanics

Saving Your World

Worlds can be saved in multiple ways:

Automatic Saving

By default, worlds are saved:
  • On a regular interval during gameplay
  • When you disconnect from the world
  • When you close the browser (if supported)
// Worlds are saved to browser memory
// From src/builtinCommands.ts
command: ['/save'],
async invoke () {
  await saveServer(false)
  writeText('Saved to browser memory')
}

Manual Saving

Use the /save command in chat to manually save your world:
/save
You’ll see a confirmation message: “Saved to browser memory”

Disable Auto-Save

To prevent automatic saving (useful for testing), use the ?noSave=true parameter:
https://mcraft.fun/?singleplayer=1&noSave=true
With noSave=true, only manual /save commands will persist your world!

Exporting Worlds

Export your world to download it as a ZIP file:
1

Save Your World

First, ensure your world is saved:
/save
2

Export Command

Use either command to export:
/export
or
/download
3

Download

Your browser will download a ZIP file named world-prismarine-exported.zip containing:
  • level.dat - World metadata
  • region/ - All region files with terrain data
  • playerdata/ - Player data files
  • All other world files
// Export implementation from src/builtinCommands.ts
export const exportWorld = async (path: string, type: 'zip' | 'folder', zipName = 'world-prismarine-exported') => {
  if (type === 'zip') {
    setLoadingScreenStatus('Generating zip, this may take a few minutes')
    const zip = new JSZip()
    await addFolderToZip(path, zip, '')
    const zipContent = await zip.generateAsync({ type: 'blob' })
    
    const downloadLink = document.createElement('a')
    downloadLink.href = URL.createObjectURL(zipContent)
    downloadLink.download = `${zipName}.zip`
    downloadLink.click()
  }
}
Large worlds may take several minutes to export. Don’t close the browser while exporting!

Server Configuration

Advanced users can configure the local server with query parameters:

Server Settings

Use ?serverSetting=<key>:<value> to configure server options:
?serverSetting=noInitialChunksSend:true
This disables initial chunk loading on the loading screen.
Server settings are defined in the Flying Squid module options. See the Space Squid repository for available options.

Gameplay Modes

Switch between game modes using F3+F4 or the /gamemode command:

Creative

Full flying, instant breaking, unlimited resources

Survival

Standard gameplay with health and hunger

Adventure

Limited block breaking, good for custom maps

Spectator

Fly through blocks, observe without interaction
// Cycle through game modes with F3+F4
// From src/controls.ts:702
nextGameMode = 'creative' | 'survival' | 'adventure' | 'spectator'
bot.chat(`/gamemode ${nextGameMode}`)

World Data Access

For debugging and advanced usage, access world data via the browser console:
// Access the local server instance
localServer

// View loaded region files
localServer.overworld.storageProvider.regions

// Change world name
localServer.levelData.LevelName = 'My World'
localServer.writeLevelDat()
See Global Variables for more console commands.

Best Practices

Export your world frequently using /export. Browser data can be cleared accidentally, so keep offline backups!
Stick to first-class versions (1.19.4, 1.21.4) for the most stable experience.
Large worlds consume browser memory. If you experience lag:
  • Limit exploration to reduce loaded chunks
  • Export and reload to clear memory
  • Use smaller render distances
Worlds created in the web client can be exported and used in:
  • Vanilla Minecraft Java Edition
  • Other Minecraft servers (with compatible versions)
  • Imported back into the web client later

Troubleshooting

level.dat not found: Ensure you’re loading a valid world folder containing level.dat
Version mismatch: If your world is from an unsupported version, you’ll be prompted to select a compatible version. Choose the closest supported version.
World generation issues: If new chunks appear broken, reload chunks with F3+A or export and reimport the world.

Build docs developers (and LLMs) love