Chunk format – Minecraft Wiki (original) (raw)

This article needs to be updated.

Please update this page to reflect recent updates or newly available information.
Reason: missing information about 1.18 formats, this page is W.I.P. and sections that are updated for 1.18 mention it.

For the storage format of entities, see Entity format.

Chunks store the terrain and entities within a 16×384×16 area in The Overworld, and 16×256×16 in The Nether and The End by default. They also store precomputed lighting, heightmap data for Minecraft's performance, and other meta information.

NBT structure[edit | edit source]

Chunks are stored as tags in regional Minecraft Anvil files, which are named in the form r.x.z.mca. They are stored in NBT format, with the following structure (updated for 1.18):

Block format[edit | edit source]

In the Anvil format, block positions are ordered YZX for compression purposes.

The coordinate system is as follows:

This means indices are ordered like in a book, with its top to the North, read from beneath and with words written backward: each letter is a different X-index, each line a Z-index, and each page a Y-index. In case of a flat 2D array, the Y-index is omitted, and the array reads like a single page.

Each section is a 16×16×16-block area, with up to 16 sections in a chunk : from 0 at the bottom, to 15 on top. Empty sections are not saved. Each section has a "Y" byte for its Y-index (0 to 15), a "Palette" list linking IDs to block states, and a "BlockStates" long array storing the IDs per block location, compressed by fitting multiple IDs inside each entry (see NBT_structure above for details on the compression). There might be an additional section at the top and or bottom of the world used to store light, so that light travels properly over and under the world limits.

The pseudo-code below shows how to access individual block information from a single section.

byte Nibble4(byte[] arr, int index){ return index%2 == 0 ? arr[index/2]&0x0F : (arr[index/2]>>4)&0x0F; } int BlockPos = y1616 + z*16 + x; compound Block = Palette[change_array_element_size(BlockStates,Log2(length(Palette)))[BlockPos]]; string BlockName = Block.Name; compound BlockState = Block.Properties; byte Blocklight = Nibble4(BlockLight, BlockPos); byte Skylight = Nibble4(SkyLight, BlockPos);

Block entity format[edit | edit source]

Block Entities
Block Entity ID Associated Block
banner Banner
barrel Barrel
beacon Beacon
bed Bed
beehive Bee nest/beehive
bell Bell
blast_furnace Blast Furnace
brewing_stand Brewing Stand
calibrated_sculk_sensor Calibrated Sculk Sensor
campfire Campfire
chest Chest
chiseled_bookshelf Chiseled Bookshelf
comparator Redstone Comparator
command_block Command Block
conduit Conduit
crafter Crafter
creaking_heart Creaking Heart
daylight_detector Daylight Detector
decorated_pot Decorated Pot
dispenser Dispenser
dropper Dropper
enchanting_table Enchanting Table
ender_chest Ender Chest
end_gateway End Gateway
end_portal End Portal
furnace Furnace
hanging_sign Hanging Sign
hopper Hopper
jigsaw Jigsaw Block
jukebox Jukebox
lectern Lectern
mob_spawner Monster Spawner
piston Moving Piston
shulker_box Shulker Box
sign Sign
skull Mob head
sculk_catalyst Sculk Catalyst
sculk_sensor Sculk Sensor
sculk_shrieker Sculk Shrieker
smoker Smoker
soul_campfire Soul Campfire
structure_block Structure Block
suspicious_gravel Suspicious Gravel
suspicious_sand Suspicious Sand
trapped_chest Trapped Chest
trial_spawner Trial Spawner
vault Vault

A block entity (not related to entity) is used by Minecraft to store information about a block that can't be stored in the block's block states. Block entities were called "tile entities" until the 1.18 snapshots and that term is still used in some command usage.

BlockSprite banners.png: Sprite image for banners in Minecraft linking to bannersbanners

Pattern color

Pattern

BlockSprite barrel.png: Sprite image for barrel in Minecraft linking to barrelbarrel

BlockSprite beacon.png: Sprite image for beacon in Minecraft linking to beaconbeacon

