Each tick (1/20 of a second), all chunks within a certain radius of the player run updates. In 1.9pre5 the radius is 7, so the update area is a 15x15 chunk square centered on the chunk containing the player.
When a chunk updates, it does the following 20 times:
- Pick a random block in the chunk.
- If that block is eligible for random updates, update the block.
(The 20 selections are independent, so the same block can be picked more than once.) The probability of a particular block being chosen is about (20 / (16*16*128)) = 0.061%.
If a selected block is a crop which is not fully grown, and its growth conditions are met, then it makes a grow check.
- Wheat: The plant will grow only if the block above it has light level
of 9 or higher.
The grow check passes with probability 1 in
floor(25 / growth_rate + 1)
, wheregrowth_rate
is calculated as described on the wiki.If the grow check passes, the plant grows by 1. - Nether Wart: The plant will grow only if it is in a nether biome. The grow check passes with probability 1 in 15. If the grow check passes, the plant grows by 1.
- Sugar Cane or Cactus: The plant will grow only if it is less than 3 blocks tall and there is air above it. The grow check always passes, but instead of growing, an internal counter is increased by 1. When the counter reaches 15, it is reset to zero and the plant grows by one block.
- Mushrooms (either color):
The plant will grow only if there are fewer than 5 mushrooms of the
same color within the 9x3x9 region centered on the plant.
The grow check passes with probability 1 in 25.
If the grow check passes, the plant attempts to grow to a nearby
square, as follows:
- Begin with the current position set to the position of the original plant.
- Compute the offset position as follows: Start at the current position. Move to any square in the surrounding 3x1x3 region with equal probability. Now move up (+Y) with probability 1/4, move down with probability 1/4, or stay at the current Y with probability 1/2.
- If the block at the offset position is suitable for mushroom placement, set the current position to the offset position. Otherwise, keep the previous value for the current position.
- Compute an updated offset position as in step 2.
- Repeat steps (3) and (4) three more times.
- If the final offset position is suitable, place a mushroom there.
- the location has light level of 12 or lower and the block below is opaque; or
- the block below is mycelium.
- Melon Stem or Pumpkin Stem:
The plant will grow only if the block above it has light level of 9 or higher.
The grow check passes with probability 1 in
floor(25 / growth_rate + 1)
, wheregrowth_rate
is calculated just as for wheat, but considering only stems of the same type when checking adjacent squares. If the grow check passes, the plant grows by one level if it is not fully grown. If the check passes on a fully grown plant, the plant instead attempts to produce fruit (melon or pumpkin), as follows:- If there is a fruit block of the same type to the north, south, east, or west of the stem, do not produce more fruit.
- Pick a random direction (north, south, east, or west). If there is an air block on that side of the stem, and the block below that is farmland, produce a fruit block in that direction.
- Sapling: The plant will grow only if the block above it has light level of 9 or higher. The grow check passes with probability 1 in 7. When the grow check passes for the first time, a flag is set to indicate that the check has passed once. The second time the grow check passes, the tree will attempt to grow.
- Grass:
The plant will grow only if the block above it has light level of 9 or higher.
The grow check always passes.
When the plant grows, it randomly selects four blocks from the 3x5x3 region centered on the plant.
For each selected block, grass spreads to that block if it meets the following conditions:
- The block itself is a dirt block.
- The block above has light level of 4 or higher.
- The block above is not a semi-opaque block (farmland, slab, or stairs).