01 Tick and Inter-Tick Timing
We have already learned about update theory in the previous article, but curious Little B decided not to stop there. He took out the
Redstone RepeaterRepeater from the creative inventory and pulled down a lever.Perhaps Little B was being overly sensitive, but when he pulled the lever, he noticed that the Repeater didn't seem to light up immediately. He thought the game had a bug and tried several more times. He quickly realized this was a stable, reproducible phenomenon. Clearly, unlike the numerous instantaneous phenomena we discussed in the previous article, an asynchronous phenomenon appeared here, which he called delay.
1 Game Tick, Redstone Tick, and Delay
In Minecraft, many events need to be processed. These events are processed sequentially in a large loop, which we call the game's main loop. When the game is running normally (without the /tick command), this main loop cycles approximately 20 times per second. We call this minimum interval a GameTick, abbreviated as gt. For historical reasons, we still use the notation RedstoneTick in some cases, abbreviated as rt. It has the following conversion relationship with gt: .
This means:
- 1gt = seconds = seconds
- Even if Minecraft has sufficient computing power and completes all the calculations needed for this gt in less than 0.05 seconds, it will stop calculating until the next gt arrives.
Therefore, players use two metrics to measure lag: TPS and mspt. TPS stands for Tick Per Second and refers to the number of game ticks executed per second. Normally, this value is 20, but when the game lags, it drops below 20. mspt stands for Millisecond Per Tick and is the number of milliseconds the game needs to execute each tick. The lower the value, the less the game lags.
Note that mspt always maintains the following relationship with TPS:
- When mspt is below 50, TPS is 20
- When mspt is greater than 50, TPS =
In the game, most redstone components have delayed responses. We measure a component's macroscopic delay in gt. The delays of some components are as follows:
- Repeater: 2-8gt
- Comparator: 2gt
- Observer: 2gt
- ...
2 Repeater and Comparator Basics
Repeaters and Comparators have macroscopic delays. The delay of a Repeater is related to its gear setting, while the delay of a Comparator is always 2gt.
The basic function of a Repeater is to amplify signals. It converts any redstone signal with non-zero strength into a strength-15 signal after the specified number of game ticks.
When a Repeater's side is directly powered by an adjacent Repeater or Comparator, it enters a "locked" state. In this state, any changes to its input do not affect its on/off state until the side input ends. After the corresponding gt delay, if the state needs to change, it updates accordingly.
A Comparator has three inputs: the front and two side inputs. When there is no input on the sides, it directly outputs a signal matching the front input's signal strength. When there is input on its sides, the Comparator's behavior depends on its mode. The Comparator has two modes:
- Compare mode
- Subtract mode
By default, it uses Compare mode. When the Comparator is in Compare mode, it always follows this logic for output:
Take the maximum of the left and right inputs. If this maximum is greater than the front input, no output is produced; otherwise, output the front input.
When the Comparator is in Subtract mode, it always follows this logic for output:
Take the maximum of the left and right inputs. If this maximum is greater than the front input, no output is produced; otherwise, output (front input - maximum of side inputs).
The interaction between Comparators and containers is not discussed here.
3 Charging Theory
We establish charging theory to explain a phenomenon that occurs with components such as Repeaters and Comparators, where blocks power Redstone Dust or other Repeaters/Comparators.
We define that for any chargeable block, it has two charging states: strong charging and weak charging.
When a chargeable block is strongly charged, it can activate Redstone Dust in all six adjacent directions, regardless of orientation. When weakly charged, it can only activate Repeaters, Comparators, and some other redstone components whose inputs face the chargeable block. This is also an important way to distinguish between the two types of charging.
The following methods can make a block strongly charged:
- Repeaters, Comparators, Redstone Torches, and Observers directly emit signals toward the chargeable block.
The following methods can make a block weakly charged:
- A chargeable block is pointed to by Redstone Dust with a signal strength not equal to 0.
In Minecraft, most blocks are chargeable, so we distinguish chargeable from non-chargeable blocks by whether they cut lines. Cutting lines is when a block cuts off vertically connected Redstone Dust. However, some blocks, such as glass, slabs, half-slabs, chests, etc., do not cut lines, making them non-chargeable. We define Pistons/Sticky Pistons as non-chargeable blocks as well.
4 Inter-Tick Timing
This section explains basic timing analysis.
This example uses gt to analyze simple timing.
As shown in the figure, when the lever is pulled down, the Repeater on the right activates after a delay of 8gt and strongly charges the block. Now, the Comparator's side input in Subtract mode is 14, while the front input is 15. 15-14=1>0, so it activates the redstone lamp after a delay of 2gt, for a total delay of 10gt.
The Comparator on the left is in Compare mode. Its front and side inputs are both 14. Since they're equal, after a delay of 2gt, it outputs a strength-14 signal, strongly charging the block in front of it. Then the Repeater activates the redstone lamp after a delay of 6gt, for a total delay of 8gt.





