Info
Chunks Visualization of the ground portion of a single chunk. The entire chunk extends up to a height of 256. Chunks are 16 × 16 × 256 segments of the Minecraft worlds. Contents 1 Generation 1.1 store the terrain and entities within a 16ℂₗ256ℂₗ16 area. They also store precomputed lighting, heightmap data for Minecraft`s performance, and other meta information.
NBT structure
- See also: Information from the Anvil format page
Chunks are stored in NBT See the NBT file format. For using NBT in commands, see Tutorials/Command NBT Tags. The Named Binary Tag format is used by Minecraft for the various files in which it saves data. format, with this structure (see Block Format below for the ordering of the blocks within each array):
The root tag.
DataVersion: Version of the chunk NBT structure.
Level: Chunk data.
xPos: X position of the chunk.
zPos: Z position of the chunk.
LastUpdate: Tick when the chunk was last saved.
LightPopulated: 1 or 0 (true/false) - If true, the server/client has already calculated lighting values for this chunk after generation.
TerrainPopulated: 1 or not present (true/false) indicate whether the terrain in this chunk was populated with special things. (Ores, special blocks, trees, dungeons, flowers, waterfalls, etc.) If set to zero then Minecraft will regenerate these featuresSpecial attraction in the blocks that already exist.
V: Currently always saved as 1 and not actually loaded by the game. Likely a chunk version tag.
InhabitedTime: The cumulative number of ticks players have been in this chunk. Note that this value increases faster when more players are in the chunk. Used for regional difficulty: increases the chances of mobs spawning with equipment, the chances of that equipment having enchantments, the chances of spiders having potion effects, the chances of mobs having the ability to pick up dropped items, and the chances of zombies having the ability to spawn other zombies when attacked. Note that at values 3600000 and above, regional difficulty is effectively maxed for this chunk. At values 0 and below, the difficulty is capped to a minimum (thus, if this is set to a negative number, it will behave identically to being set to 0, apart from taking time to build back up to the positives). See Regional Difficulty for more specifics.
Biomes: May not exist. 256 bytes of biome data, one byte for each vertical column in the chunk. See Data Values for biome IDs. If this tag does not exist it will be created and filled by Minecraft when the chunk is loaded and saved. If any values in this array are -1, Minecraft will also set them to the correct biome.
HeightMap: 1024 bytes(256 TAG_Int) of heightmap data. 16 ⃗ 16. Each byte records the lowest level in each column where the light from the sky is at full strength. Speeds computing of the SkyLight.
Sections: List of Compound tags, each tag is a sub-chunk of sorts.
An individual Section.
Y: The Y index (not coordinate) of this section. Range 0 to 15 (bottom to top), with no duplicates but some sections may be missing if empty.
Blocks: 4096 bytes of block IDs defining the terrain. 8 bits per block, plus the bits from the below Add tag.
Add: May not exist. 2048 bytes of additional block ID data. The value to add to (combine with) the above block ID to form the true block ID in the range 0 to 4095. 4 bits per block. Combining is done by shifting this value to the left 8 bits and then adding it to the block ID from above.
Data: 2048 bytes of block data additionally defining parts of the terrain. 4 bits per block.
BlockLight: 2048 bytes recording the amount of block-emitted light in each block. Makes load times faster compared to recomputing at load time. 4 bits per block.
SkyLight: 2048 bytes recording the amount of sunlight or moonlight hitting each block. 4 bits per block.
Entities: Each TAG_Compound in this list defines an entity in the chunk. See Entity Format below. If this list is empty it will be a list of End tags (before 1.10, list of Byte tags).
TileEntities: Each TAG_Compound in this list defines a block entity in the chunk. See Block Entity Format below. If this list is empty it will be a list of End tags (before 1.10, list of Byte tags).
TileTicks: May not exist. Each TAG_Compound in this list is an "active" block in this chunk waiting to be updated. These are used to save the state of redstone machines, falling sand or water, and other activity. See Tile Tick Format below. This tag may not exist.
Videos
Block format
In the Anvil format, block positions are ordered YZX for compression purposes.
The coordinate system is as follows:
- X increases East, decreases West
- Y increases upwards, decreases downwards
- Z increases South, decreases North
This also happens to yield the most natural scan direction, because all indices in the least significant dimension (i.e. X in this case) appear for each index in the next most significant dimension; so one reads an array ordered YZX as one would a book lying with its top northward, all letters (or X-indices) on a single line (or Z-index) at a time, and all lines on a single page (or Y-index) at a time. For the 2D arrays (i.e. "Biomes" and "HeightMap") the inapplicable Y dimension is simply omitted, as though the book is only one page thick.
Each section in a chunk is a 16x16x16-block area, with up to 16 sections in a chunk. Section 0 is the bottom section of the chunk, and section 15 is the top section of the chunk. To save space, completely empty sections are not saved. Within each section is a byte tag "Y" for the Y index of the section, 0 to 15, and then byte arrays for the blocks. The "Block" byte array has 4096 partial block IDs at 8 bits per block. Another byte array "Add" is used for block with IDs over 255, and is 2048 bytes of the other part of the 4096 block IDs at 4 bits per block. When both the "Block" and "Add" byte arrays exist, the partial ID from the "Add" array is shifted left 8 bits and added to the partial ID from the "Blocks" array to form the true Block ID. The "Data" byte array is also 2048 bytes for 4096 block data values at 4 bits per block. The "BlockLight" and "SkyLight" byte arrays are the same as the "Data" byte array but they are used for block light levels and sky light levels respectively. The "SkyLight" values represent how much sunlight or moonlight can potentially reach the block, independent of the current light level of the sky.
The endianness of the 2048-byte arrays (i.e. "Add," "Data," "BlockLight," & "SkyLight"), which give only 4 bits per block, seems to stand as the one anomalous exception to the otherwise consistent, format-wide standard of big-endian data storage. It also runs counter to the presumably natural human-readable printing direction. If the blocks begin at 0, they are grouped with even numbers preceding odd numbers (i.e. 0 & 1 share a byte, 2 & 3 share the next, etc.); under these designations Minecraft stores even-numbered blocks in the least significant half-byte, and odd-numbered blocks in the most significant half-byte. Thus block0 is byte0 at 0x0F, block1 is byte0 at 0xF0, block2 is byte1 at 0x0F, block3 is byte1 at 0xF0, etc. ...
The pseudo-code below shows how to access individual block information from a single section. Hover over text to see additional information or comments.
byte Nibble4(byte arr, int index){ return index%2 == 0 ? arrindex/2&0x0F : (arrindex/2>>4)&0x0F; } int BlockPos = y*16*16 + z*16 + x; byte BlockID_a = BlocksBlockPos; byte BlockID_b = Nibble4(Add, BlockPos); short BlockID = BlockID_a + (BlockID_b ; byte BlockData = Nibble4(Data, BlockPos); byte Blocklight = Nibble4(BlockLight, BlockPos); byte Skylight = Nibble4(SkyLight, BlockPos);
Entity format
Every entity A player standing in front of a large group of entities The hitboxes of several entities. Note the blue line which points to the direction the entity is "facing." Entities encompass all dynamic, moving objects is an unnamed
TAG_Compound contained in the Entities list of a chunk file. The sole exception is the Player entity, stored in level.dat In Minecraft 1.0, each level is its own folder. A level folder is often identified by having a level.dat file, along with other subfolders to store the maps and regions of the level. Level folders , or in
id Pos Motion Rotation FallDistance Fire Air OnGround Dimension Invulnerable PortalCooldown UUIDMost UUIDLeast UUID CustomName CustomNameVisible Silent Riding CommandStats SuccessCountObjective SuccessCountName AffectedBlocksObjective AffectedBlocksName AffectedEntitiesObjective AffectedEntitiesName AffectedItemsObjective AffectedItemsName QueryResultObjective QueryResultName
Entity data
-
id: Entity ID. This tag does not exist for the Player entity.
Pos: 3 TAG_Doubles describing the current X,Y,Z position of the entity.
Motion: 3 TAG_Doubles describing the current dX,dY,dZ velocity of the entity in meters per tick.
Rotation: Two TAG_Floats representing rotation in degrees.
The entity`s rotation clockwise around the Y axis (called yaw). Due west is 0. Does not exceed 360 degrees.
The entity`s declination from the horizon (called pitch). Horizontal is 0. Positive values look downward. Does not exceed positive or negative 90 degrees.
FallDistance: Distance the entity has fallen. Larger values cause more damage when the entity lands.
Fire: Number of ticks until the fire is put out. Negative values reflect how long the entity can stand in fire before burning. Default -20 when not on fire.
Air: How much air the entity has, in ticks. Fills to a maximum of 300 in air, giving 15 seconds submerged before the entity starts to drown, and a total of up to 35 seconds before the entity dies (if it has 20 health). Decreases while underwater. If 0 while underwater, the entity loses 1 health per second.
OnGround: 1 or 0 (true/false) - true if the entity is touching the ground.
NoGravity: 1 or 0 (true/false) - if true, the entity will not fall if in the air.
Dimension: Only known to be used in.dat .dat files are used by servers to store the state of individual players. The format is also used within level.dat files to store the state of the singleplayer player, which overrides any .dat files with to store the players last known location along with Pos. All other entities are only saved in the region files for the dimension they are in. -1 for The Nether A view of the Nether. The Nether is a hell-like dimension, filled with fire, lava, and dangerous mobs. Contents 1 Accessing 2 Environment 2.1 Mobs 3 Generation 3.1 Naturally generated 3.2 Naturally created 3.3 Structures , 0 for The Overworld The Overworld, as seen in an extreme hills and a forest biome The Overworld is the dimension in which all players begin their Minecraft journey. Contents 1 Creation 1.1 Seeds 2 Environment 2.1 Biomes 2.2 , and 1 for The End See the dimension. For the achievement, see Achievements#The End.. For the advancement, see Advancements#The End. A view of the central End island. The ender dragon can be seen flying around obsidian pillars, .
Invulnerable: 1 or 0 (true/false) - true if the entity should not take damage. This applies to living and nonliving entities alike: mobs will not take damage from any source (including potion effects), and cannot be moved by fishing rods, attacks, explosions, or projectiles, and objects such as vehicles and item frames cannot be destroyed unless their supports are removed. Note that these entities can be damaged by players in Creative mode.
PortalCooldown: The number of ticks before which the entity may be teleported back through a nether portal. Initially starts at 300 ticks (15 seconds) after teleportation and counts down to 0.
UUIDMost: The most significant bits of this entity`s Universally Unique IDentifier. This is joined with UUIDLeast to form this entity`s unique ID.
UUIDLeast: The least significant bits of this entity`s Universally Unique IDentifier.UUID(removed in 1.9 1.9 Official name Combat Update Type Release Release date Feb. 29, 2016 1] Development versions View all Snapshots 15w31a 15w31b 15w31c 15w32a 15w32b 15w32c 15w33a 15w33b 15w33c 15w34a 15w34b 15w34c 15w34d 15w35a 15w35b 15w35c 15w35d ): The Universally Unique IDentifier of this entity. Converts a hexadecimal UUID (for example:069a79f4-44e9-4726-a5be-fca90e38aaf5
) into the UUIDLeast and UUIDMost tags. Will not apply new UUIDLeast and UUIDMost tags if both of these tags are already present. The "UUID" tag is removed once the entity is loaded.
CustomName: The custom name of this entity. Appears in player death messages and villager trading interfaces, as well as above the entity when your cursor is over it. May not exist, or may exist and be empty.
CustomNameVisible: 1 or 0 (true/false) - if true, and this entity has a custom name, it will always appear above them, whether or not the cursor is pointing at it. If the entity hasn`t a custom name, a default name will be shown. May not exist.
Silent: 1 or 0 (true/false) - if true, this entity will not make sound. May not exist.Riding: (deprecated in 1.9 1.9 Official name Combat Update Type Release Release date Feb. 29, 2016 1] Development versions View all Snapshots 15w31a 15w31b 15w31c 15w32a 15w32b 15w32c 15w33a 15w33b 15w33c 15w34a 15w34b 15w34c 15w34d 15w35a 15w35b 15w35c 15w35d ) The data of the entity being ridden. Note that if an entity is being ridden, the topmost entity in the stack has the Pos tag, and the coordinates specify the location of the bottommost entity. Also note that the bottommost entity controls movement, while the topmost entity determines spawning conditions when created by a mob spawner.- See this format (recursive).
Passengers: The data of the entity riding. Note that both entities control movement and the topmost entity controls spawning conditions when created by a mob spawner.- See this format (recursive).
Glowing: 1 or 0 (true/false) - true if the entity has a glowing outline.
Tags: List of custom string data.
CommandStats: Information identifying scoreboard parameters to modify relative to the last command run
SuccessCountObjective: Objective`s name about the number of successes of the last command (will be an int)
SuccessCountName: Fake player name about the number of successes of the last command
AffectedBlocksObjective: Objective`s name about how many blocks were modified in the last command (will be an int)
AffectedBlocksName: Fake player name about how many blocks were modified in the last command
AffectedEntitiesObjective: Objective`s name about how many entities were altered in the last command (will be an int)
AffectedEntitiesName: Fake player name about how many entities were altered in the last command
AffectedItemsObjective: Objective`s name about how many items were altered in the last command (will be an int)
AffectedItemsName: Fake player name about how many items were altered in the last command
QueryResultObjective: Objective`s name about the query result of the last command
QueryResultName: Fake player name about the query result of the last command
Mobs
Mobs are a subclass of Entity with additional tags to store their health, attacking/damaged state, potion effects, and more depending on the mob. Players are a subclass of Mob.
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
BatFlags: 1 when hanging upside-down from a block, 0 when flying.
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
- Additional fields for mobs that can breed see Template:Nbt inherit/breedable/template
IsChickenJockey: 1 or 0 (true/false) - Whether or not the chicken is a jockey for a baby zombie. If true, the chicken can naturally despawn and drops 10 experience upon death instead of 1-3. Baby zombies can still control a ridden chicken even if this is set false.
EggLayTime: Number of ticks until the chicken lays its egg. Laying occurs at 0 and this timer gets reset to a new random value between 6000 and 12000.
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
- Additional fields for mobs that can breed see Template:Nbt inherit/breedable/template
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
powered: 1 or 0 (true/false) - May not exist. True if the creeper is charged from being struck by lightning.
ExplosionRadius: The radius of the explosion itself, default 3.
Fuse: States the initial value of the creeper`s internal fuse timer (does not affect creepers that fall and explode upon impacting their victim). The internal fuse timer will return to this value if the creeper is no longer within attack range. Default 30.
ignited: 1 or 0 (true/false) - Whether the creeper has been ignited by a Flint and Steel.
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
- Additional fields for mobs that can breed see Template:Nbt inherit/breedable/template
Bred: 1 or 0 (true/false) - Unknown. Remains 0 after breeding. If true, causes it to stay near other horses with this flag set.
EatingHaystack: 1 or 0 (true/false) - true if the horse is grazing.
Tame: 1 or 0 (true/false) - true if the horse is tamed. (Non players mobs will not be able to ride a tamed horse if it has no saddle)
Temper: Ranges from 0 to 100; increases with feeding. Higher values make a horse easier to tame.
OwnerUUID: Contains the UUID of the player that tamed the horse. Has no effect on behavior.
ArmorItem: The armor item worn by this horse. May not exist.- Tags common to all items see Template:Nbt inherit/item/template
SaddleItem: The saddle item worn by this horse. May not exist.- Tags common to all items see Template:Nbt inherit/item/template
ChestedHorse: 1 or 0 (true/false) - true if the horse has chests. A chested horse that is not a donkey or a mule will crash the game.
Items: List of items. Only exists if ChestedHorse is true.
An item, including the Slot tag. Slots are numbered 2 to 16 for donkeys and mules, and none exist for all other horses.- Tags common to all items see Template:Nbt inherit/item/template
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
DragonPhase: A number indicating the dragon`s current state. Valid values are: 0=circling, 1=strafing (preparing to shoot a fireball), 2=flying to the portal to land (part of transition to landed state), 3=landing on the portal (part of transition to landed state), 4=taking off from the portal (part of transition out of landed state), 5=landed, performing breath attack, 6=landed, looking for a player for breath attack, 7=landed, roar before beginning breath attack, 8=charging player, 9=flying to portal to die, 10=hovering with no AI (default when using the/summon
command).
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
carried: ID of the block carried by the enderman. When not carrying anything, 0. When loading, may also be a string block name.
carriedData: Additional data about the block carried by the enderman. 0 when not carrying anything.
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
Lifetime: How long the endermite has existed in ticks. Disappears when this reaches around 2400.
PlayerSpawned: Endermen will attack the endermite if this value is 1.
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
SpellTicks: Number of ticks until a spell can be cast. Set to a positive value when a spell is cast, and decreases by 1 per tick.
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
ExplosionPower: The radius of the explosion created by the fireballs this ghast fires. Default value of 1.
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
- Additional fields for mobs that can breed see Template:Nbt inherit/breedable/template
Bred: 1 or 0 (true/false) - Unknown. Remains 0 after breeding. If true, causes it to stay near other horses with this flag set.
EatingHaystack: 1 or 0 (true/false) - true if the horse is grazing.
Tame: 1 or 0 (true/false) - true if the horse is tamed. (Non players mobs will not be able to ride a tamed horse if it has no saddle)
Temper: Ranges from 0 to 100; increases with feeding. Higher values make a horse easier to tame.
OwnerUUID: Contains the UUID of the player that tamed the horse. Has no effect on behavior.
ArmorItem: The armor item worn by this horse. May not exist.- Tags common to all items see Template:Nbt inherit/item/template
SaddleItem: The saddle item worn by this horse. May not exist.- Tags common to all items see Template:Nbt inherit/item/template
Variant: The variant of the horse. Determines colors. Stored asbaseColor | markings . Unused values lead to invisible horses.
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template
- Tags common to all mobs see Template:Nbt inherit/mob/template
IsBaby: 1 or 0 (true/false) - true if this zombie is a baby. May be absent.
CanBreakDoors: 1 or 0 (true/false) - true if the zombie can break doors (default value is 0).
Entity data- Tags common to all entities see Template:Nbt inherit/entity/template