Simulation distance

Simulation distance is a world-creation setting $$ that controls mob spawning and despawning, and tick updates. $$, simulation distance is a video setting related to render distance, to restrict tick update distance.

Control
The simulation distance control appears in the settings page when creating a new world. The values that can be set range from 4 to 12 in increments of 2 (even numbers only).

Tick updates
Simulation distance determines the maximum chunk distance in which entities get updated, and blocks and fluids are ticked. This is not a Euclidean distance, but taxicab distance in Bedrock Edition.

Spawning and despawning
Simulation distance restricts the maximum distance at which mobs spawn and despawn.

The minimum spawning distance is 24 blocks (Euclidean distance) from the player. The maximum spawning distance and despawning distances are determined by the simulation distance, which is a quasi-spherical shell having the following ranges relative to the player:

Within the simulation distance, there is a $11/2000$ chance of the mob spawning algorithm attempting to run per chunk, per tick.

Realms worlds use a simulation distance of 9 chunks $$ and 4 chunks $$.

Regardless of simulation distance, mobs with persistence do not despawn, and fish always despawn when they are more than 40 blocks from the nearest player.

Mob cap
Mobs in chunks outside a ticking area still count toward the per-mob population control caps as long as they were previously loaded within the simulation distance at some time.

Java Edition
In Java Edition, the minimum value of simulation distance is 5. The maximum value is the same as for render distance: 32 for 64-bit Java installations with at least 1 gigabyte of memory, and 16 in all other cases. If render distance is set to a lower value than simulation distance, the lower value is used instead.

Simulation distance defines a square region of chunks around the player where entities are ticked. Using distance of 6 for instance, entities move normally within a 13×13 chunk column around the player chunk. One more chunk out, within a one-chunk-thick square frame surrounding this region, redstone still runs, fluids flow, and crops grow (subject to normal chunk ticking rules). Beyond that nothing moves or changes. Using a simulation distance of less than 8 may cause hostile mobs to spawn in the outer frame non-entity-ticking chunks as long as the spawn position is still within a 128 block radius sphere around the player; however, because they are not ticked, the mobs do not move or despawn naturally and cannot be killed by command, even though they still contribute to the mob cap. They despawn once the player moves more than 128 blocks away.

Custom Minecraft server software may change these rules, such as making entity-ticking chunks a circular region and not a square.

The simulation distance setting is ideally less than render distance because updating all entities within the simulation distance is more taxing on performance than the equivalent level of render distance.

Entity Visibility
Not all entities within the loaded and visible chunks will be displayed to the player. There are three criteria that will hide entities from view. First, the server will not send any information about an entity to the client if the entity is beyond a certain distance from the player, controlled by "entity-broadcast-range-percentage" in vanilla server server.properties file, or "entity-tracking-range" in Spigot server spigot.yml file. Entity-tracking-range is a horizontal radius in blocks (48 for mobs and 32 for items by default), defining a circular column (extending without limit vertically) around the player outside which entities are not displayed as no data about them is known to the client. Second, the client will not render entities depending on both "Render distance" and "Entity distance" video settings. Apparently, render distance (in chunks) multiplied by a magic number (about 8.5 for mobs, 2 for items) and scaled by the "entity distance" percentage gives the radius in blocks for a sphere around the player beyond which entities are hidden. For example, using render distance 10 and 100% entity distance, a skeleton will disappear from view if the player stands more than 85 blocks directly above it. The magic number varies slightly for different types of mobs, such as being larger for spiders and ghasts, even though ghasts still frequently attack player from beyond visibility range. Finally, the client has a hard visibility limit of 128 blocks horizontally, defining another circular column. Entities will only be displayed if they are inside the intersection of this sphere and two cylinders.