Chunk



Chunks are segments of the virtually infinite Minecraft worlds. They are 16 blocks wide, 16 blocks long, and 256 blocks deep (As of version 1.2), which is 65,536 blocks total. Chunks are generated around players when they first enter the world. As they wander that world, nearby chunks are generated as needed. There is a possible fourteen trillion (14,062,500,000,000) real chunks that can be generated.

The exact number of generated chunks varies in single player mode, depending on view distance and movement. In multiplayer mode, a grid with a default radius of 10 (for a total of 21x21 or 441) chunks is loaded around each player and sent to the player by default, although this radius can be configured to be between 3 and 15, usually only lowered with a poor connection home server. These chunks may have activity (mobs spawning, trees growing, water flowing, dropped items disappearing etc.), while the other world chunks are inactive, stored on your hard drive. Chunks will not save again if they were saved in the last 30 seconds.

Slimes can only spawn in specific chunks, determined by a calculation performed on the chunk coordinates. There are a number of utilities and mods which allow the player to tell which chunks they can spawn in; see the Slime article for details.

Minecraft's renderer divides a world chunk into eight 16x16x16 render chunks, which are compiled OpenGL display lists, to speed up rendering significantly. They need to be rebuilt each time when blocks within these chunks are changed.

Creation of Chunks
Chunks are created with the help of the Map Seed, which means that the chunks are always the same if you would use the same Seed again, as long as the map generator remains the same. For example, if a player were to spawn in a jungle, using that seed in an older version of Minecraft (before 1.2.3 at least) would load a very different map, as jungles wouldn't load around the player.

Finding Chunk Edges

 * Pressing the "F3" button opens the Debug screen which shows the player's X, Y, and Z coordinates, in addition to the "c" variable. These coordinates will change as the player moves around. The player can know which chunk he is on by the variable "c" that is next to both "x" and "z" variables. The number in the bracelets specifies how far the player is from the south-western corner of the chunk, so if the "c" beside X was 3(5), and the "c" beside Z was 2(4), then the player is on chunk (3, 2), and is on block (5, 4) from the south-western corner.

X and Z coordinates that are divisible by 16 represent the boundaries between chunks. EG: (96, -32) is a corner where four chunks meet. One of those chunks is between X coordinates 80 to 96 and Z coordinates -48 to -32. Another one is between X coordinates 96 to 112 and Z coordinates -32 to -16, and so on. When either X or Z crosses a multiple of 16, the player is moving across chunks.

Essentially, the player is in the bottom-left corner (south-western) of a chunk when both x and z coordinates are divisible by 16.

Additionally, the player can know which chunk he is on by this formula: The X of chunk will be Floor( X coordinate / 16 ) The Y of chunk will be Floor( Y coordinate / 16 ) While Floor is the largest previous integer. E.g. Floor( 27.9561 ) is 27 In other words if X was 27, Y was -15 the chunk will be chunk ( Floor( 27 / 16 ), Floor( -15 / 16 ) ) which means the player is on chunk (1, -1) Also, The player can know how far he is from the south-western corner by this formula: (X or Z coordinate) AND 15

Chunk error


A chunk error (also known as a missing chunk or world hole) is a common error found in multiplayer (and, less frequently singleplayer) mode. They are typically client side, meaning that they are caused by the user's software, and not a server software. Reconnecting to the server or reloading the map usually fixes chunk errors. Players can jump or fall into an errored chunk, since some players have reported falling and some have reported warping similar to arrows. Rarely, chunk errors can occur server-side, and they can be fallen into. Due to the way fluids are displayed, any fluids on the border of the chunk error will look as if they are flowing downwards. On vanilla (non-modded) servers the teleport command can be used to escape such a glitch. Items dropped on an errored chunk in singleplayer mode will fall and cannot be retrieved, however. Also, non-solid blocks can't flow into one. Blocks that are in a chunk error can reappear if you place a block in a chunk error (it gets overwritten, so the block you place gets turned into what was there) or blow it up with TNT. Chunk errors have been noticeably less common since Beta. If you walk far enough from a chunk error then come back the chunk will either disappear or move, chunks that move will rarely change shape (Expanding), normally containing two chunk errors, sometimes three.

Another type of chunk error that has been recently discovered is something called "biome replacement" what happens is that several chunks of one area, while loading or creating a world, are suddenly removed and replaced with ones from a completely different biome, destroying structures on that chunk. A more unpleasant effect is that there tends to be some elevation difference between biomes. Sometimes this can actually be harmless and just replace certain blocks with what would be there if a chunk overrode the area. If that is the case, then this may be useful since new ores generate, unless floating blocks are replaced with gravel.

