[MC-11208] The big tree generator handles tree height variable incorrectly Created: 07/Mar/13  Updated: 12/Feb/18  Resolved: 12/Feb/18

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.7, Snapshot 13w10b, Minecraft 1.5, Minecraft 1.6.2, Minecraft 1.10.2, Minecraft 16w33a, Minecraft 16w39c, Minecraft 16w40a, Minecraft 16w44a, Minecraft 1.11, Minecraft 17w16b
Fix Version/s: Minecraft 18w07a

Type: Bug
Reporter: Markku Assignee: ProfMobius (Thomas Guimbretiere)
Resolution: Fixed Votes: 37
Labels: tree-generation, world-generation

Issue Links:
Duplicate
is duplicated by MC-10534 Big oak trees don't spawn Resolved
Relates
relates to MC-102440 Large oak trees not spawning or spawn... Resolved
relates to MC-29844 Big Oak Trees fail to generate in For... Resolved
CHK:
Confirmation Status: Confirmed

 Description   

(Relates to MC-10534 and MC-2759; doesn't fix them, but perhaps makes the effects of the feature less noticeable.)

(Using MCP namings.)
The WorldGenBigTree has instance variable heightLimit. The same generator instance is used to create many trees during world generation. However, that heightLimit variable is only written to at few occasions; initialization to 0, randomized when it is zero, and when tree height (free space) check deems it needs to be shorter. Thus, the start of world generation can look like this (for tree heights):
0 -> 10, 10, 10, 10, 10, .. (30 more of 10) .., 7, 7, 7, 7, 7, 10, 10, 10, (10 more of 10), ... (occasional streak of 10 times 11), etc. etc.

(Edit: ) Note also that the trees are created somewhat "next to next" per location, the same height of trees can be noticed in the world, as many nearby big trees have the same height, then another bunch has another height shared between them, etc.

Fix?

WorldGenBigTree
    public boolean generate(World world, Random random, int x, int y, int z) {
        ...
        // FIX? Remove this check.
        //if (this.heightLimit == 0) {
            this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit);
        //}

        if (!this.validTreeLocation()) {
            return false;
        }
        ...

Tested on 1.4.7 and nice random heights from tree to tree, no sequences of same height observable.

Since the generated worlds from the same seed (from MC-10534) look exactly the same (including the pair of two small "bigtrees"), this affects also all the way to 13w10b, 1.5-pre. (Can not check the code for the latest (only the trees/world), though, but would be quite the miracle if this bug wasn't there, yet produced same trees.)



 Comments   
Comment by Zed Ontargs [ 06/Oct/16 ]

Still an issue in 16w40a.

Comment by Zed Ontargs [ 03/Oct/16 ]

Still an issue in 16w39c.

Comment by Ivan [ 31/Aug/16 ]

After some testing I found out that it also changes every time you open any world for the first time after restarting the game and it stays the same for all the others until a new restart. I can't read the code so I can't confirm it in any technical way. However, one can recreate it by:
1) Create a new world that has a forest biome nearby
2) Wait for the chunks to load
3) Restart the game
4) Open the world and go to previously ungenerated chunks
5) See how large oak tree generation has changed (May not work if the variable randomizes to the same number)

Comment by [Mod] Torabi [ 31/Aug/16 ]

Confirmed using MCP 9.31 for Minecraft 1.10, and creating new worlds in the current snapshot certainly seems to display the behavior of large numbers of big oak trees with the same height.

Comment by user-f2760 (Inactive) [ 18/Mar/16 ]

No response for over a year.

Comment by Galaxy_2Alex [ 30/Oct/14 ]

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. If this has been done, we can reopen the issue.

Keep in mind that the "Resolved"-Status on this ticket just means "Answered", and that we are waiting for further information on whether this issue still exists or not. We will reopen it as soon as the requested information has been deliviered.

Comment by Markku [ 04/Apr/14 ]

Due to having MC-29844 around, and no access to code (i.e. MCP for latest versions) to check for sure, it is not possible check the status of this issue and update the affected version for now (except for Mojang coders, of course). That said, I have not seen any big trees by world generation in latest versions (both 1.7.5 and snapshots), so either this or MC-29844 or both are still in effect.

Comment by Markku [ 14/Sep/13 ]

The world generation in 1.6.2 still matches the MC-10534 screenshot (which was generated with bugged version), and code seems to look the same (at least the proposed fix part, didn't check the whole class), so I assume it is still not fixed. Added the version to affects-list.

Generated at Sun Jan 12 12:26:53 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.