Tree definition

Minecraft Wiki article. Categories: Java_Edition, Information_needed, Articles_to_be_expanded, Testing_needed, Data_packs

📌 Mirrored from Minecraft Wiki

This article is reproduced from Tree definition on the Minecraft Wiki. Mirrored from revision 3679554. It is licensed CC BY-NC-SA 3.0 by the Minecraft Wiki contributors — not under the Codex’s CC BY-SA 4.0, and it may not be used commercially. Edits belong upstream, not here.

This feature is exclusive to Java Edition.
 

Trees are features with a stem and leaves, and optionally roots and decorations. They are configured using configured features in data packs.

JSON format

Default below trunk provider

When not specified the below trunk provider defaults to the following rule-based block state provider:

{
    "rules": [
        {
            "if_true": {
                "type": "minecraft:not",
                "predicate": {
                    "type": "minecraft:matching_block_tag",
                    "tag": "minecraft:cannot_replace_below_tree_trunk"
                }
            },
            "then": {
                "type": "minecraft:simple_state_provider",
                "state": {
                    "Name": "minecraft:dirt"
                }
            }
        }
    ]
}

Minimum size

The minimum size determines how much space needs to be available for the tree to be able to place. This is done by checking a square area of varying widths at each vertical position of the tree. The available free height is calculated as the height until all square are free.

  • [NBT Compound / JSON Object] minimum_size
    • [String] type One of two_layers_feature_size or three_layers_feature_size
    • [Float] min_clipped_height (optional) Value between 0 and 80 (inclusive). If specified and lower than the trunk height, specifies the minimum free height required for the tree to generate. Otherwise the trunk height is used instead.
    • Additional fields depend on the value of [String] type, see below.

two_layers_feature_size

Specifies 2 different width based on height. At heights lower than [Int] limit, [Int] lower_size is used, otherwise [Int] upper_size.

  • Additional fields:
    • [Int] limit (optional, defaults to 1) Value between 0 and 81 (inclusive). The limit between lower and upper layer.
    • [Int] lower_size (optional, defaults to 0) Value between 0 and 16 (inclusive). Minimum width of the tree at heights under [Int] limit.
    • [Int] upper_size (optional, defaults to 1) Value between 0 and 16 (inclusive). Minimum width of the tree at heights greater than or equals [Int] limit.

three_layers_feature_size

Specifies 3 different width based on height. At heights lower than [Int] limit, the minimum width is [Int] lower_size, at the topmost [Int] upper_limit of the trunk [Int] upper_size is used, otherwise [Int] middle_size is used.

  • Additional fields:
    • [Int] limit (optional, defaults to 1) Value between 0 and 80 (inclusive). Height of the lower layer, calculated from the bottom of the trunk.
    • [Int] upper_limit (optional, defaults to 1) Value between 0 and 80 (inclusive). Height of the upper layer, calculated from the top of the trunk.
    • [Int] lower_size (optional. defaults to 0) Value between 0 and 16 (inclusive). Minimum width of the tree in the bottom layer (i.e. the bottom [Int] limit blocks of the trunk).
    • [Int] middle_size (optional, defaults to 1) Value between 0 and 16 (inclusive). Minimum width of the tree at the middle layer (i.e. between bottom and top layers).
    • [Int] upper_size (optional, defaults to 1) Value between 0 and 16 (inclusive). Minimum width of the tree in the upper layer (i.e. the topmost [Int] upper_limit blocks of the trunk).

Trunk placer

The trunk placer determines the shape trunk of the tree.

  • [NBT Compound / JSON Object] trunk_placer
    • [String] type One of straight_trunk_placer, forking_trunk_placer, giant_trunk_placer, mega_jungle_trunk_placer, dark_oak_trunk_placer, fancy_trunk_placer, bending_trunk_placer, upwards_branching_trunk_placer, or cherry_trunk_placer.
    • [Int] base_height Value between 0 and 32 (inclusive). The base height of the trunk.
    • [Int] height_rand_a Value between 0 and 24 (inclusive). A random value between 0 and this value (inclusive) is added to the height of the trunk.
    • [Int] height_rand_b Value between 0 and 24 (inclusive). Another random value between 0 and this value (inclusive) is added to the height of the trunk.
    • Additional fields depend on the value of [String] type, see below.