BlockSprite beds.png: Sprite image for beds in Minecraft linking to bedbed

BlockSprite all-beehives.png: Sprite image for all-beehives in Minecraft linking to beehivebeehive

BlockSprite bell.png: Sprite image for bell in Minecraft linking to bellbell

BlockSprite blast-furnace.png: Sprite image for blast-furnace in Minecraft linking to Blast Furnaceblast_furnace

BlockSprite brewing-stand.png: Sprite image for brewing-stand in Minecraft linking to Brewing Standbrewing_stand

BlockSprite calibrated-sculk-sensor.png: Sprite image for calibrated-sculk-sensor in Minecraft linking to Calibrated Sculk Sensorcalibrated_sculk_sensor

BlockSprite campfire.png: Sprite image for campfire in Minecraft linking to campfirecampfire

BlockSprite chiseled-bookshelf.png: Sprite image for chiseled-bookshelf in Minecraft linking to Chiseled Bookshelfchiseled_bookshelf

BlockSprite chest.png: Sprite image for chest in Minecraft linking to chestchest

BlockSprite redstone-comparator.png: Sprite image for redstone-comparator in Minecraft linking to Redstone Comparatorcomparator

BlockSprite command-blocks.png: Sprite image for command-blocks in Minecraft linking to Command Blockcommand_block

BlockSprite conduit.png: Sprite image for conduit in Minecraft linking to Conduitconduit

BlockSprite crafter.png: Sprite image for crafter in Minecraft linking to Craftercrafter

BlockSprite creaking-heart.png: Sprite image for creaking-heart in Minecraft linking to Creaking Heartcreaking_heart

BlockSprite decorated-pot.png: Sprite image for decorated-pot in Minecraft linking to Decorated Potdecorated_pot

BlockSprite dispenser.png: Sprite image for dispenser in Minecraft linking to Dispenserdispenser

BlockSprite dropper.png: Sprite image for dropper in Minecraft linking to dropperdropper

BlockSprite enchanting-table.png: Sprite image for enchanting-table in Minecraft linking to Enchanting Tableenchanting_table

BlockSprite end-gateway.png: Sprite image for end-gateway in Minecraft linking to End Gateway (block)end_gateway

BlockSprite furnace.png: Sprite image for furnace in Minecraft linking to furnacefurnace

BlockSprite oak-hanging-sign.png: Sprite image for oak-hanging-sign in Minecraft linking to hanging_signhanging_sign

The character limit for the Text tags depends on the width of the characters. Although the Text tags are string objects, they should contain JSON text, which are evaluated as compound objects.

BlockSprite hopper.png: Sprite image for hopper in Minecraft linking to hopperhopper

BlockSprite jigsaw-block.png: Sprite image for jigsaw-block in Minecraft linking to Jigsaw Blockjigsaw

BlockSprite jukebox.png: Sprite image for jukebox in Minecraft linking to Jukeboxjukebox

BlockSprite lectern.png: Sprite image for lectern in Minecraft linking to lecternlectern

BlockSprite piston.png: Sprite image for piston in Minecraft linking to pistonpiston

BlockSprite sculk-catalyst.png: Sprite image for sculk-catalyst in Minecraft linking to Sculk Catalystsculk_catalyst

BlockSprite sculk-sensor.png: Sprite image for sculk-sensor in Minecraft linking to Sculk Sensorsculk_sensor

BlockSprite sculk-shrieker.png: Sprite image for sculk-shrieker in Minecraft linking to Sculk Shriekerskulk_shrieker

BlockSprite shulker-box.png: Sprite image for shulker-box in Minecraft linking to Shulker Boxshulker_box

BlockSprite oak-sign.png: Sprite image for oak-sign in Minecraft linking to signsign

BlockSprite heads.png: Sprite image for heads in Minecraft linking to Headskull

BlockSprite smoker.png: Sprite image for smoker in Minecraft linking to smokersmoker

BlockSprite soul-campfire.png: Sprite image for soul-campfire in Minecraft linking to Soul Campfiresoul_campfire

