Minecraft:Random Tick: Difference between revisions
More actions
Sync: new page from Minecraft |
Sync: updated from Minecraft |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{about|random ticks that update blocks|other types of ticks|Ticks|the command|Game Rule # Random Tick Speed}} | {{about|random ticks that update blocks|other types of ticks|Ticks|the command|Game Rule # Random Tick Speed}} | ||
{{stub|Add more detail, and | {{stub|Add more detail from code, and add list of estimation times}} | ||
{{More images|Add crops, spreading, uprooting, growth particles, all blocks that can be random ticked}} | |||
A '''random tick''' is a feature that updates [[Minecraft:block|blocks]] in every sub-chunk around the player. Blocks that update in this [[Minecraft:tick]] will perform an action, usually [[Minecraft:Spread|spreading]] or changing their [[Minecraft:Block states|state]]. | |||
__TOC__ | __TOC__ | ||
== Calculation == | == Calculation == | ||
The position | {{main|Tick#Random tick}} | ||
The position of a '''random tick''' is calculated by choosing random blocks inside a '''subchunk''' during the chunk tick phase. The number of blocks is determined by the {{cmd|gamerule random_tick_speed}}, a direct relationship {{in|java}} when the value is the number of blocks chosen, while {{in|bedrock}} it only specifies the relative speed instead of the exact number. '''Subchunks''' are 16 block vertical segments inside each chunk, with a volume of 16x16x16. If any block chosen has a random-ticking function, it will be called and the block may do something. Any block in the subchunk can be chosen, including [[Minecraft:Air|air]]. One block can also be chosen multiple times.{{only|java}}{{verify}} | |||
The chance of a block being '''selected''' ''at least once'' is then: | |||
<math>1 - (\frac{4095}{4096})^{n}</math><ref group="note">This assumes that a block can be selected multiple times, otherwise the chance that a block is selected is <math>\frac{n}{4096}</math>. The difference between these results is very small though.</ref>, where ''n'' is the number of blocks selected. This is <math>1 - (\frac{4095}{4096})^3 \approx \frac{1}{1365.36} \approx 0.073224%</math> for '''default''' random tick speed. | |||
<references group=note/> | |||
== Effects == | == Effects == | ||
Many things may happen when a block is ''random-ticked'', including: | |||
*[[Minecraft:Crops]] may grow or uproot. | *{{ItemSprite|Seeds}} [[Minecraft:Crops]] may grow or uproot. | ||
*[[Minecraft: | *{{BlockSprite|Red Mushroom}} [[Minecraft:Mushrooms]] may spread or uproot. | ||
* | *{{BlockLink|Vines}}, {{BlockLink|twisting vines}}, {{BlockLink|weeping vines}}, and {{BlockLink|cave vines}} may spread. | ||
*{{BlockLink|Ice}} and {{BlockLink|snow}} layers may melt. | |||
* | *{{BlockLink|Leaves}} may decay. | ||
* | *{{BlockLink|Farmland}} hydration is updated. | ||
* | *{{BlockLink|Cactus}}, {{BlockLink|sugar cane}}, {{BlockLink|kelp}}, {{BlockLink|bamboo}}, {{BlockLink|chorus flower|chorus flowers}}, {{BlockLink|mangrove propagule|mangrove propagules}}, {{BlockLink|sweet berry bush|sweet berry bushes}}, {{BlockLink|cocoa|cocoa pods}} and {{BlockLink|nether wart}} may grow. | ||
* | *{{BlockLink|Grass block|Grass blocks}} and {{BlockLink|mycelium}} may spread. | ||
* | *{{BlockLink|Grass block|Grass blocks}}, {{BlockLink|mycelium}}, and {{BlockLink|nylium}} may decay (only if the condition is met). | ||
*Grass blocks, mycelium, and | *{{BlockSprite|Oak Sapling}} [[Minecraft:Sapling]]s may grow into a [[Minecraft:tree]]. | ||
*[[Minecraft:Sapling]]s may grow into a [[Minecraft:tree]]. | *{{BlockLink|Lava}} may set fires nearby.<ref group=note>{{IN|JE}}, this requires a player within an 8-chunk radius. However, {{cmd|gamerule allowFireTicksAwayFromPlayer}} removes this requirement if set to true.</ref> | ||
* | *{{BlockLink|Mud}} may turn into {{BlockLink|clay}} if placed on top of a block with {{BlockLink|pointed dripstone}} underneath. | ||
* | *{{BlockLink|id=all-redstone-ore|Lit redstone ore}} turns off. | ||
*Lit | *{{BlockLink|Nether portal}} blocks may spawn a [[Minecraft:zombified piglin]]. | ||
* | *{{BlockLink|Turtle egg|Turtle eggs}} crack or hatch. | ||
* | *{{BlockLink|Budding amethyst}} may grow an {{BlockLink|amethyst bud}} on any of its sides as longs as there is no solid block. | ||
* | *{{BlockLink|Block of Copper|text=Copper blocks}} (or any of its non-oxidized variants) may advance one stage in [[Minecraft:oxidation]]. | ||
*{{BlockLink|Pointed dripstone}} may fill a {{BlockLink|cauldron}} below. | |||
* | *{{BlockLink|Pointed dripstone}} and {{BlockLink|sulfur spike|sulfur spikes}} may grow a stalagmite/stalactite if the conditions are met. | ||
* | *{{BlockLink|Dried ghast|Dried ghasts}} start a 250 second delay (5000 [[Minecraft:tick]]s) until they hydrate or dehydrate. | ||
* | *{{BlockSprite|Open Eyeblossom}} [[Minecraft:Eyeblossom]]s may change state. | ||
*{{BlockLink|Fire}} and {{BlockLink|soul fire}} may burn out or spread.{{only|bedrock|short=1}} | |||
<references group="note"/> | <references group="note"/> | ||
==Time estimation== | |||
Because random block ticks are granted randomly, there is no way to predict when a block can receive its next tick. {{IN|java}}, the ''median'' time between ticks is '''47.30''' seconds (<math>\log_{\frac{4096-3}{4096}}(0.5) \approx</math> 946.03 game ticks). That is, there is a 50% chance for the interval to be equal or shorter than 47.30 seconds and a 50% chance for it to be longer than 47.30. However, sometimes it is much longer or shorter: for example, there is a 1.38% chance for the interval to be less than one second and a 1.23% chance for the interval to be over five minutes. On ''average'', blocks are updated every '''68.27''' seconds (<math>\frac{4096}{3} \approx</math> 1365.33 game ticks). For the math behind these numbers, see the Wikipedia entries for the [[Minecraft:wikipedia:geometric distribution|geometric distribution]]. | Because random block ticks are granted randomly, there is no way to predict when a block can receive its next tick. {{IN|java}}, the ''median'' time between ticks is '''47.30''' seconds (<math>\log_{\frac{4096-3}{4096}}(0.5) \approx</math> 946.03 game ticks). That is, there is a 50% chance for the interval to be equal or shorter than 47.30 seconds and a 50% chance for it to be longer than 47.30. However, sometimes it is much longer or shorter: for example, there is a 1.38% chance for the interval to be less than one second and a 1.23% chance for the interval to be over five minutes. On ''average'', blocks are updated every '''68.27''' seconds (<math>\frac{4096}{3} \approx</math> 1365.33 game ticks). For the math behind these numbers, see the Wikipedia entries for the [[Minecraft:wikipedia:geometric distribution|geometric distribution]]. | ||
Some blocks also have additional conditions for growing | Some blocks also have additional conditions for growing. [[Minecraft:nether Wart|Nether wart]] has only a 10% chance to grow one growth stage, with 3 growth stages before it is fully grown. This means that it takes 34.1333 minutes on average for nether wart to fully grow. | ||
== Navigation == | |||
{{Navbox Java Edition technical|general}} | |||
{{Navbox Bedrock Edition}} | |||
[[Category:Game terms]] | |||
Latest revision as of 11:15, 18 October 2026
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
Template:Stub Template:More images
A random tick is a feature that updates blocks in every sub-chunk around the player. Blocks that update in this Minecraft:tick will perform an action, usually spreading or changing their state.
Calculation
Template:Main The position of a random tick is calculated by choosing random blocks inside a subchunk during the chunk tick phase. The number of blocks is determined by the Template:Cmd, a direct relationship Template:In when the value is the number of blocks chosen, while Template:In it only specifies the relative speed instead of the exact number. Subchunks are 16 block vertical segments inside each chunk, with a volume of 16x16x16. If any block chosen has a random-ticking function, it will be called and the block may do something. Any block in the subchunk can be chosen, including air. One block can also be chosen multiple times.Template:OnlyTemplate:Verify
The chance of a block being selected at least once is then: <math>1 - (\frac{4095}{4096})^{n}</math><ref group="note">This assumes that a block can be selected multiple times, otherwise the chance that a block is selected is <math>\frac{n}{4096}</math>. The difference between these results is very small though.</ref>, where n is the number of blocks selected. This is <math>1 - (\frac{4095}{4096})^3 \approx \frac{1}{1365.36} \approx 0.073224%</math> for default random tick speed.
<references group=note/>
Effects
Many things may happen when a block is random-ticked, including:
- Template:ItemSprite Minecraft:Crops may grow or uproot.
- Template:BlockSprite Minecraft:Mushrooms may spread or uproot.
- Template:BlockLink, Template:BlockLink, Template:BlockLink, and Template:BlockLink may spread.
- Template:BlockLink and Template:BlockLink layers may melt.
- Template:BlockLink may decay.
- Template:BlockLink hydration is updated.
- Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink and Template:BlockLink may grow.
- Template:BlockLink and Template:BlockLink may spread.
- Template:BlockLink, Template:BlockLink, and Template:BlockLink may decay (only if the condition is met).
- Template:BlockSprite Minecraft:Saplings may grow into a Minecraft:tree.
- Template:BlockLink may set fires nearby.<ref group=note>Template:IN, this requires a player within an 8-chunk radius. However, Template:Cmd removes this requirement if set to true.</ref>
- Template:BlockLink may turn into Template:BlockLink if placed on top of a block with Template:BlockLink underneath.
- Template:BlockLink turns off.
- Template:BlockLink blocks may spawn a Minecraft:zombified piglin.
- Template:BlockLink crack or hatch.
- Template:BlockLink may grow an Template:BlockLink on any of its sides as longs as there is no solid block.
- Template:BlockLink (or any of its non-oxidized variants) may advance one stage in Minecraft:oxidation.
- Template:BlockLink may fill a Template:BlockLink below.
- Template:BlockLink and Template:BlockLink may grow a stalagmite/stalactite if the conditions are met.
- Template:BlockLink start a 250 second delay (5000 Minecraft:ticks) until they hydrate or dehydrate.
- Template:BlockSprite Minecraft:Eyeblossoms may change state.
- Template:BlockLink and Template:BlockLink may burn out or spread.Template:Only
<references group="note"/>
Time estimation
Because random block ticks are granted randomly, there is no way to predict when a block can receive its next tick. Template:IN, the median time between ticks is 47.30 seconds (<math>\log_{\frac{4096-3}{4096}}(0.5) \approx</math> 946.03 game ticks). That is, there is a 50% chance for the interval to be equal or shorter than 47.30 seconds and a 50% chance for it to be longer than 47.30. However, sometimes it is much longer or shorter: for example, there is a 1.38% chance for the interval to be less than one second and a 1.23% chance for the interval to be over five minutes. On average, blocks are updated every 68.27 seconds (<math>\frac{4096}{3} \approx</math> 1365.33 game ticks). For the math behind these numbers, see the Wikipedia entries for the geometric distribution.
Some blocks also have additional conditions for growing. Nether wart has only a 10% chance to grow one growth stage, with 3 growth stages before it is fully grown. This means that it takes 34.1333 minutes on average for nether wart to fully grow.
Template:Navbox Java Edition technical Template:Navbox Bedrock Edition