Chunks are segments of the Minecraft worlds. They are 16 blocks wide, 16 blocks long, and 256 blocks deep, 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 are a possible fourteen trillion (14,062,500,000,000) real chunks that can be generated. There are 4.28*10254962 possible chunks, excluding entities.
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 inradius of 10 (for a total of 21x21 or 441) chunks is loaded around each player and sent to the player by default, although this 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 sixteen 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 and 1.7) 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/she is on by the variable "c" that is next to both "x" and "z" variables. The number in the brackets specifies how far the player is from the north-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 north-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 top-left corner (north-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 Z of chunk will be Floor( Z coordinate / 16 )
Where Floor is the largest previous integer. E.g. Floor( 27.9561 ) is 27
In other words if X was 27, Z 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 north-western corner by this formula:
(X or Z coordinate) AND 15
A chunk error (also known as a missing chunk or world hole) is a common error found in multiplayer (and, less frequently singleplayer) mode. The chunks are not actually missing on the server, but they are not loaded on the client, due to network latency. 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 MC-526 and MC-315 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, you 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 F3+Awill 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. However, this can be considered x-raying and is therefore forbidden in most public servers.
This does not work in Pocket Edition because blocks behind unloaded chunks are culled.
- See also: Far Lands
Fake Chunks are non-solid chunks that generate past 30,000,000 meters from the spawn. A typical sign that the player has reached the edge of the map is that blocks appear fully lit past the 30,000,000 mark. When the player flies about 34 blocks past this perimeter the game freezes and begins to jitter with severe lagging, and the player can fall through the chunks into the Void and be killed. Fake Chunks could also generate in The Nether and have the same effects as in the Overworld.
Fake chunks consisted solely of basic blocks. In the Overworld, they were made of air, stone, dirt, grass, mycelium, bedrock, water, lava, and sometimes a single block of ice. In the Nether, they were made of air, netherrack, bedrock, and lava. Generated structures did not spawn in fake chunks, and those that were created partly inside one were cut off.
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. This ban message will say when you are kicked from the game: You are banned from this server! Reason: Went to illegal point.
In 1.8, 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 will have distorted textures and appear stretched.
- Falling sand and gravel appear in an incorrect position (due to a miscalculation in x and y values) until they fall completely down and turn back from an entity into a block.
- Items placed inside an Item Frame will appear 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.
- Hopper textures may appear distorted or transparent.
The chunks in the area immediately surrounding the world spawn point are special chunks that are never unloaded from memory as long as at least one player is in the Overworld. This means that things like redstone mechanisms and iron golem farms will continue to operate even when all players are very far away.
- This may solve the chunk error in some cases, but this is not guaranteed.
- One way to do this is to force a block update by placing a block or an item, such as a torch. This may solve the chunk error, though it is not guaranteed.