🏠
Home
🎨
Creative
🧮
Calculation
🖥️
Server
Dashboard

Minecraft Java Edition Level Format Tutorial

Complete guide to Minecraft Java Edition level format structure. Each level is its own folder identified by a level.dat file, along with subfolders storing maps and regions. Learn NBT data structures, directory organization, and world save mechanics for developers and technical players 🗂️


🗂️ Understanding Minecraft Level Format Structure

Minecraft Java Edition stores world data using a sophisticated directory structure in .minecraft/saves/. Each level is its own folder identified by a level.dat file, containing NBT-formatted global information, along with specialized subfolders for regions, player data, statistics, and dimension-specific content. This exclusive Java Edition feature enables advanced world manipulation and technical understanding.

🗂️

Complete Directory Structure

Explore every folder and file in Minecraft world saves

⚙️

NBT Data Analysis

Understand Named Binary Tag format and world storage

🌍

Multi-Dimension Support

Learn how Overworld, Nether, and End data is organized

🔧

Developer Resources

Essential knowledge for mod development and world editing

📁 Interactive World Directory Structure

Explore the complete file structure of Minecraft world saves located in .minecraft/saves/

World Root Directory (.minecraft/saves/WorldName/)

📂
📄
level.dat Stores global information about the level (NBT format)
📄
level.dat_new Program writes new global information, then renamed to level.dat
📄
level.dat_old Backup of the previous level.dat file
📄
session.lock Used to give write access to last program to modify this file
📁
playerdata/ Individual player states (UUID.dat files, since 1.7.6)
📁
stats/ Player statistics (UUID.json files, since 1.7.2)
📁
advancements/ Player advancements and recipes (UUID.json files, since 17w13a)
📁
data/ Miscellaneous world data files
📁
region/ Overworld region files (r.x.z.mca format)
📁
entities/ Overworld entity files (separated from region data)
📁
poi/ Points of Interest (beds, job sites, bells, portals, etc.)
📁
datapacks/ World-specific data packs
📄
resources.zip Resource pack applied when the world loads

Data Folder Contents (data/)

📂
📄
command_storage_<namespace>.dat General purpose key/value command storage (since 19w38a)
📄
chunks.dat Unknown purpose
📄
idcounts.dat Information about latest number of maps
📄
map_<#>.dat Information about contents of individual maps
📄
raids.dat Information about ongoing raids in Overworld
📄
random_sequences.dat Random number sequences for loot tables and /random command
📄
scoreboard.dat Scoreboard data: objectives, scores, teams, display slots

Dimension Folders

📂
📁
DIM-1/ The Nether dimension (contains region/, entities/, poi/, data/)
📄
DIM-1/data/raids_nether.dat Information about ongoing raids in the Nether
📁
DIM1/ The End dimension (contains region/, entities/, poi/, data/)
📄
DIM1/data/raids_end.dat Information about ongoing raids in the End
📁
dimensions/ Non-vanilla dimensions added by data packs or mods
📁
dimensions/<namespace>/<path>/ Custom dimension folders with namespace and path structure
📄
dimensions/<namespace>/<path>/data/raids.dat Raid information for custom dimensions

Deprecated Files (Legacy Versions)

📂
📄
level.dat_mcr Backup before conversion from MCRegion to Anvil format
📁
players/ Player data storage (before 1.7.6, replaced by playerdata/)
📄
data/villages.dat Village information (replaced by POI region files in 1.14)
📄
data/villages_nether.dat Nether village data (added in 1.8, deprecated in 1.14)
📄
data/villages_end.dat End village data (added in 1.8, deprecated in 1.14)
📄
r.#.#.mcr MCRegion format files (before Anvil conversion)
📄
c.#.#.dat Alpha level format chunks (before MCRegion conversion)

⚙️ Level.dat File Structure Analysis

The level.dat file contains global world information using NBT (Named Binary Tag) format. This is the master configuration file for your Minecraft world.

📋 NBT Structure Overview

{
    "": {                    // Root compound tag
        "Data": {            // Main data container
            "LevelName": "My World",
            "version": 19133,
            "DataVersion": 3465,
            "RandomSeed": -1234567890,
            "SpawnX": 0,
            "SpawnY": 64,
            "SpawnZ": 0,
            "Time": 1000L,
            "DayTime": 1000L,
            // ... hundreds more fields
        }
    }
}

Basic World Information

6 fields ⚙️
LevelName String

The name of the level as displayed in world selection

version Int

NBT version of the level, 19133 for Anvil format (1.2.1+)

DataVersion Int

Integer displaying the data version

RandomSeed Long

Random level seed used to generate consistent terrain

initialized Boolean

True after world has been properly initialized after creation

SizeOnDisk Long

Estimated size in bytes of the level (legacy field)

Gameplay & Difficulty Settings

6 fields ⚙️
GameType Int

Default game mode: 0=Survival, 1=Creative, 2=Adventure, 3=Spectator

Difficulty Byte

Current difficulty: 0=Peaceful, 1=Easy, 2=Normal, 3=Hard (defaults to 2)