BlockSprite structure-block.png: Sprite image for structure-block in Minecraft linking to Structure Blockstructure_block

BlockSprite suspicious-gravel.png: Sprite image for suspicious-gravel in Minecraft linking to Suspicious Gravelsuspicious gravel

  1. a b Both loot table tags are removed once the items have been generated.

BlockSprite suspicious-sand.png: Sprite image for suspicious-sand in Minecraft linking to Suspicious Sandsuspicious_sand

  1. a b Both loot table tags are removed once the items have been generated.

BlockSprite trapped-chest.png: Sprite image for trapped-chest in Minecraft linking to Trapped Chesttrapped_chest

BlockSprite trial-spawner.png: Sprite image for trial-spawner in Minecraft linking to Trial Spawnertrial_spawner

BlockSprite vault.png: Sprite image for vault in Minecraft linking to Vaultvault

Tile tick format[edit | edit source]

Tile Ticks represent block updates that need to happen because they could not happen before the chunk was saved. Examples reasons for tile ticks include redstone circuits needing to continue updating, water and lava that should continue flowing, recently placed sand or gravel that should fall, etc. Tile ticks are not used for purposes such as leaf decay, where the decay information is stored in the leaf block data values and handled by Minecraft when the chunk loads. For map makers, tile ticks can be used to update blocks after a period of time has passed with the chunk loaded into memory.

ToBeTicked format[edit | edit source]

This List is always present, and contains 16 Sublists, each representing one of the "sections" of the chunk. Those inside lists may contain Shorts, each representing a packed coordinate relative to the section : The 4 most significant bits are always 0, then each group of 4 bits (or nibble) represents a section-relative coordinate, from 0 to 15. The order of sections in the list appear to be ordered from bottom to top, and the packing order of the coordinates is 0ZYX, where 0 refers to the chunk section. When converting proto-chunks to full chunks, only coordinates that are stored in PostProcessing appear to receive a tick update, tick updates stored in block_ticks, and fluid_ticks are ignored. [_verify_]

History[edit | edit source]

This section needs to be updated.

Please update this section to reflect recent updates or newly available information.
Reason: This history section is missing a significant number of changes, including most of the 1.13 changes, mainly the region file format.

