Mineuniverse
Distance

Distance

In Minecraft, the distance between two points is the measurement of how far apart the two points are. The sides of a block are considered to be 1 meter…

7 min read Updated 7 views
Gameplay Game terms
Advertisement Remove ads with Premium →
Contents (8)
  1. Euclidean distance
  2. Spherical distance
  3. Usages
  4. Taxicab distance
  5. Usages
  6. Chebyshev distance
  7. Usages
  8. See also
See also: Tutorial:Units of measure § Distance and Distance effects
Taxicab distance compared to Euclidean distance. The two endpoints are also 3 and 4 blocks Chebyshev distance from the starting point.

In Minecraft, the distance between two points is the measurement of how far apart the two points are. The sides of a block are considered to be 1 meter (3.28084 feet or 1250⁄381 feet) in length. Distance in the game is measured in one of three ways, Euclidean distance, taxicab distance, or Chebyshev distance, depending on whether geometric accuracy or calculation efficiency is required.

In the following formulas, let two points in three dimensions have coordinates and and let be the distance between them.

Euclidean distance

Euclidean distance, also known as straight-line distance, measures the distance between two points using the length of the line segment between them. It is calculated via the Pythagorean theorem:

Spherical distance

The set of points within a given Euclidian distance, , of some point, form a sphere with radius centered at that point. This sphere is also referred to as a Euclidian sphere.

Usages

Minecraft uses Euclidean distance calculations in cases that are relatively infrequent or when accuracy is required. This is geometrically the most accurate calculation. However, the square root calculation is processor intensive, particularly on mobile devices that may have slow processors. Too many processor-intensive operations performed during a game tick can introduce lag in the game.

Situations in which Minecraft calculates Euclidean distance:

  • The detection range of most mobs, if they have a line of sight to the target.
  • The attenuation range of most sounds forms a Euclidean sphere with a radius of 16 blocks, centered on the source of the sound.
  • Monster spawners activate if a player is within 16 blocks of Euclidean distance.
  • Trial spawners detect players within 14 blocks of Euclidean distance.
  • Mob despawning range in Java Edition.
  • Disks in rivers and lakes generate as blocks within a Euclidean distance from a central block. (Small disks with a radius of up to three blocks including the center appear identical to a taxicab diamond, however larger sizes correctly reveal a more circular shape.)
  • Effects of explosions.
  • A Lightning rod redirects lightning within a Euclidean sphere with a radius of 128‌[JE only]/64‌[BE only] blocks, centered on the rod.
  • The /locate command prints the Euclidean distance from the caller to the located object in chat.
  • Nether portal searches for destination portals.
  • Sculk sensors and calibrated sculk sensors detect vibration emission in a spherical region.
  • Splash potions affect mobs inside a Euclidean sphere with a radius of 4 blocks.
  • Target selectors used in commands use Euclidean distances.
  • A zombie siege is started based on Euclidean distance between a player and the village center.

Taxicab distance

Taxicab distance as represented by Minecraft blocks rather than city streets

Taxicab distance, also known as rectilinear distance, city block distance, Manhattan distance, and other names, is a metric in taxicab geometry for measuring distance, as an alternative to Euclidean distance. It eliminates the square root and squaring operations by simply calculating the absolute value (positive value) of the difference between each coordinate value and is defined as:

Usages

Minecraft uses taxicab distance as an efficient range measurement in several elements of the game as it is a less accurate but faster calculation that can be done many times during a game tick. An obvious consequence of this calculation is that a taxicab "circle" drawn with a constant taxicab radius appears as a square whose vertices are in the directions of the axes (such as torch illumination), in which the taxicab radius equals the Euclidean radius only in the four cardinal directions (north, south, east, west), and the radius is shorter in all other directions. Similarly, in three dimensions, a taxicab "sphere" appears as an octahedron.