DifficultyLocked Boolean

True if difficulty has been locked (defaults to false)

hardcore Boolean

If true, player respawns in Spectator on death in singleplayer

allowCommands Boolean

1 or 0 (true/false) - true if cheats are enabled

MapFeatures Boolean

True if structures (villages, strongholds, mineshafts) should generate

Time & Weather System

8 fields ⚙️
Time Long

Number of ticks since the start of the level

DayTime Long

Time of day: 0=sunrise, 6000=midday, 12000=sunset, 18000=midnight, continues past 24000

LastPlayed Long

Unix time in milliseconds when level was last loaded

raining Boolean

True if level is currently experiencing rain, snow, and cloud cover

rainTime Int

Number of ticks before "raining" is toggled

thundering Boolean

True if rain/snow is a lightning storm (only if raining is true)

thunderTime Int

Number of ticks before "thundering" is toggled

clearWeatherTime Int

Number of ticks until "clear weather" has ended

World Border Configuration

9 fields ⚙️
BorderCenterX Double

Center of world border on X coordinate (defaults to 0)

BorderCenterZ Double

Center of world border on Z coordinate (defaults to 0)

BorderSize Double

Width and length of world border (defaults to 60000000)

BorderSafeZone Double

Safe zone distance from border (defaults to 5)

BorderSizeLerpTarget Double

Target size for border transition (defaults to 60000000)

BorderSizeLerpTime Long

Time for border size transition (defaults to 0)

BorderDamagePerBlock Double

Damage dealt per block outside border (defaults to 0.2)

BorderWarningBlocks Double

Distance to show border warning (defaults to 5)

BorderWarningTime Double

Time to show border warning (defaults to 15)

Spawn Point & Location

3 fields ⚙️
SpawnX Int

X coordinate of the world spawn point

SpawnY Int

Y coordinate of the world spawn point

SpawnZ Int

Z coordinate of the world spawn point

Advanced Data Structures

8 fields ⚙️
DataPacks Compound

Options for data packs with Enabled and Disabled arrays

GameRules Compound

The gamerules used in the world (all values stored as strings)

CustomBossEvents Compound

Collection of custom boss bars with their properties

DimensionData Compound

Level data specific to dimensions (End dragon fight, etc.)

WorldGenSettings Compound

Generation settings for each dimension (used in 1.16+)

Player Compound

State of singleplayer player (overrides UUID.dat file)

WanderingTraderId Int Array

UUID of current wandering trader saved as four ints

Version Compound

Information about Minecraft version world was saved in

🗺️ Region File System (Anvil Format)

Region files (.mca) use the Anvil format to store 32×32 chunks of world data. Each region contains terrain, entities, and block data.

📍 File Naming Convention

Region files follow the pattern r.x.z.mca where:

  • r - Indicates region file
  • x - Region X coordinate
  • z - Region Z coordinate
  • .mca - Anvil format extension
Example: r.0.0.mca covers chunks 0-31 in both X and Z directions

🏗️ Chunk Organization

Each region file contains up to 1,024 chunks (32×32):

  • Chunk coordinates within region: 0-31
  • World chunk coordinates: region * 32 + local
  • Each chunk covers 16×16 blocks
  • Height ranges from Y=-64 to Y=319
Calculation: Chunk at region (1,1) local (5,10) = World chunk (37,42)

💾 Data Storage

Region files store compressed chunk data:

  • Compression: Zlib or Gzip
  • Format: NBT compound structures
  • Contains: Blocks, biomes, entities, tile entities
  • Lighting: Block light and sky light data
Size: Typical region file ranges from 100KB to 10MB

🧮 Coordinate Calculator

Calculate region and chunk coordinates:

Chunk: 0, 0
Region: r.0.0.mca
Local Chunk: 0, 0

🌌 Multi-Dimension Architecture

Minecraft supports multiple dimensions, each with their own data folders and unique characteristics.

🌍

Overworld

Folder: World root directory

ID: minecraft:overworld

Features: Full terrain generation, villages, structures

Height: Y=-64 to Y=319

region/ entities/ poi/ data/
🔥

The Nether

Folder: DIM-1/

ID: minecraft:the_nether

Features: Nether terrain, fortresses, bastions

Height: Y=0 to Y=127

DIM-1/region/ DIM-1/entities/ DIM-1/poi/
🌟

The End

Folder: DIM1/

ID: minecraft:the_end

Features: End islands, cities, dragon fight

Height: Y=0 to Y=255

DIM1/region/ DIM1/entities/ DIM1/poi/
🔮

Custom Dimensions

Folder: dimensions/namespace/path/

ID: Custom namespace:path

Features: Datapack or mod defined

Height: Configurable

dimensions/

🔐 Session Lock Format

The session.lock file prevents multiple programs from accessing the same world simultaneously.

📄 File Content

Contains a single character:

U+2603 ☃ SNOWMAN
Encoded as (E2 98 83) in UTF-8

Before 1.16: Contained a big-endian 64-bit integer timestamp

