Rail

Rails (also known as minecart tracks) are non-solid blocks that provide a path along which minecarts can travel.

Obtaining
Rails can be mined with anything, but pickaxes are the quickest.

They also drop as items when:
 * the block beneath them falls, is moved, or removed
 * a liquid flows over them
 * a piston moves them into a space with no floor below them

Natural generation
Rails can be found naturally in abandoned mine shafts.

Usage
When placed a rail will configure itself to be straight or curved according to rail objects around it.
 * If there are no other rails adjacent it will be placed as a straight track oriented north-south.
 * If placed at the end of an existing stretch of track (so any of rails, activator rails, detector rails, and powered rails) the new rail be a straight track section oriented to continue the existing track, either east-west or north-south.
 * If placed beside an existing stretch of track (of any type) the newly placed rail will be straight and oriented north-south.
 * If there are two adjacent rails on its level, or one level up or down, the newly placed rail will configure itself to connect the other two. This means that it will be placed as a straight or curved track as needed.
 * If placed between three adjacent rails (thus always forming a T-junction) the newly placed rail will be placed as a curved track south-to-east, north-to-east, or south-to-west to join those sides.

Note that the behaviour of carts in the two non-curved intersection instances is not at all what one would expect from the way the curved intersection is placed.

N.B. the yellow sandstone block to the right in the above three images marks the south direction.

Existing sections of track may be re-oriented, become sloping, or even change into curved sections when new rail is placed adjacent to :
 * An existing straight, north-south rail will re-orient to east-west when a new block is placed to its east or west sides.
 * If placed next to an existing rail that is one block up or down the rail will slant up or down to join it. Rail "prefers", in order: west, east, south, and north. Other configurations can be created by placing and removing rails.
 * If a track is placed perpendicular to an existing length of track it will show as a straight rail, but in fact will be curved according to the patterns for tee junctions as seen above and mine carts going through the intersection will turn the corner. Breaking and re-laying track so that the intersection block is laid last will update the intersection block as a curved section.

Best Practices for Laying Track
The performance of a rail line is affected by the way the track is placed. Running track next to a wall, placing lampposts next to it, or having hills to climb will adversely affect the speed of a cart, and so its distance travelled.

A distance trial track was constructed to see how far different carts would travel, with and without loads. When darkness set in a number of lamps were placed on blocks set next to the track so that observations would remain accurate, but the distance achieved in all cases fell to a fraction of what it had been. For instance a player riding in a cart could reach the end of a 250 block long rail line before the lamp posts were installed, but could only reach block 187 with them in place. While trying to understand for the reason for the change the testing surface was cleared down to the white floor and the distances travelled returned to there previous, much longer, values. To confirm the slowdown was caused by interaction with the blocks next to the track a wall was placed along it. The distance travelled again fell to 187 blocks, as marked by the red sandstone column in the images.

Some YouTube videos suggested that diagonal track might offer better performance than straight runs. This has not proven to be the case .. another distance trial track was constructed with a length of 300 blocks. Carts with no rider travel the same distance as on the straight track, about 18 blocks before they stop, and a cart with a player riding can make it to the end of the track. The interaction with blocks next to the track seems to be a little stronger with carts on diagonal track. With lampposts placed only ever 10 blocks along the track an unmanned cart could only cover 12 blocks, and with a player riding just over 180 blocks, a significant reduction.

A mine cart with no rider, at full speed can climb 10 blocks on unpowered track. This suggests that powered track is only needed at this height to keep a cart climbing. However, the cart slows so much that it can only reach another 5 blocks high with 2 lengths of powered track starting at 9 blocks high. Further testing showed the minimum number of powered blocks to keep the cart climbing is 3 every 6 blocks - so a ratio of one to one, at the cost of a strong reduction in speed. To maintain speed in a climb a ratio of 5:4, powered versus regular rail segments, is a good compromise for decent speed at a reasonable cost.

Carts with a rider, or chest carts, have more momentum and so climb higher than one that is unloaded. With a rider a cart can climb at least 24 blocks before needed powered rails to go higher.

Redstone Controls
The intersection rail at a T intersection may be made to change its direction of curvature by applying redstone power using a redstone torch or lever.

Separate tracks laid adjacent but at the next level lower or higher can sometimes cause issues but normally will not interact with the switched railer r

South-east rule


When entering a Tee intersection from the "back of" the curved rail a mine cart will travel straight through the intersection. Entering from either of the other two legs it will follow the curve.

In a 4-way intersection constructed to have no curved rail a cart will pass straight through in the direction of the continuous line. When entering the 4-way from east or west a cart will turn according to the South-East Rule.

Downhill rule


At non-curve track intersections minecarts will always travel downhill if they can. This is known as the downhill rule and overrides the south-east rule.

Mine Cart movement
A cart moving with enough speed is able to jump single block gaps in a rail line and continue on travelling.

Ramp clearance/one-way effect


A block placed above the track at the downhill end of a ramp will prevent minecarts from traveling down the slope, but not up. In order for a minecart to move down a diagonal tunnel, there must be just as much clearance as a player needs to walk it.

Curve intersections


If a straight track piece leads to a curve block and isn't attached to the curve, a minecart will run over the gap and continue to go straight over the curve. This is not applicable with other types of rails.

Notably, the minecart can exceed the normal 8 m/s speed limit while it jumps over the gap. For example, by placing intersections on every other block of a straight track, it is possible to travel at 10 m/s in a straight direction (but it will be a very uncomfortable ride).

Data values
Every rail has an ID name of  and stores its orientation in its block data. A rail also has a block state which is expected to replace the functionality of block data in a future version.

Block data
A rail's block data specifies the directions to which it connects.

Trivia

 * When walking on a block that has a rail on top, you will hear the sound of the block you're walking on, but if you jump (while still walking), you will hear the sound of iron.
 * Rails are approximately 2-foot gauge (the gauge is the distance between the rails).

Gallery
Schiene Raíl Rails Sín レール 레일 Spoor Tory Рельсы 铁轨