Situations in which Minecraft calculates taxicab distance:

  • Light from light sources such as torches, campfires, lanterns, glowstone, etc. illuminate surfaces according to taxicab distance.
    • As a direct result of this, torches melt snow layers within 2 blocks and ice within 3 blocks taxicab distance. Several other light-emitting blocks also melt snow in a taxicab radius; see Snow § Melting.
    • Heat blocks‌[Minecraft Education only] melt snow layers and ice within 2 blocks taxicab distance, but do not emit light.
  • Liquid (water or lava) flowing horizontally on a flat surface flows from the source in taxicab distance. For example, if flowing water is forced into a 1-block-wide stream and turns corners, it travels 7 blocks. If it is allowed to flow freely on a surface, it also travels 7 blocks taxicab distance.
  • Redstone wire signals spread this way, as can be seen if a large plane of the substance is laid out.
  • Levers and buttons emit a redstone signal in a 1-block planar taxicab distance around them.
  • In Bedrock Edition, simulation distance is the distance from the player at which blocks get tick updates (such as lightning strikes), and beyond which mobs despawn; this also uses taxicab distance.
  • In Bedrock Edition, a monster spawner spawns mobs within a 4-block taxicab horizontal range from the monster spawner.
  • A sponge absorbs water up to 7 blocks away in taxicab distance (an octahedral volume centered on the sponge).
  • Leaves and scaffolding determine their distance from the center via a "distance" block state determined by taxicab distance.
  • Using bone meal on sea pickles that are on coral blocks creates more sea pickles on nearby coral blocks out to a horizontal taxicab distance of 2.
  • A block of copper is oxidized according to a taxicab distance search for unwaxed copper blocks within 4 blocks of the block being considered for oxidation.
  • Shulkers can move along only one of the three grid axes at a time and on integer steps, meaning that they move according to taxicab geometry.
  • Some redstone components produce block updates up to two blocks away by taxicab distance, including up and down.
  • In basalt deltas, blobs of basalt and blackstone propagate from the center within a 3—7 block taxicab distance.

Chebyshev distance

Chebyshev distance, also know as the chessboard distance or maximum metric, is the maximum absolute difference between two points in one of three axes:

A "circle" drawn with a Chebyshev-distance radius would appear as an axis-aligned square, and a "sphere" would appear as a cube.

Usages

Computationally, Chebyshev distance is roughly as efficient as taxicab distance, but it is useful for effects that need to happen in a square area or cuboid volume from a center coordinate.

Situations in which Minecraft calculates Chebyshev distance:

  • Determining whether farmland is hydrated by a block of water in range of 4 blocks.
  • A villager in Java Edition detects an iron golem within ±16 blocks on any axis.
  • An iron golem in Bedrock Edition spawns within ±8 blocks horizontally and ±6 blocks vertically from the village center block.
  • The horizontal range of a beacon, which is 20, 30, 40 or 50 blocks depending on the size of the beacon pyramid.
  • Phantoms in Java Edition spawn 20–34 blocks above the player, and off to the side by a Chebyshev distance of up to 10 blocks.
  • The spawning range of wardens from naturally generated sculk shriekers is ±5 blocks horizontally and ±6 blocks vertically from the shrieker.
  • In Java Edition, the load level of a chunk decreases in a square pattern.

See also

Advertisement Remove ads with Premium →

More in Gameplay

View all 133 →
Damage/MobsThe damage mobs deal to players is affected by the difficulty setting of the world they are in. The values below represent the amount of damage taken per…DeathDeathDeath is a game mechanic related to health, which occurs when the health of an entity reaches 0HP.Death messagesDeath messagesDeath messages are messages shown on the death screen and sent in the chat to either all players or a specific player to announce the death of a player or…DifficultyDifficultyDifficulty is an option in Minecraft that has a direct impact on the ease of gameplay, allowing the game's challenges to be tailored to the player's skill…DropsDropsDrops are collectible objects that appear when mobs and some other entities die or when most kinds of blocks are broken. In most cases, these consist of…Dual wieldingDual wieldingDual wielding is a gameplay mechanic that allows players (and some mobs) to hold two items or blocks‌[Java Edition only] simultaneously.DurabilityDurability is a property that affects tools, weapons, and armor. It restricts the time(s) that the items can be used. The durability bar starts at green…EffectEffectAn effect (also known as a mob effect or status effect) is a condition that affects an entity, either negatively, positively, or neutrally. Effects…
Advertisement Remove ads with Premium →

Related mods

Better Fps - Render Distance Better Fps - Render Distance Mod · 89.1M downloads Dynamic View and Simulation Distances Dynamic View and Simulation Distances Mod · 27.6M downloads Better Fps - Render Distance[Fabric] Better Fps - Render Distance[Fabric] Mod · 15.2M downloads Crab Claws - Place/Break blocks from a distance! Crab Claws - Place/Break blocks from a distance! Mod · 4.6M downloads
Explore the Minecraft Wiki
Blocks, items, mobs, biomes and game mechanics — all in one place.
Wiki home