9

This question is more out of curiosity than anything else. The Wiki and other places do mention that leaves decay once their tree is cut down (but not if you place them of course), but there doesn't seem to be any details as to the decay formula by tick, as there seems to be from growing crops. Does anybody know what this formula is? Thanks.

I am currently playing Minecraft 1.6.2.

5
  • I always assumed it was random, so if you want to get into artificial randomization formulas, then good luck.
    – Batophobia
    Commented Jul 11, 2013 at 15:58
  • @DavidStarkey I believe it is, but so is growing crops. There's still an algorithm, even if it includes (pseudo)random aspects.
    – dlras2
    Commented Jul 11, 2013 at 16:05
  • Yes, I'm not so much interested in the artificial pseudorandomness so much as the formula I assume is programmed around it.
    – hedgepig
    Commented Jul 11, 2013 at 16:07
  • 1
    If you are a developer, the code behind the leaf decay may be of use to you: gist.github.com/IQAndreas/5976815 I'll try to clean it up and see if I can get a proper answer from it.
    – IQAndreas
    Commented Jul 11, 2013 at 16:10
  • Thank you - I'm not a developer or programmer of any sort so I can't really make much out of that snippet of code, but it is nice to see that it would be possible to get a definitive answer.
    – hedgepig
    Commented Jul 11, 2013 at 16:17

1 Answer 1

8

Once every game tick, 3 random blocks in every 163 block section close to you are assigned "block ticks". On blocks that support them, random activities such as plant growth and leaf decay occur on these block ticks.

Do note that block ticks only occur on blocks near you (that is to say, anywhere in a 15x15 chunk square centered on the chunk you're in). This means being just far enough away from leaves so that the chunks they are part of are still rendered, but are not candidates for block ticks, might mean they never decay until you return.

5
  • So, the probability for plant growth (a single stage) is the same as leaf decay?
    – hedgepig
    Commented Jul 11, 2013 at 16:51
  • @inkyvoyd Yes. However, it is entirely possible for either of those processes to complete much faster than the other, since I am not aware of how many block ticks it takes to complete plant growth vs leaf decay. Commented Jul 11, 2013 at 16:53
  • 1
    Not all block-update-dependent things occur with 100% chance on block tick. Also, game tick occurs every 1/20th of a second.
    – Orc JMR
    Commented Jul 11, 2013 at 20:15
  • @OrcJMR That depends on what the update method of the block does. Some custom blocks decide to skip update ticks randomly, whereas some only do something every n update ticks. Regarding "game tick occurs every 1/20th of a second", I don't think I implied otherwise. Commented Jul 11, 2013 at 20:20
  • @Asad Not to prove you wrong, I just thought it is useful to mention.
    – Orc JMR
    Commented Jul 12, 2013 at 2:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.