mojira.dev
MC-274236

Saplings won't randomly grow with log directly above

Saplings are known to not care about log blocks when determining whether they can grow at all, and also grow right though them.
There is one exception, though: A log block directly above the sapling will prevent it from growing via random ticks. If there is an air block between the log and the sapling, it will grow just fine, though.

Steps to repeat:

  1. Place a sapling on any block it usually grows on.

  2. Place a Log directly on top of the sapling.

  3. Wait. /gamerule randomTickSpeed 1000 won't help, as the sapling never grows, unless bone meal is applied. (Notably, the sapling's age stays at 0, indicating it never even attempts to grow in the first place, rather than failing growth attempts. Compare this to MC-228758, where the diagonal block allows growth attempts to happen, but makes those fail.)

  4. Place another log on top of the first log and remove log right above the sapling. The sapling will grow into a tree eventually.

Expected behavior:
Since logs don't usually block growth, there should not be a difference between having a log right on top of the sapling or one block higher.

Code analysis:
SaplingBlock.randomTick() performs a light level check in addition to having a built-in random success chance. That light level check is not performed in the sapling block itself, but in the block above. Since logs are full opaque blocks, the light level will always be zero in this specific case, preventing the sapling from growing.

Linked issues

Attachments

Comments

[Mod] Jingy

Relates very closely to MC-228758 and may duplicate it (the difference being diagonal vs. vertical). Otherwise, similar. Also related to MC-15224

Wormbo

This is specifically about a log blocking light and thus preventing random growth. MC-228758 explicitly excludes logs and also covers bonemeal growth, while MC-15224 is specifically about mismatched log types.
The case presented here causes the sapling to never even have failed growth attempts (which would be visible in F3 debug by its age property changing from 0 to 1), but not even attempting to grow in the first place.

[Mod] ManosSef

Can confirm.

Wormbo

(Unassigned)

Community Consensus

Block states

1.21, 1.21.3

Retrieved