⚡ Lock Process

  1. Program opens session.lock
  2. Writes snowman character (\u2603)
  3. Tries to acquire file lock
  4. If lock fails, program aborts
  5. Program continues with world access

⚠️ Important Notes

  • Prevents world corruption from concurrent access
  • Close Minecraft before external world editing
  • May cause issues if Minecraft crashes
  • Delete session.lock if world won't load
  • Older versions used timestamp monitoring

📍 Point of Interest (POI) Format

POI files store villager workstations, beds, and other important locations using Anvil-like .mca files.

📊 POI File Structure

{
    "": {                           // Root compound
        "Data": {                   // Main data container
            "Sections": {           // Chunk sections by Y coordinate
                "2": {              // Section Y=2 (blocks Y=32-47)
                    "Valid": 1,     // true when properly loaded
                    "Records": [    // Array of POI records
                        {
                            "pos": [100, 64, 200],    // X, Y, Z coordinates
                            "type": "minecraft:bed",   // POI type
                            "free_tickets": 1          // Available tickets
                        }
                    ]
                }
            },
            "DataVersion": 3465        // Data format version
        }
    }
}

🏠 Villager POI Types

  • minecraft:armorer - Blast furnace
  • minecraft:butcher - Smoker
  • minecraft:cartographer - Cartography table
  • minecraft:cleric - Brewing stand
  • minecraft:farmer - Composter
  • minecraft:fisherman - Barrel
  • minecraft:fletcher - Fletching table
  • minecraft:leatherworker - Cauldron
  • minecraft:librarian - Lectern
  • minecraft:mason - Stonecutter
  • minecraft:shepherd - Loom
  • minecraft:toolsmith - Smithing table
  • minecraft:weaponsmith - Grindstone

🏘️ Special POI Types

  • minecraft:home - Villager beds (ticket limit: 1)
  • minecraft:meeting - Village bells (ticket limit: 32)
  • minecraft:beehive - Bee nests/hives (ticket limit: 0)
  • minecraft:nether_portal - Portal blocks (ticket limit: 0)
  • minecraft:lightning_rod - Lightning rods (ticket limit: 0)
  • minecraft:lodestone - Lodestone blocks (ticket limit: 0)

🎫 Ticket System

free_tickets indicates availability:

  • 0 - No villagers can claim this POI
  • 1 - One villager can use (most job sites)
  • 32 - Multiple villagers can use (bells only)

Non-villager POI types (beehives, portals) always have free_tickets = 0

📐 Coordinate System

POI coordinates are stored as:

  • pos: [X, Y, Z] - Exact block coordinates
  • Sections: Organized by chunk section Y coordinate
  • Y coordinate calculation: Section Y=2 covers blocks Y=32 to Y=47
  • File organization: Similar to region files (r.x.z.mca)

🛠️ Level Format Tools & Resources

Essential tools and resources for working with Minecraft world saves and level data.

🔍

NBT Editors

View and modify NBT data structures:

  • NBTExplorer (Windows/Mac/Linux)
  • NBT Studio (Cross-platform)
  • Online NBT Viewers
  • Programming Libraries (Python, Java, JS)
🗺️

World Editors

Advanced world manipulation tools:

  • WorldEdit (In-game editing)
  • MCEdit (External world editor)
  • Amulet Map Editor
  • Custom scripts and programs
📊

Analysis Tools

Understand and analyze world data:

  • Chunk boundaries visualization
  • Region file analyzers
  • Performance profilers
  • Backup and migration tools
💻

Development APIs

Programming interfaces and libraries:

  • Minecraft Forge modding
  • Fabric mod development
  • Bukkit/Spigot/Paper plugins
  • NBT parsing libraries

📚 Practical Applications & Use Cases

🖥️ Server Administration

  • World backup and restoration strategies
  • Player data management and recovery
  • World border and spawn point configuration
  • Performance optimization through chunk analysis
  • Migration between server platforms

🔨 Mod Development

  • Custom world generation algorithms
  • New dimension creation and management
  • Save data compatibility across versions
  • NBT data structure manipulation
  • Chunk loading and generation hooks

🎨 Map Making

  • Adventure map creation and distribution
  • Custom terrain and structure placement
  • Player progression tracking systems
  • World configuration for specific gameplay
  • Multi-dimensional puzzle design

🔬 Data Analysis

  • Player behavior and activity tracking
  • World generation pattern analysis
  • Resource distribution studies
  • Performance bottleneck identification
  • Save file corruption diagnosis

⚠️ Safety & Best Practices

🚨

Critical Safety Rules

  • Always backup worlds before any editing
  • Close Minecraft completely before external editing
  • Verify file integrity after modifications
  • Test in copies never edit originals directly
  • Use compatible tools for your Minecraft version
💡

Professional Tips

  • Use version control systems for large projects
  • Document changes and modifications thoroughly
  • Keep multiple backup generations
  • Test modifications in development worlds first
  • Monitor world size and performance after changes
🔄

Version Compatibility

  • Level format changes between major versions
  • NBT structure evolution over time
  • Tool compatibility with current format
  • Migration strategies for version upgrades
  • Backup compatibility verification