Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Tree definition: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: updated from Minecraft
SyncBot (talk | contribs)
Sync: updated from Minecraft
Line 85: Line 85:
<div class="treeview">
<div class="treeview">
* {{nbt|compound|trunk_placer}}
* {{nbt|compound|trunk_placer}}
** {{nbt|string|type}} One of <code>straight_trunk_placer</code>, <code>forking_trunk_placer</code>, <code>giant_trunk_placer</code>, <code>mega_jungle_trunk_placer</code>, <code>dark_oak_trunk_placer</code>, <code>fancy_trunk_placer</code>, <code>bending_trunk_placer</code>, <code>upwards_branching_trunk_placer</code>, or <code>cherry_trunk_placer</code>.
** {{nbt|string|type}} One of <code>straight_trunk_placer</code>, <code>forking_trunk_placer</code>, <code>giant_trunk_placer</code>, <code>mega_jungle_trunk_placer</code>, <code>dark_oak_trunk_placer</code>, <code>fancy_trunk_placer</code>, <code>bending_trunk_placer</code>, <code>upwards_branching_trunk_placer</code>, <code>cherry_trunk_placer</code>, or <code>poplar_trunk_placer</code>{{upcoming|Wilderness Bound|nocat=1}}.
** {{nbt|int|base_height}} Value between 0 and 32 (inclusive). The base height of the trunk.
** {{nbt|int|base_height}} Value between 0 and 32 (inclusive). The base height of the trunk.
** {{nbt|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.
** {{nbt|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.
Line 163: Line 163:
*** {{nbt|int|max_inclusive}} The maximum possible value.
*** {{nbt|int|max_inclusive}} The maximum possible value.
** {{nbt|int}}{{nbt|compound|branch_end_offset_from_top}} Value between -16 and 16 (inclusive).
** {{nbt|int}}{{nbt|compound|branch_end_offset_from_top}} Value between -16 and 16 (inclusive).
*** {{nbt inherit/int_provider}}
</div>
|-
| style="text-align: center;" |[[File:Poplar_trunk placer.png|x100px]] || <code>poplar_trunk_placer</code>
||{{upcoming|Wilderness Bound|nocat=1}}{{info needed}}
<div class="treeview">
* Additional fields:
** {{nbt|int}}{{nbt|compound|branch_amount}} Value between 1 and 4 (inclusive).
*** {{nbt inherit/int_provider}}
** {{nbt|int}}{{nbt|compound|trunk_height_above_branches}} Value between 0 and 8 (inclusive).
*** {{nbt inherit/int_provider}}
*** {{nbt inherit/int_provider}}
</div>
</div>
Line 172: Line 183:
<div class="treeview">
<div class="treeview">
* {{nbt|compound|foliage_placer}}
* {{nbt|compound|foliage_placer}}
**{{nbt|string|type}} One of <code>blob_foliage_placer</code>, <code>spruce_foliage_placer</code>, <code>pine_foliage_placer</code>, <code>acacia_foliage_placer</code>, <code>bush_foliage_placer</code>, <code>fancy_foliage_placer</code>, <code>jungle_foliage_placer</code>, <code>mega_pine_foliage_placer</code>, <code>dark_oak_foliage_placer</code>, <code>random_spread_foliage_placer</code>, or <code>cherry_foliage_placer</code>.
**{{nbt|string|type}} One of <code>blob_foliage_placer</code>, <code>spruce_foliage_placer</code>, <code>pine_foliage_placer</code>, <code>acacia_foliage_placer</code>, <code>bush_foliage_placer</code>, <code>fancy_foliage_placer</code>, <code>jungle_foliage_placer</code>, <code>mega_pine_foliage_placer</code>, <code>dark_oak_foliage_placer</code>, <code>random_spread_foliage_placer</code>, <code>cherry_foliage_placer</code>, or <code>poplar_foliage_placer</code>{{upcoming|Wilderness Bound|nocat=1}}.
** {{nbt|int}}{{nbt|compound|radius}} The radius of the foliage.
** {{nbt|int}}{{nbt|compound|radius}} The radius of the foliage. Value between 0 and 16 (inclusive).
*** {{Nbt inherit/int provider}}
*** {{Nbt inherit/int provider}}
**{{nbt|int}}{{nbt|compound|offset}} The vertical offset from the top of trunk to the top of the foliage.{{needs testing}}
**{{nbt|int}}{{nbt|compound|offset}} The vertical offset from the top of trunk to the top of the foliage.{{needs testing}} Value between 0 and 16 (inclusive).
*** {{Nbt inherit/int provider}}
*** {{Nbt inherit/int provider}}
** Additional fields depend on the value of {{Nbt|string|type}}, see below.
** Additional fields depend on the value of {{Nbt|string|type}}, see below.
Line 276: Line 287:


No additional fields.
No additional fields.
|-
| style="text-align: center;" |[[File:Poplar_foliage_placer.png|x100px]] || <code>poplar_foliage_placer</code>
|| {{upcoming|Wilderness Bound|nocat=1}}{{info needed}}
There is a cross in the leaves
[[File:Poplar_foliage_placer_cross.png|x100px]]
<div class="treeview">
* Additional fields:
**{{nbt|int}}{{nbt|compound|height}} Value between 5 and 16 (inclusive).
***{{Nbt inherit/int provider}}
**{{nbt|float|side_hole_chance}} Value between 0.0 and 1.0 (inclusive).
</div>
|}
|}


Line 321: Line 343:
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: A decorator.
* {{nbt|compound}}: A decorator.
**{{nbt|string|type}} The type of decoration to add. One of <code>alter_ground</code>, <code>attached_to_leaves</code>, <code>attached_to_logs</code>, <code>beehive</code>, <code>cocoa</code>, <code>creaking_heart</code>, <code>leave_vine</code>, <code>pale_moss</code>, <code>place_on_ground</code>, or <code>trunk_vine</code>.
**{{nbt|string|type}} The type of decoration to add. One of <code>alter_ground</code>, <code>attached_to_leaves</code>, <code>attached_to_logs</code>, <code>beehive</code>, <code>cocoa</code>, <code>creaking_heart</code>, <code>leave_vine</code>, <code>pale_moss</code>, <code>place_on_ground</code>, <code>trunk_vine</code>, or <code>shelf_mushroom</code>{{upcoming|Wilderness Bound|nocat=1}}.
** Additional fields depend on the value of {{Nbt|string|type}}, see below.
** Additional fields depend on the value of {{Nbt|string|type}}, see below.
</div>
</div>
Line 426: Line 448:


No additional fields.
No additional fields.
|-
| style="text-align: center;" |Image needed || <code>shelf_mushroom</code>
|| {{upcoming|Wilderness Bound|nocat=1}}
Adds shelf mushrooms on each trunk block with the specified probability.
<div class="treeview">
* Additional fields:
**{{nbt|float|probability}} Value between 0.0 and 1.0 (inclusive).
</div>
|}
|}