Trunk placers
Name Description and Additional Fields
straight_trunk_placer Places a straight trunk of specified height. Foliage is attached to be block above the highest trunk block.

No additional fields

forking_trunk_placer Places a trunk with 1 or 2 branches, with an overhang of 1 to 3 blocks. Foliage is attached to the top of each branch.

No additional fields

giant_trunk_placer Places a 2×2 trunk of the specified height, except the topmost block is only a single block. Foliage is attached to be block above the highest trunk block.

No additional fields

mega_jungle_trunk_placer Extends the giant_trunk_placer with branches of length 5 in random directions in the top half of the trunk. Foliage is additionally attached to the end of each branch.

No additional fields

dark_oak_trunk_placer Places a 2×2 trunk of the specified height. Additionally places columns of branches in a 4×4 area around the stem in the topmost 5 blocks of the trunk. Foliage is attached to the top of the trunk as well as the top of each branch.

No additional fields

fancy_trunk_placer Places a straight trunk of (height + 2) * 0.618 and branches in random directions. Branches always generate at least 20% up the tree.

No additional fields

bending_trunk_placer Places a trunk of the specified height. The topmost 2 blocks have a chance to be moved by one block each. On top of the trunk a straight branch of length [Int][NBT Compound / JSON Object] bend_length is generated. Foliage is attached to all block of the top branch and any trunk block that is higher than [Int] min_height_for_leaves.
  • Additional fields:
    • [Int][NBT Compound / JSON Object] bend_length Value between 1 and 64 (inclusive).
    • [Int] min_height_for_leaves (optional, defaults to 1) Must be a positive integer.
upwards_branching_trunk_placer ​[more information needed]
  • Additional fields:
    • [Int][NBT Compound / JSON Object] extra_branch_steps The number of steps to generate extra branches. Must be a positive integer.
    • [Int][NBT Compound / JSON Object] extra_branch_length Generates extra branch length. Must be a non-negative integer.
    • [Float] place_branch_per_log_probability The probability of each log producing a branch. Value between 0.0 and 1.0 (inclusive).
    • [String][NBT List / JSON Array] can_grow_through A block ID or a block tag, or a list of block IDs. Represents blocks that tree trunks can grow through.
cherry_trunk_placer ​[more information needed]
  • Additional fields:
    • [Int][NBT Compound / JSON Object] branch_count Value between 1 and 3 (inclusive).
    • [Int][NBT Compound / JSON Object] branch_horizontal_length Value between 2 and 16 (inclusive).
    • [Int][NBT Compound / JSON Object] branch_start_offset_from_top A uniform int provider, which provides a number between two bounds with uniform distribution. Must between -16 and 0 (inclusive). And since it needs at least 2 blocks variation for the branch starts to fit both branches, max_inclusive must be at least min_inclusive + 1.
      • [Int] min_inclusive The minimum possible value.
      • [Int] max_inclusive The maximum possible value.
    • [Int][NBT Compound / JSON Object] branch_end_offset_from_top Value between -16 and 16 (inclusive).

Foliage placer

This section is missing information about: does poplar use an existing example or does it introduce its own?
 
Please expand the section to include this information. Further details may exist on the talk page.

The foliage placer determines the placement and shape of the foliage of the tree.

  • [NBT Compound / JSON Object] foliage_placer
    • [String] type One of blob_foliage_placer, spruce_foliage_placer, pine_foliage_placer, acacia_foliage_placer, bush_foliage_placer, fancy_foliage_placer, jungle_foliage_placer, mega_pine_foliage_placer, dark_oak_foliage_placer, random_spread_foliage_placer, or cherry_foliage_placer.
    • [Int][NBT Compound / JSON Object] radius The radius of the foliage.
    • [Int][NBT Compound / JSON Object] offset The vertical offset from the top of trunk to the top of the foliage.[needs testing]
    • Additional fields depend on the value of [String] type, see below.
Foliage placers
Name Description and Additional Fields
blob_foliage_placer ​[more information needed]
  • Additional fields:
    • [Int] height The foliage's height. Value between 0 and 16 (inclusive).
bush_foliage_placer ​[more information needed]
  • Additional fields:
    • [Int] height The foliage's height. Value between 0 and 16 (inclusive).
