Tick

From Minecraft Wiki
(Redirected from Redstone tick)
Jump to: navigation, search

Nearly all video games (including Minecraft) are driven by one big program loop. Just as every gear in a clock is synchronized with the pendulum, every task involved in advancing a game simulation is synchronized with the game loop. Appropriately, one cycle of the game loop is called a tick.

Game tick[edit]

Minecraft's game loop normally runs at a fixed rate of 20 ticks per second, so one tick happens every 0.05 seconds. An in-game day lasts exactly 24000 ticks, or 20 minutes. However, if the computer is unable to keep up with this speed, there are fewer game ticks per unit time. As the vast majority of actions are timed based on tick count rather than on wall clock time, this means that many things take longer on a slower computer.

On each tick, various aspects of the game advance a little bit; moving objects change position, mobs check their surroundings and update their behavior, health and hunger are affected by the player's circumstances, and much more.

One thing that does not happen as part of a tick is drawing graphics. Rendering happens after updating. This is why a varying frame rate does not affect the tick rate, which prevents video performance from affecting game mechanics.

Chunk tick[edit]

As a part of a game tick, specific chunks are ticked on every game tick.

In Java Edition, chunks with a load level of 31 or below and with centers within 128 blocks of a player are ticked on every game tick.

In Bedrock Edition, all loading chunks are ticked on every game tick.

This may have various effects:

  • Mobs naturally spawn.
  • During a thunderstorm, lightning may strike somewhere in the chunk (1100000 chance).
  • 116 chance that one column is chosen for weather checks on the topmost block:
  • A certain number of blocks within the chunk receive random block ticks, as described below.

Random tick[edit]

Chunks consist of sixteen so-called sections, each one a 16×16×16=4096 block cube. Three (or set by /gamerule randomTickSpeed) block positions are chosen at random from each section in the chunk. The blocks at those positions are given a "random tick". Most blocks ignore this tick, but some use it to do something:

Because random block ticks are granted randomly, there is no way to predict when a block can receive its next tick. The median time between ticks is 47.35 seconds. That is, there is a 50% chance for the interval to be equal or shorter than 47.35 seconds and a 50% chance for it to be equal or longer than 47.35. However, sometimes it is much longer or shorter: for example, there is a 1.5% chance for the interval to be less than one second and a 1% chance for the interval to be over five minutes. On average, blocks are updated every 68.27 seconds. For the math behind these numbers, see the Wikipedia entries for the geometric distribution.

Scheduled tick[edit]

Some blocks can request a tick sometime in the future. These "scheduled ticks" are used for things that have to happen in a predictable pattern—for instance, redstone repeaters schedule a tick to change state and water schedules a tick when it needs to move.

As a part of a game tick, each block position that has requested a scheduled tick gets ticked on a specific game tick.

The maximum number of scheduled ticks per game tick is 65,536.

Redstone tick[edit]

A redstone tick describes two game ticks. This creates a 110 of a second delay in the signal of a redstone circuit; that is, the signal's time to travel from a location A to location B is increased by 0.1 seconds. A tick pertains only to the increase in signal time, thus, a signal's travel time can never be decreased in reference to ticks. In the context of redstone, "tick" almost always refers to redstone ticks. A redstone repeater increases game ticks by 1-4 ticks. By default, it increases 1 tick in the redstone line. Pressing use item on the repeater increases it, and is visually indicated by the slider moving down the block. In the most recent versions of bedrock edition, command blocks have the ability to delay a command being executed, in redstone ticks.