01 Rails
1 Rail Updates
Special rails (Powered Rails, Activator Rails, Detector Rails) all have special update ranges, unlike plain rails.
1.1 Powered Rail/Activator Rail Updates
Powered Rails and Activator Rails have identical update behavior.1
When a Powered Rail/Activator Rail's activation state changes, it emits NC updates in sequence from these positions:
- One block above (if the rail is sloped)
- Itself
- One block below
- Itself
- One block below
- One block above (if the rail is sloped)
In other words, a flat Powered Rail/Activator Rail emits 4 NC updates with sources: itself->below->itself->below.
A sloped Powered Rail/Activator Rail emits 6 NC updates with sources: above->itself->below->itself->below->above.
1.2 Detector Rail Updates
Not yet completed
2 Rail Activation Detection
Throughout this section, "rails" refers to Powered Rails and Activator Rails.
2.1 Activation Methods
There are two conditions that can activate a rail:
- Direct activation: the rail is directly adjacent to a redstone signal source.
- Indirect activation: among the 8 rails connected to it (excluding itself), at least one is directly adjacent to a redstone signal source.
For example, if a rail is directly adjacent to a Block of Redstone, it is directly activated.
If a rail is connected to several other rails forming a chain, and a Block of Redstone is adjacent to any rail within 8 blocks along that chain, then the rail is indirectly activated.
2.2 "Connected" Judgment Conditions
A rail that is not directly activated uses a "search" mechanism to determine whether it is indirectly activated. Specifically, it searches for a connected, directly activated rail within 8 blocks of itself.
To put it simply: imagine you're going to a restaurant. You open a map, search for the restaurant, and see if you can walk there. The restaurant won't fly to you and say "I'm 800m away, come walk over."
Rails work the same way. Each rail "searches" for qualifying signal sources on its own. It tries to "walk" along the rail chain for up to 8 blocks to see if it can find a signal source, that is, a rail directly connected to a signal source.
Intuitively, if the rail "walks" halfway and the rail chain is "broken," it can't continue walking.
When a rail searches for connected rails at a certain position, it searches for rails at specific positions with the same direction as itself, based on its own shape (i.e., whether it is sloped). Whether a rail considers the next rail connected depends only on these three factors:
- Its own shape (whether it is sloped)
- The position of the next rail
- The direction of the next rail
It is independent of the shape of the next rail.
Flat rails will check these positions:
- Positions at both ends of the rail, at the same height as itself
- Positions at both ends of the rail, one block lower than itself
The range is shown by the red glass positions in the image:
For example, when the flat rail on the far right is "searching" to the left for directly activated rails, it considers the rail on the left connected to itself. The first three cases in the image are straightforward, while the last one occurs because rails do not consider the shape of the next rail when checking connectivity:
Sloped rails will check these positions:
- Position at the lower end of the sloped rail, at the same height as itself
- Position at the lower end of the sloped rail, one block lower than itself
- Position at the higher end of the sloped rail, one block higher than itself
The range is shown by the red glass positions in the image:
For example, when the sloped rail on the far right is "searching" to the left for directly activated rails, it considers the rail on the left connected to itself. The first three cases in the image are straightforward, while the last one occurs because rails do not consider the shape of the next rail when checking connectivity.
Combining the above two points, we can see that rail "connectivity" is unidirectional: when rail A considers rail B connected to itself, rail B does not necessarily consider rail A connected to itself:
In the rail chain shown in the image, the redstone signal can propagate from right to left, but not from left to right. From the "search" perspective, this means: the sloped rail on the left considers the flat rail on the right not connected to itself, while the flat rail on the right considers the sloped rail on the left connected to itself.
Looking at the positions where these two rails check for connectivity: in the image above, the horizontal positions corresponding to the orange glass are where the sloped rail checks for connectivity, and the horizontal positions corresponding to the red glass are where the flat rail checks. The sloped rail is at the checking position of the flat rail, while the flat rail is not at the checking position of the sloped rail, which makes rail connectivity unidirectional.
This can be used to create rail chains that can only transmit rail signals in one direction.
2.3 Direction of Search
Rails follow a fixed order when searching for connected rails: each end is searched independently, and each search is unidirectional (no backtracking).
- Search process: First, search outward from one end along that direction. During the search, the direction does not change (i.e., only "forward," no "backward"). After the search at that end is complete, repeat the same process for the other end.
- Direction rules: North-south oriented rails always search south first, then north; east-west oriented rails search west first, then east.
Therefore, whether multiple rails are considered "connected" depends not only on distance, but also on the search direction order. This explains the difference shown in the diagram: in the first case, the rails on both sides of the Block of Redstone can be found and activated. In the second case, only the rail on the left side of the Block of Redstone can be activated, because the search direction on the right side cannot pass through a certain rail in the middle to reach the target position, and thus cannot find the directly activated rail.
As shown in the image, in the first case, the rails on both the left and right sides of the Block of Redstone can be activated.
In the second case, only the rail on the left side of the Block of Redstone can be activated. When the rail on the left side searches to the right for directly activated rails, it first finds rail #2, then searches to the right (down) to find rail #3.
When the rail on the right side of the Block of Redstone searches to the left for directly activated rails, it also first finds rail #2. But since the search direction at this time is to the left, and rail #3 is on the right side of rail #2, it cannot search for rail #3, and thus cannot find the directly activated rail or be activated.
Footnotes
-
Powered Rails and Activator Rails are both implemented by the
PoweredRailBlockclass, so their behavior is completely identical at the source code level. The different effects they produce on minecarts are determined and handled by the minecarts themselves, not by the rails. ↩




