Spawn chunk

Spawn chunks are chunks found at the world spawn point which are always loaded in memory, unlike normal chunks which unload when no players are nearby.

Introduction
Normally, old chunks beyond player's chunk loading distance get unloaded from the memory and new chunks get loaded into the memory. Because of this, events such as redstone mechanisms and farms in unloaded chunks stop processing. Since spawn chunks remain loaded, events occurring in them continue to process, even if no players are nearby. If the world spawn is set to a laggy area using commands, such as an area with many redstone clocks, lag is present wherever the player is in the world.

Behavior


The so-called "spawn chunks" behavior arises from a start ticket which is created for the world spawn chunk. This ticket has a level of 22 which "propagates," or flows, to neighbouring chunks. Each time the level flows, it increases its level by 1 until the maximum of 34 is reached. This behavior is illustrated by the picture to the right.

Different levels of propagation have different behaviors. These levels are divided into 4 load types.

Limitations
There are some limitations which may affect the behavior of spawn chunks.

Each dimension has its own "idle timeout." Without a player or forceloaded chunks in the overworld, this timeout eventually expires. When the timeout expires, some behaviors such as entity processing stop for spawn chunks and the rest of the dimension. The timeout can be reset by frequently sending entities through a portal.
 * Idle timeout


 * Chunk tick

Only chunks with horizontal distance between its center and a player less than 128 blocks are ticked on every game tick. This stops events caused by random ticking, such as crop growth.


 * Entities


 * Hostile mobs more than 128 blocks from a player despawn.
 * Passive mobs only spawn inside a 240&times;240 block area around the player.
 * Passive mobs present in the spawn chunks count toward the mob cap. This often prevents friendly mobs from naturally spawning elsewhere in the world.

Changing location
A new world spawn point can be set using. If no coordinates are provided, the block position that the player is currently standing on becomes the spawn point. The chunk where the world spawn is located is then given a start ticket with a level of 22 and the ticket for the old spawn chunks is cleared.

History
Back in Java Edition 1.12 and 1.13, spawn chunks used to be a 16x16 grid of chunks, centered in the corner where the 4 center chunks met. This behavior changed in 1.14, when the center of the spawn chunks got changed permanently to be the center coordinate of a chunk. This change made it so that the spawn area grid became odd-numbered, and it has been that way ever since.
 * Earlier versions

This behavior can be emulated in 1.12 and 1.13 if the command is used. Invoking it near the center of a chunk in the X or Z coordinates will make that chunk effectively the center chunk of the grid at that axis, changing the grid's length in that dimension from 16 to 17. This allows for 16x17, 17x16 and 17x17 grid sizes in 1.12 and 1.13.

The ticking was also different from now: for a chunk to be treated as Entity Ticking (back then called "entity processing"), it needed to be surrounded by a 5x5 grid of Ticking chunks (back then called "lazy chunks") or higher. The default state for a loaded chunk was as Ticking, and if it then was surrounded by enough Ticking blocks, it got upgraded to Entity Ticking. No other type of chunk loading existed back then, so outside of the 16x16 Ticking area, no chunks were loaded without the presence of a player.

All of this meant that the behavior of spawn chunks was quite different from what it is now:
 * The larger 16x16 area was Ticking, and therefore was able to load entities and process redstone.
 * The requirement for Entity Ticking to be surrounded by a 5x5 grid of Ticking or higher chunks meant that, unlike it is nowadays, the Entity Ticking grid of the spawn chunks was only 12x12 chunks in size.

In 1.14, the chunk loading system was revamped, and with it, the modern concept of Load Levels and the behavior of Border and Inaccessible chunks was introduced. This chunk loading system has remained stable ever since, and thus the behavior in between 1.14 and today's versions is largely the same.
 * After the Chunk Loading revamp

The spawn chunks grid center was moved from a chunk corner to the center of the spawn point chunk, giving rise to an odd-numbered-size grid of chunks by default.

The changes introduced by the current loading system meant that the effective grid size became of 19x19 Entity Ticking (instead of 12x12) and 21x21 Ticking (instead of 16x16). It also includes a 23x23 Border grid and 25x25 grid, whose behavior did not exist prior to 1.14. These grid sizes are accurate from the 1.14 to 1.16 versions of the game.

スポーンチャンク 스폰 청크 Chunk spawnu Спаун чанков Geração de pedaço 出生点区块