At least one way to have the above happen is when the deletion of the previous world by the same name was not completed fully; the remaining data will show up in the new world. (Issues and  in Mojira)

When in SMP, it is noted that some items remain visible within a chunk error. This tends to apply to items like paintings or redstone components/wiring. This does not always occur, however.

Chunk errors can also be manually created using the program MCEdit by moving the player to a chunk that hasn't been generated yet or deleting a chunk. This might not be considered an error due to the fact that the player meant to do it, though.

Chunk error Work-arounds
Because chunk errors are usually temporary bugs where the Minecraft client was unable to load a chunk, logging out and logging back in is often all that is required to fix one. However, there are also other things a player can do to work around most chunk errors.

Players are able to walk into a chunk error, but will only glitch out. If you walk into the chunk until you get stuck in a falling animation and should press escape to close a Single Player world, or disconnect for a Multiplayer server. Once you re-connect the chunk will be filled in. They are able to ride through them in a boat or minecart - provided there are pre-existing rails or water. While the track will remain invisible to you, your cart will follow it. If your destination happens to be in an errored chunk, simply re-connect to the server or reload the map upon arrival to avoid falling into the errored chunk and losing your minecart. Chunk errors may also cause you to vibrate randomly when touching blocks in the chunk error, you can fly (in creative) or teleport out.

Lighting, explosions, and other processes that update blocks within a chunk can cause chunks to re-load, making them visible. Because of this, placing torches can be used to make localized parts of chunk errors visible. Also you can right-click (or use your custom action or "place" button) on a visible block in a separate chunk to the one missing. The block next to it will appear. This works with a fist or any equipped item or block.

Another type of chunk error is when a player is on a SMP server and sees a chunk that is empty. If the player walks on it, the chunk will act as if it was visible. Resending the chunks by moving away(or other means) will usually fix this. Waiting may also fix this.

Resetting your render distance causes the chunks to refresh, so this can be used as well.

Pressing +will force a reload of the chunks around you, which can usually fix chunk errors.

Usage of chunk errors
Often, a chunk error will allow you to see a cross-section of the world, making it easy to locate ores, caves, dungeons, and other hidden structures underground. This can be exploited by marking the surface above any interesting looking veins, caverns, dungeons or other structures before re-loading the map.

Sometimes on lower end computers, chunks will glitch in a way that the chunk will still be visible; however, if a block is mined, it will still be visible, but without a collision box. If you dig out a space when this happens and stand in it, you will be able to see mineshaft parts, chests, particles, the figure spinning inside spawners(it won't be spinning), caves, and certain areas of blocks.

If you have a buddy on a multiplayer server with a chunk error, they are useful for guiding you from along the sides of a chunk error as they can see where you are digging. This means that your friends can point you to resources they cannot reach because of the chunk error.

Fake Chunks
Fake Chunks are non-solid chunks that generate past 30,000,000 meters from the spawn. A sure sign that one has reached the edge of the map is that blocks appear fully lit past the 30,000,000 mark. If the player walks into the fake chunks, the player will fall through them into the Void and be killed. When the player flies about 34 blocks past this perimeter the game freezes and begins to jitter with severe lagging, the player cannot be seen in 3rd person mode and cannot move. There is no way to escape this and the player has to start a new world or edit their position in the level.dat file.(If this occurs, 3rd-party programs such as MCEdit can change the player's position without directly editing code.) Fake Chunks also generate in The Nether and have the same effects as in the Overworld.

In snapshot 12w25a, this is prevented by the save (due to single player games functioning like the client side of a multiplayer server) kicking the player out of the game for being in an illegal position and respawning the player back within the 32,000,000 mark. This prevents the player from being "killed" and from locked movement. During the Halloween Update, Fake Chunks were removed, and no longer exist.

Effects Near Fake Chunks

The world starts to act slowly and unresponsive with unintended results if a player goes past 12,550,820 meters from the spawn point. Known effects are:


 * When pistons extend, the rod section of the piston extension block (see Data values) vanishes, but its collision box is still there.


 * Redstone wire will have distorted textures and appear stretched.


 * Falling sand and gravel appear in an incorrect position (miscalculation in x and y values) until they fall completely down and turn back from an entity into a block, except for TNT.


 * The Item in an Item Frame will seem to shake when the Player is moving.


 * The fire particles in redstone torches and normal torches appear in incorrect positions.


 * A great amount of lag is given to the player if one waits past the 12,550,820 meter point for a period of time. A short-term remedy for this is by using a mod that can use a command to remove every entity in the world and make all blocks fully lit.


 * Some blocks are not lit at all, even when surrounding blocks are.