Java Edition Beta
1.2 Originally, chunks were stored as individual chunk files ".dat" where the file names contained the chunk's position encoded in Base36.
The format used was Java Edition Alpha level format.
1.3 The Region format is introduced.
Chunks are now stored in groups of 32×32 chunks in individual ".mcr" files with the coordinates in Base10.
The goal was to reduce disk usage by cutting down on the number of file handles Minecraft had open at once..
Java Edition
1.2.1 12w07a The Anvil file format is introduced.
Chunks are now divided into 16 individual 16×16×16 block sections.
Blocks, Data, BlockLight, and SkyLight arrays are now housed in individual chunk Sections.
The NBT Format now includes an integer array tag similar to the existing byte array tag.
1.3.1 12w21a MaxExperience, RemainingExperience, ExperienceRegenTick, ExperienceRegenRate and ExperienceRegenAmount from MobSpawner have been removed.
1.4.2 12w34a Added entity WitherBoss.
1.5 13w02a Added entity MinecartTNT.
Minecart is now deprecated.
13w03a Added entity MinecartHopper.
13w06a Added entity MinecartSpawner.
1.6.1 13w16a Added entity EntityHorse.
13w21a ArmorType has been removed from EntityHorse.
Saddle has been removed from EntityHorse.
release Saddle to EntityHorse has been re-added.
1.7.2 13w39a Added entity MinecartCommandBlock.
13w42a Added CanBreakDoors to Zombie.
1.8 14w02a Added Lock to containers.
Item IDs are no longer used when specifying NBT data.
Added Block to FallingSand, using the alphabetical ID format.
14w06a Added ShowParticles to all mobs.
Added PickupDelay to item entities.
Setting Age to -32768 makes items, which never expire.
AttackTime has been removed from mobs.
14w10a Added rewardExp to Villager.
Added OwnerUUID for mobs that can breed.
Added Owner to Skull.
Changes to item frames and paintings: added Facing, TileX, TileY and TileZ now represent the co-ordinates of the block the item is in rather than what it is placed on. Direction and Dir are now deprecated.
14w11a Added entity Endermite.
Added EndermiteCount to Enderman.
14w21a CustomName and CustomNameVisible now work for all entities.
14w25a Added entity Guardian.
Added Text1, Text2, Text3 and Text4 to signs. The limit no longer depends on the amount of characters (16), it now depends on the width of the characters.
14w27a Added entity Rabbit. Added CommandStats to command blocks and signs.
14w28a EndermiteCount has been removed from Enderman.
14w30a Added Silent for all entities.
14w32a Added NoAI for all mobs.
Added entity ArmorStand.
14w32c Added NoBasePlate to ArmorStand.
1.9 15w31a Added tags HandItems, ArmorItems, HandDropChances, and ArmorDropChances to Living, which now replace the DropChances and Equipment tags.
Added HandItems and ArmorItems to ArmorStand.
Added Glowing to Entity.
Added Team to LivingBase.
Added DragonPhase to EnderDragon
Added entity Shulker, child of Entity.
Added entity ShulkerBullet, child of Entity.
Added entity DragonFireball, which extends FireballBase and has no unique tags.
Added entities TippedArrow and SpectralArrow, children of Arrow.
Added block EndGateway, child of TileEntity.
Added block Structure, child of TileEntity.
Added item tag Potion, child of tag.
15w32a Tags and DataVersion tag can now be applied on entities.
Changed the Fuse tag's type for the PrimedTnt entity from "Byte" to "Short".
15w32c Introduced a limit on the amount of tags an entity can now have (1024 tags). When surpassed it displays an error saying: "Cannot add more than 1024 tags to an entity."
15w33a Added entity AreaEffectCloud, child of Entity.
Added ExactTeleport and renamed Life to Age for EndGateway.
Added Linger to ThrownPotion.
DataVersion from Entity has been removed. It is now applied to Player only, child of LivingBase.
UUID from Entity has been removed.
HealF under LivingBase has now become deprecated.
Health under LivingBase has now changed from type "Short" to "Float".
Equipment has been removed from ArmorStand and Living entity, its usage is now replaced by HandItems and ArmorItems, which were added earlier.
15w33c Added BeamTarget to EnderCrystal.
15w34a Added powered and conditional byte tags to Control tile entity for command blocks.
Added life and power to FireballBase.
Added id inside SpawnData to MobSpawner.
Added powered to the Music tile entity for note blocks.
15w35a Added VillagerProfession to Zombie.
15w37a Added Enabled to MinecartHopper.
15w38a Added SkeletonTrap and SkeletonTrapTime to EntityHorse.
15w41a Riding has been replaced with Passengers for all entities.
Added RootVehicle for all passengers.
Added Type to Boat.
15w42a Added Fuel to Cauldron (brewing stands).
15w43a Added LootTable and LootTableSeed to Chest, Minecart and MinecartHopper.
Added DeathLootTable and DeathLootTableSeed to all mobs.
Added life and power to all fireballs (FireballBase).
15w44a Added ShowBottom to EnderCrystal.
15w44b Added Potion and CustomPotionEffects to Arrow.
Added Potion to AreaEffectCloud.
15w45a Linger has been removed from ThrownPotion. Instead, the potion lingers if the stored item has an ID of minecraft:lingering_potion.
ThrownPotion now renders as its stored item, even if the item is not a potion.
15w46a MoreCarrotTicks from Rabbit is now set to 40 when rabbits eat a carrot crop, but is not used anyway.
15w47a Added PaymentItem to Beacon.
15w49a PaymentItem has been removed from Beacon.
In order for a sign to accept text, all 4 tags ("Text1", "Text2", "Text3", and "Text4") must exist.
15w51b The original values of DisabledSlots in ArmorStand have been changed in nature.
1.10 16w20a Added entity PolarBear.
Added ZombieType to Zombie, replacing VillagerProfession and IsVillager. Value of 6 indicates the "husk" zombie.
A value of 2 on SkeletonType indicates the "stray" skeleton.
NoGravity extended to all entities.
Added powered, showboundingbox and showair to Structure.
16w21a Added FallFlying to mobs and armor stands.
Added integrity and seed to Structure.
pre1 Added ParticleParam1 and ParticleParam2 to AreaEffectCloud.
1.11 16w32a Horses have been split into entity IDs horse, donkey, mule, skeleton_horse and zombie_horse for their respective types. Type and HasReproduced removed from horse, ChestedHorse and Items tags now apply only to mule and donkey, and SkeletonTrap and SkeletonTrapTime tags now apply only to skeleton_horse.
Skeletons have been split into entity IDs skeleton, stray and wither_skeleton. SkeletonType tag is removed from all skeleton types.
Zombies have been split into entity IDs zombie, zombie_villager and husk. ZombieType tag is removed from all zombie types, ConversionTime and Profession tags now apply only to zombie_villager.
Guardians have been split into entity IDs guardian and elder_guardian. Elder tag has been removed from guardian.
Unused savegame IDs Mob and Monster have been removed.
Pumpkin byte tag has been added to snowman.
16w35a Added CustomName to banner.
16w39a Added llama, llama_spit, vindication_illager, vex, evocation_fangs and evocation_illager.
Added Color to shulker.
Added LocName, CustomPotionColor and ColorMap to items.
16w40a Added Johnny to vindication_illager.
Removed xTile, yTile, zTile, inTile, inGround from the FireballBase class (in large fireballs, small fireballs, dragon fireballs, and wither skulls).
16w41a llama_spit is now available as a save game entity.
16w42a Added crit to arrow.
16w43a Added OwnerUUIDLeast and OwnerUUIDMost to evocation_fangs.
16w44a xTile, yTile, zTile, inTile, inGround have been removed from the fishing bobber entity.
pre1 ench has been changed to require at least one compound.
1.12 17w13a Added entity Parrot, ShoulderEntityLeft/ShoulderEntityRight, seenCredits, recipeBook and Recipes.
17w14a Added isFilteringCraftable, isGuiOpen and recipes to recipeBook, which is now a compound tag.
Added ConversionPlayerLeast and ConversionPlayerMost to entity Zombie.
17w16a NBT parsing in commands has been improved.
17w17a Added toBeDisplayed to recipeBook, UpdateLastExecution and LastExecution.
17w17b Added LoveCauseLeast and LoveCauseMost to breedable entities.
1.13 17w47a The damage tag from items removed, tools and armor now use Damage and maps use map, both in tag.
Endermen's carried and carriedData merged into carriedBlockState.
Arrows' inTile and inData merged into inBlockState.
Minecarts' DisplayTile and DisplayData merged into DisplayState.
Falling blocks' Block and Data merged into BlockState.
Moving pistons' BlockId and BlockData merged into blockState.
Removed note block and flower pot block entities.
Trapped chests now have their own block entity trapped_chest.
Removed Base from banners.
Removed Rot from heads.
17w47a Removed Record from jukeboxes.
17w47b Trapped chests no longer have their own block entity, and again use chest.
18w01a Thrower and Owner has been changed from strings to compounds with two longs named L and M.
18w02a Bobbers created by fishing rods now have the entity ID fishing_bobber.
Painting motives are now lowercased and namespaced.
18w07a Added turtle, trident, and phantom entities.
Added HomePosX, HomePosY, HomePosZ, TravelPosX, TravelPosY, TravelPosZ, and HasEgg to turtle.
Added AX, AY, AZ, and Size to phantom.
18w15a Added dolphin entity.
18w19a Renamed puffer_fish to pufferfish.
18w20a Renamed cod_mob to cod.
Renamed salmon_mob to salmon.
18w21a Added TreasurePosX, TreasurePosY, TreasurePosZ, GotFish, and CanFindTreasure to dolphin.
ench has been renamed to Enchantments.
Enchantments no longer accepts numeric IDs, and instead requires name IDs.
pre5 Renamed xp_orb to experience_orb.
Renamed xp_bottle to experience_bottle.
Renamed eye_of_ender_signal to eye_of_ender.
Renamed ender_crystal to end_crystal.
Renamed fireworks_rocket to firework_rocket.
Renamed commandblock_minecart to command_block_minecart.
Renamed villager_golem to iron_golem.
Renamed evocation_fangs to evoker_fangs.
Renamed evocation_illager to evoker.
Renamed vindication_illager to vindicator.
Renamed illusion_illager to illusioner.
1.14 18w43a Added illager_beast, panda, and pillager entities.
18w45a The LIGHT_BLOCKING heightmap has been removed.
1.15 19w36a The Biomes array in the Level tag for each chunk now contains 1024 integers instead of 256, allowing biomes to differ based on altitude.
1.17 20w45a Entities have been extracted from main (terrain) chunks and are now stored in separate entities directory (similar to POI storage). Those new files are still region files with NBT.
20w51a Added axolotl.
21w03a Added glow_squid.
21w13a Added goat.
1.20.2 23w32a Game no longer uses numeric values when storing mob effects to world. For example, 4 becomes minecraft:mining_fatigue.
Changed following fields in mob effect instances:Id (integer) -> id (string, resource identifier) Ambient -> ambient Amplifier -> amplifier Duration -> duration ShowParticles -> show_particles ShowIcon -> show_icon HiddenEffect -> hidden_effect FactorCalculationData -> factor_calculation_data
In NBT format for block entity type beacon:Primary (integer) -> primary_effect (string, resource identifier) Secondary (integer) -> secondary_effect (string, resource identifier)
1.21 24w21a Renamed Attributes field in mob data to attributes
Changed following fields in mob attributes:Name -> id Base -> base Modifiers -> modifiers
Changed following fields in mob attribute modifiers:UUID (int array) and Name (arbitrary string) -> id (string, resource identifier) Amount -> amount Operation (integer) -> operation (string), with "add_value" replacing 0, "add_multiplied_base" replacing 1, and "add_multiplied_total" replacing 2