Line 448: Line 479:
|{{HistoryLine||1.21.5|dev=25w02a|Added <code>place_on_ground</code> decorator.}}
|{{HistoryLine||1.21.5|dev=25w02a|Added <code>place_on_ground</code> decorator.}}
|{{HistoryLine|||dev=25w09a|Added <code>attached_to_logs</code> decorator.}}
|{{HistoryLine|||dev=25w09a|Added <code>attached_to_logs</code> decorator.}}
|{{HistoryLine|java upcoming}}
|{{HistoryLine||26.3|dev=snap1|Added <code>shelf_mushroom</code> decorator, <code>poplar_foliage_placer</code> and <code>poplar_trunk_placer</code>.}}
}}
}}


== Navigation ==
== Navigation ==
{{Navbox Java Edition technical|datapack}}
{{Navbox Java Edition technical|datapack}}

Revision as of 11:13, 11 September 2026

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

JSON format

<section begin="json_format" />

<section end="json_format" />

Default below trunk provider

When not specified the below trunk provider defaults to the following Minecraft:rule-based block state provider: <syntaxhighlight lang="json"> {

   "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"
               }
           }
       }
   ]

} </syntaxhighlight>

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.

  • Template:Nbt
    • Template:Nbt One of two_layers_feature_size or three_layers_feature_size
    • Template:Nbt (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 Template:Nbt, see below.

two_layers_feature_size

Specifies 2 different width based on height. At heights lower than Template:Nbt, Template:Nbt is used, otherwise Template:Nbt.

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

three_layers_feature_size

Specifies 3 different width based on height. At heights lower than Template:Nbt, the minimum width is Template:Nbt, at the topmost Template:Nbt of the trunk Template:Nbt is used, otherwise Template:Nbt is used.

  • Additional fields:
    • Template:Nbt (optional, defaults to 1) Value between 0 and 80 (inclusive). Height of the lower layer, calculated from the bottom of the trunk.
    • Template:Nbt (optional, defaults to 1) Value between 0 and 80 (inclusive). Height of the upper layer, calculated from the top of the trunk.
    • Template:Nbt (optional. defaults to 0) Value between 0 and 16 (inclusive). Minimum width of the tree in the bottom layer (i.e. the bottom Template:Nbt blocks of the trunk).
    • Template:Nbt (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).
    • Template:Nbt (optional, defaults to 1) Value between 0 and 16 (inclusive). Minimum width of the tree in the upper layer (i.e. the topmost Template:Nbt blocks of the trunk).

Trunk placer

The trunk placer determines the shape trunk of the tree.

  • Template:Nbt
    • Template:Nbt 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, cherry_trunk_placer, or poplar_trunk_placerTemplate:Upcoming.
    • Template:Nbt Value between 0 and 32 (inclusive). The base height of the trunk.
    • Template:Nbt Value between 0 and 24 (inclusive). A random value between 0 and this value (inclusive) is added to the height of the trunk.
    • Template:Nbt 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 Template:Nbt, see below.
Trunk placers
Name Description and Additional Fields
File:Straight trunk placer.png straight_trunk_placer Places a straight trunk of specified height. Foliage is attached to be block above the highest trunk block.

No additional fields

File:Forking trunk placer.png 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

File:Giant trunk placer.png 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

File:Mega jungle trunk placer.png 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

File:Dark oak trunk placer.png 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

File:Fancy trunk placer.png 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

File:Bending trunk placer.png 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 Template:NbtTemplate:Nbt is generated. Foliage is attached to all block of the top branch and any trunk block that is higher than Template:Nbt.
File:Upwards branching trunk placer.png upwards_branching_trunk_placer Template:Info needed
File:Cherry trunk placer.png cherry_trunk_placer Template:Info needed
File:Poplar trunk placer.png poplar_trunk_placer Template:UpcomingTemplate:Info needed

Foliage placer

Template:Info needed section The foliage placer determines the placement and shape of the foliage of the tree.

Foliage placers
Name Description and Additional Fields
File:Blob foliage placer.png blob_foliage_placer Template:Info needed
  • Additional fields:
    • Template:Nbt The foliage's height. Value between 0 and 16 (inclusive).
File:Bush foliage placer.png bush_foliage_placer Template:Info needed
  • Additional fields:
    • Template:Nbt The foliage's height. Value between 0 and 16 (inclusive).
File:Fancy foliage placer.png fancy_foliage_placer Template:Info needed
  • Additional fields:
    • Template:Nbt The foliage's height. Value between 0 and 16 (inclusive).
File:Jungle foliage placer.png jungle_foliage_placer Template:Info needed
  • Additional fields:
    • Template:Nbt The foliage's height. Value between 0 and 16 (inclusive).
File:Spruce foliage placer.png 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
File:Pine foliage placer.png pine_foliage_placer Template:Info needed
File:Mega pine foliage placer.png mega_pine_foliage_placer Template:Info needed
File:Random spread foliage placer.png random_spread_foliage_placer Template:Info needed
File:Cherry foliage placer.png cherry_foliage_placer Template:Info needed
File:Acacia foliage placer.png acacia_foliage_placer Template:Info needed

No additional fields.

File:Dark oak foliage placer.png dark_oak_foliage_placer Template:Info needed

No additional fields.

File:Poplar foliage placer.png poplar_foliage_placer Template:UpcomingTemplate:Info needed

There is a cross in the leaves File:Poplar foliage placer cross.png

Root placer

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

Root placers
Name Description and Additional Fields
File:Mangrove root placer.png mangrove_root_placer Template:Info needed

Decorator

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

  • Template:Nbt: A decorator.
    • Template:Nbt 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, trunk_vine, or shelf_mushroomTemplate:Upcoming.
    • Additional fields depend on the value of Template:Nbt, see below.
Tree decorators
Name Description and Additional Fields
File:Alter ground tree decorator.png alter_ground Replaces blocks in the Template:Tag link tag around the tree with different blocks.
File:Attached to leaves tree decorator.png attached_to_leaves Attaches blocks to exposed faces of all foliage blocks in specified directions.
File:Attached to logs tree decorator.png attached_to_logs Attaches blocks to exposed faces of all trunk blocks in specified directions.
File:Beehive tree decorator.png beehive Places a single Minecraft: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:
File:Cocoa tree decorator.png cocoa Places Minecraft: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:
    • Template:Nbt Value between 0.0 and 1.0 (inclusive). Probability that this feature places any cocoa beans.
File:Creaking heart tree decorator.png creaking_heart Places a creaking heart, replacing a trunk block in a position where all 6 surrounding blocks are in the Template:Tag link tag.
  • Additional fields:
File:Leave vine tree decorator.png leave_vine Places Minecraft:vines attached to any foliage blocks. Each vine is extended by 4 blocks downwards if possible.
  • Additional fields:
    • Template:Nbt Value between 0.0 and 1.0 (inclusive). Probability of placing a vine at any given position.
File:Pale moss tree decorator.png pale_moss Places the Template:Cd Minecraft:configured feature at the position of the lowest log with probability Template:Nbt.

Adds Minecraft:hanging moss to the bottom of trunk and foliage blocks with probability Template:Nbt and Template:Nbt respectively.

File:Place on ground tree decorator.png place_on_ground Tries Template:Nbt positions within the specified radius and height range to find a position that is at the height of the MOTION_BLOCKING_NO_LEAVES Minecraft:heightmap, is solid, and has air above. Places the specified block on the block above any matching positions.
File:Trunk vine tree decorator.png trunk_vine Adds vines to each side of each trunk block with a probability of 75% each.

No additional fields.

Image needed shelf_mushroom Template:Upcoming

Adds shelf mushrooms on each trunk block with the specified probability.

  • Additional fields:

History

Template:HistoryTable

Navigation

Template:Navbox Java Edition technical