fancy_foliage_placer ​[more information needed]
  • Additional fields:
    • [Int] height The foliage's height. Value between 0 and 16 (inclusive).
jungle_foliage_placer ​[more information needed]
  • Additional fields:
    • [Int] height The foliage's height. Value between 0 and 16 (inclusive).
spruce_foliage_placer Places cones starting from the top of the trunk + offset, with increasing radius that increases until it hits a maximum radius, where it will keep generating frustums at maximum radius until the foliage is trunk_height + 1 tall
pine_foliage_placer ​[more information needed]
mega_pine_foliage_placer ​[more information needed]
random_spread_foliage_placer ​[more information needed]
  • Additional fields:
    • [Int][NBT Compound / JSON Object] foliage_height Value between 1 and 512 (inclusive).
    • [Int] leaf_placement_attempts Value between 0 and 256 (inclusive).
cherry_foliage_placer ​[more information needed]
  • Additional fields:
    • [Int][NBT Compound / JSON Object] height Value between 4 and 16 (inclusive).
    • [Float] wide_bottom_layer_hole_chance Value between 0.0 and 1.0 (inclusive).
    • [Float] corner_hole_chance Value between 0.0 and 1.0 (inclusive).
    • [Float] hanging_leaves_chance Value between 0.0 and 1.0 (inclusive).
    • [Float] hanging_leaves_extension_chance Value between 0.0 and 1.0 (inclusive).
acacia_foliage_placer ​[more information needed]

No additional fields.

dark_oak_foliage_placer ​[more information needed]

No additional fields.

Root placer

The root placer is optional and controls the placement and shape of the roots, and moving the trunk upwards.

  • [NBT Compound / JSON Object] root_placer
    • [String] type Type of tree root placer, currently only mangrove_root_placer.
    • [NBT Compound / JSON Object] root_provider The block used as the root of the tree.
    • [Int][NBT Compound / JSON Object] trunk_offset_y Offset perpendicular to the trunk.
    • [NBT Compound / JSON Object] above_root_placement (optional) The blocks above the root.
      • [NBT Compound / JSON Object] above_root_provider The block above the root.
      • [Float] above_root_placement_chance The probability of generating the block. Value between 0.0 and 1.0 (inclusive).
    • Additional fields depend on the value of [String] type, see below.
Root placers
Name Description and Additional Fields
mangrove_root_placer ​[more information needed]
  • Additional fields:
    • [NBT Compound / JSON Object] mangrove_root_placement Mangrove root placement parameter.
      • [Int] max_root_width The maximum width of the root. Value between 1 and 12 (inclusive).
      • [Int] max_root_length The maximum length of the root. Value between 1 and 64 (inclusive).
      • [Float] random_skew_chance The probability of random skew. Value between 0.0 and 1.0 (inclusive).
      • [String][NBT List / JSON Array] can_grow_through A block ID or a block tag, or a list of block IDs. Blocks that roots can grow through.
      • [String][NBT List / JSON Array] muddy_roots_in A block ID or a block tag, or a list of block IDs. Roots in it turn into muddy root blocks.
      • [NBT Compound / JSON Object] muddy_roots_provider Blocks used as muddy roots.

Decorator

Decorators are used to add additional blocks to various parts of the tree.

  • [NBT Compound / JSON Object]: A decorator.
    • [String] type The type of decoration to add. One of alter_ground, attached_to_leaves, attached_to_logs, beehive, cocoa, creaking_heart, leave_vine, pale_moss, place_on_ground, or trunk_vine.
    • Additional fields depend on the value of [String] type, see below.
Tree decorators
Name Description and Additional Fields
alter_ground Replaces blocks in the #minecraft:dirt tag around the tree with different blocks.
attached_to_leaves Attaches blocks to exposed faces of all foliage blocks in specified directions.
  • Additional fields:
    • [Float] probability Value between 0.0 and 1.0 (inclusive).
    • [Int] exclusion_radius_xz The minimum value of the horizontal distance between two decorations. Value between 0 and 16 (inclusive).
    • [Int] exclusion_radius_y The minimum value of the vertical distance between two decorations. Value between 0 and 16 (inclusive).
    • [Int] required_empty_blocks The number of empty blocks required by the decoration. Value between 0 and 16 (inclusive).
    • [NBT Compound / JSON Object] block_provider The block of the decoration.
    • [NBT List / JSON Array] directions (Cannot be empty) Directions to generate.
      • [String] A direction. Must be up, down, north, south , west, or east.