References[edit | edit source]

v t eJava Edition technical
General Concepts Block entity Coordinates Crashes Resource location Screenshot Statistics Telemetry Tick UUID JSON General format Data values Classic Indev Pre-flattening Data component format Entity format Map item format NBT format Particle format Raw JSON text format Formatting codes Key codes Random sequence Structure file format Schematic file format Item sub-predicate World Heightmap Seed Spawn chunk Data version Level format Anvil file format Chunk format Player format Point of Interest format raids.dat format Command storage format Scoreboard format Legacy Classic level format Classic server protocol Indev level format Alpha level format Infdev 20100624 level format Region file format server_level.dat villages.dat format Generated structures format .minecraft client.jar version.json client.json command_history.txt launcher_profiles.json options.txt version_manifest.json hotbar.nbt format Server list format Tools Debug screen (hotkey) Developer Tools Obfuscation map Sound Block sound type sounds.json Subtitles Commands Brigadier Functions More information about commands Launching Mojang API Microsoft authentication Quick Play Legacy Legacy Minecraft authentication Yggdrasil Protocol Protocol version Server server.jar server.properties Server requirements ops.json format RCON Legacy al_version Item format
Data pack Components pack.mcmeta Pack format Advancements Functions Item modifiers Loot tables Predicates Recipes Tags Damage types Chat types Enchantments Enchantment providers Painting variants Goat horn instruments Jukebox songs World generation Dimensions Dimension types World presets Biomes Carvers Configured features Placed features Noise settings Noise router Density functions Noises Surface rules Structures Structure sets Template pools Processor lists Structure templates Data packs Caves & Cliffs Prototype Data Pack Tutorials Installing Creating Optimizing Command blocks and functions Repairing a world corrupted by a data pack Content Custom enchantments Custom paintings Custom trims World generation New dimension Custom structures
Resource pack Components pack.mcmeta Pack format Models Blockstates Items Sounds (sounds.json) Shaders Textures Atlases Colormaps Texts regional_compliancies.json Tutorials Creating a resource pack