Minecraft:Tree definition: Difference between revisions
More actions
Sync: new page from Minecraft |
Sync: updated from Minecraft |
||
| Line 123: | Line 123: | ||
|- | |- | ||
| style="text-align: center;" |[[File:Fancy_trunk placer.png|x100px]] || <code>fancy_trunk_placer</code> | | style="text-align: center;" |[[File:Fancy_trunk placer.png|x100px]] || <code>fancy_trunk_placer</code> | ||
|| Places a straight trunk of <code>(height + 2) * 0.618</code> and branches in random directions. | || Places a straight trunk of <code>(height + 2) * 0.618</code> and branches in random directions. Branches always generate at least 20% up the tree. | ||
No additional fields | No additional fields | ||
Latest revision as of 11:14, 18 July 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" />
- Template:Nbt: Root object.
- Template:Nbt: Template:Cd
- Template:Nbt
- Template:Nbt (optional, defaults to false) Allows the tree to generate even if there are vines blocking it.
- Template:Nbt An optional rule-based block state provider defining how to replace the block below the trunk. For the default value, see Template:Slink
- Template:Nbt The block to use for the trunk. Note that when the trunk placer is
fancy_trunk_placer, the block must haveaxisproperty, such as logs. - Template:Nbt The block to use for the foliage.
- Template:Nbt Defines the width of the tree at different heights relative to the lowest trunk block, for the minimum size of the feature, see Template:Slink
- Template:Nbt Defines how the trunk is generated, see Template:Slink
- Template:Nbt Defines how the foliage is generated, see Template:Slink
- Template:Nbt (optional) Controls how roots are generated, and which blocks to use, see Template:Slink
- Template:Nbt (Required, but can be empty) Decorations to add to the tree apart from the trunk and leaves.
- Template:Nbt A decorator, see Template:Slink
<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_sizeorthree_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.
- Template:Nbt One of
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, orcherry_trunk_placer. - 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.
- Template:Nbt One of
| 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
|
Foliage placer
Template:Info needed section The foliage placer determines the placement and shape of the foliage of the tree.
- Template:Nbt
- Template:Nbt 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, orcherry_foliage_placer. - Template:NbtTemplate:Nbt The radius of the foliage.
- Template:NbtTemplate:Nbt The vertical offset from the top of trunk to the top of the foliage.Template:Needs testing
- Additional fields depend on the value of Template:Nbt, see below.
- Template:Nbt One of
| Name | Description and Additional Fields | |
|---|---|---|
| File:Blob foliage placer.png | blob_foliage_placer
|
Template:Info needed
|
| File:Bush foliage placer.png | bush_foliage_placer
|
Template:Info needed
|
| File:Fancy foliage placer.png | fancy_foliage_placer
|
Template:Info needed
|
| File:Jungle foliage placer.png | jungle_foliage_placer
|
Template:Info needed
|
| 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. |
Root placer
The root placer is optional and controls the placement and shape of the roots, and moving the trunk upwards.
- Template:Nbt
- Template:Nbt Type of tree root placer, currently only Template:Cd.
- Template:Nbt The block used as the root of the tree.
- Template:NbtTemplate:Nbt Offset perpendicular to the trunk.
- Template:Nbt (optional) The blocks above the root.
- Template:Nbt The block above the root.
- Template:Nbt The probability of generating the block. Value between 0.0 and 1.0 (inclusive).
- Additional fields depend on the value of Template:Nbt, see below.
| 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, ortrunk_vine. - Additional fields depend on the value of Template:Nbt, see below.
- Template:Nbt The type of decoration to add. One of
| 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.
|
| 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.
|
| 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.
|
| 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.
|
| 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. |