attached_to_logs Attaches blocks to exposed faces of all trunk blocks in specified directions.
  • Additional fields:
    • [Float] probability Value between 0.0 and 1.0 (inclusive).
    • [NBT Compound / JSON Object] block_provider The block of the decoration.
    • [NBT List / JSON Array] directions (Cannot be empty) Directions to generate.
      • [String] A direction. Must be up, down, north, south , west, or east.
beehive Places a single beehive with the specified probability. The beehive is always located 1 block below the lowest leaves block, but possibly on a different branch.
  • Additional fields:
    • [Float] probability Value between 0.0 and 1.0 (inclusive).
cocoa Places cocoa beans on the bottom 3 blocks of the trunk with a probability of 25% for each face. The specified probability determines how often any cocoa beans are placed.
  • Additional fields:
    • [Float] probability Value between 0.0 and 1.0 (inclusive). Probability that this feature places any cocoa beans.
creaking_heart Places a creaking heart, replacing a trunk block in a position where all 6 surrounding blocks are in the #minecraft:logs tag.
  • Additional fields:
    • [Float] probability Value between 0.0 and 1.0 (inclusive).
leave_vine Places vines attached to any foliage blocks. Each vine is extended by 4 blocks downwards if possible.
  • Additional fields:
    • [Float] probability Value between 0.0 and 1.0 (inclusive). Probability of placing a vine at any given position.
pale_moss Places the minecraft:pale_moss_patch configured feature at the position of the lowest log with probability [Float] ground_probability.

Adds hanging moss to the bottom of trunk and foliage blocks with probability [Float] trunk_probability and [Float] ground_probability respectively.

  • Additional fields:
    • [Float] leaves_probability Value between 0.0 and 1.0 (inclusive).
    • [Float] trunk_probability Value between 0.0 and 1.0 (inclusive).
    • [Float] ground_probability Value between 0.0 and 1.0 (inclusive).
place_on_ground Tries [Int] tries positions within the specified radius and height range to find a position that is at the height of the MOTION_BLOCKING_NO_LEAVES heightmap, is solid, and has air above. Places the specified block on the block above any matching positions.
  • Additional fields:
    • [Int] tries Optional positive int. Defaults to 128.
    • [Int] radius Optional non-negative int. Defaults to 2.
    • [Int] height Optional non-negative int. Defaults to 1.
    • [NBT Compound / JSON Object] block_state_provider The block of the decoration.
trunk_vine Adds vines to each side of each trunk block with a probability of 75% each.

No additional fields.

History

Java Edition
1.16.220w28aTrees can now be configured using data packs.
1.1721w10aRemoved [Int] max_water_depth and [String] heightmap fields.
Added [NBT Compound / JSON Object] dirt_provider and [Boolean] force_dirt
Renamed [NBT Compound / JSON Object] leaves_provider to [NBT Compound / JSON Object] foliage_provider
Added random_spread_foliage_placer and bending_trunk_placer.
pre1Added [NBT Compound / JSON Object] sapling_provider field
1.1821w38aRemoved [NBT Compound / JSON Object] sapling_provider field
1.1922w14aAdded [NBT Compound / JSON Object] root_placer field and the mangrove_root_placer.
Added attached_to_leaves decorator.
Added [Float] probability field to the leave_vine decorator.
Added upwards_branching_trunk_placer.
22w15aAdded [Int][NBT Compound / JSON Object] trunk_offset_y and [NBT Compound / JSON Object] above_root_placement fields to the root placer.
Removed the [Int] y_offset field of the mangrove_root_placer. Moved all other additional fields of mangrove_root_placer into an object [NBT Compound / JSON Object] mangrove_root_placement.
1.19.423w07aAdded cherry_foliage_placer and cherry_trunk_placer.
1.21.224w40aAdded pale_moss and creaking_heart decorators.
1.21.525w02aAdded place_on_ground decorator.
25w09aAdded attached_to_logs decorator.

Sources