Bedrock Wiki
  • Discord
  • Contribute
  • bedrock.dev
  • MS Learn
Beginner's Guide
  • Guide
    • 1. Introduction
      guide
    • 2. Add-Ons Explained
    • 3. Software & Preparation
    • 4. Project Setup
    • 5. Create a Custom Item
    • 6. Create a Custom Entity
    • 7. Blockbench: Modeling, Texturing & Animating
    • 8. Adding a Loot Table, Spawn Rule & Crafting Recipe
  • Extra
    • a. Understanding JSON
    • b. Download Example Packs
    • c. Troubleshooting
      help
    • d. Advanced Manifest
    • e. Format Versions
    • f. Project Setup Android
Animation Controllers
  • Intro to Animation Controllers
    guide
  • Entity Commands
  • AFK Detector
  • Death Commands
  • Molang into Scoreboard
  • Respawn Commands
Blocks
  • General
    • Intro to Blocks
      guide
    • Block Components
    • Block Tags
    • Block States
    • Block Traits
    • Block Permutations
    • Block Events
      Scripts
    • Block Event Migration
      help
    • Blocks as Items
    • Troubleshooting Blocks
      help
  • Visuals
    • Block Culling
    • Block Models
      guide
    • Block Texture Animation
    • Block Texture Variation
    • Block Tinting
  • Tutorials
    • Applying Constant Effects
      Scripts
    • Avoiding State Limit
    • Fake Blocks
    • Ore Loot Tables
      Scripts
    • Precise Interaction
      Scripts
    • Precise Rotation
      Scripts
    • Rotatable Blocks
  • Vanilla Re-Creations
    • Custom Crops
      Scripts
    • Custom Glass
    • Custom Glazed Terracotta
    • Custom Trapdoors
      Scripts
  • Documentation
    • Block Format History
    • Block Shapes
    • Block Sounds
    • Vanilla Block Models
Commands
  • General
    • Intro to Command Blocks
    • Functions
    • Block States
    • Coordinate System
    • NBT Commands
    • Scoreboard Operations
    • Understanding Selectors
  • Commands
    • Damage
    • Execute
    • Playanimation
    • Playsound
  • On Event Systems
    • On Player First Join
    • On Player Join
    • On Player Leave
    • On Player Death
    • On Player Respawn
    • On First World Load
  • Scoreboard Systems
    • Entity Counter
    • Scoreboard Timers
    • Comparing And Retrieving Scores
  • Techniques
    • Execute Logic Gates
    • MBE - Max's Block Entity
    • FMBE - A New Way to Create Display Entities
    • Look Detection
    • Movement Detections
    • Orbital Camera
  • Useful Creations
    • Custom Crafter
    • Multiplayer Position Rearrangement
      function
Concepts
  • contents.json
  • Emojis & Symbols
  • Molang
  • Namespaces
  • Overwriting Assets
  • Raw Text
  • Shaders
  • Sounds
  • Subpacks
  • Text and Localization
  • Texture Atlases
  • textures_list.json
Documentation
  • Shared Constructs
  • Advanced Molang
  • File Types
  • Fog IDs
  • Material Configuration Description
  • Menu Categories
  • Molang Queries
  • Pack Folder Structure
  • Sound Definitions
  • Vanilla Materials
Entities
  • General
    • Intro to Entities BP
      guide
    • Intro to Entities RP
      guide
    • Troubleshooting Entities
      help
    • Entity Events
    • Entity Properties
    • NPC Dialogues
    • Render Controllers
    • Spawn Rules
  • Tutorials
    • Convert Points Between Any Space (World, Entity, Bones)
    • Creating Boats
    • Detecting Other Entities
    • Disabling Team Damage
    • Dummy Entities
    • Entity Attacks
    • Entity Holds Item
    • Entity Movement
    • Entity Timers
    • Flying Entities
    • Introduction to AOE Clouds
    • Invulnerable Entities
    • Look at Entity
    • Sleeping Entities
    • Solid Entities
    • Spawning Tamed Entities
      Scripts
    • Village Mechanic
  • Documentation
    • Dummy Components
    • Non-Mob Runtime Identifiers
    • Projectiles
    • Runtime Identifiers
    • Vanilla Usage Components
    • Vanilla Usage Spawn Rules
Items
  • General
    • Intro to Items
      guide
    • Item Components
    • Item Tags
    • Item Events
      Scripts
    • Item Event Migration
      help
    • Troubleshooting Items
      help
  • Tutorials
    • Custom Armor
    • Custom Food
      Scripts
    • Custom Pottery Sherds
    • Custom Weapons
    • Equipment-Based Commands
    • High Resolution Items
    • Spawning Items
    • Throwable Items
  • Documentation
    • Enchantments
    • Attachables
    • Item Format History
    • Numerical Item IDs
    • Vanilla Item Identifiers
    • Vanilla Usage Components
JSON UI
  • General
    • Intro to JSON UI
      guide
    • Best Practices
      guide
  • Tutorials
    • Adding HUD Elements
    • Aseprite Animations
    • Buttons and Toggles
    • Modifying Server Forms
    • Preserve Title Texts
    • String to Number
  • Documentation
    • JSON UI Documentation
Loot, Recipes & Trading
  • General
    • Trading Behavior
  • Documentation
    • Loot Tables
    • Trade Tables
    • Recipes
    • Item Functions
  • Tutorials
    • Randomized Structure Loot
Meta
  • Add-On Performance
  • Style Guide
  • Useful Links
  • Using Schemas
  • Version Control
  • Q&A
    • Blocks and Items Q&A 2024/08/30
    • Deferred Technical Preview Q&A 2024/02/23
    • GameTest Q&A 2021/08/06
    • Scripting and Editor Q&A 2023/09/22
    • World Generation Q&A 2024/11/15
NBT
  • General
    • .mcstructure
  • Tutorials
    • Experiments in Education Edition
    • Extending Structure Limits
  • NBT in Depth
    • About NBT (Named Binary Tag)
    • NBT Libraries
    • Reading NBT Example
Particles
  • General
    • Intro to Particles
      guide
  • Tutorials
    • Disabling Particles
  • Documentation
    • Vanilla Particles
Scripting
  • General
    • Intro to Scripting
    • What is Script API?
    • API Modules
  • Tutorials
    • Block Placement Prevention
    • GameTests
    • Script Core Features
    • Script Forms
    • Script Requests API
    • Simple Chat Commands
  • Documentation
    • Engine Environment
    • Script Resources
    • Script Watchdog
    • Troubleshooting JavaScript
    • TypeScript
Servers
  • Software
    • Bedrock Server Software
  • Protocols
    • Bedrock Protocol
    • NetherNet Protocol
    • RakNet Protocol
Visuals
  • General
    • Introduction to Entity Visuals
      guide
    • Bedrock Modeling
    • Custom Death Animations
    • Effects in Animations
    • Material Creations
    • Materials
    • Math-Based Animations
    • Skin Packs
  • Tutorials
    • Entity Texture Animation
    • Glowing Entity Texture
    • Hurt Animations
    • Leash Position
    • Player Geometry
    • Remove Entity Shadows
    • Retexturing Spawn Eggs
  • Ideas
    • Structure Presentation
World Generation
  • General
    • Intro to World Generation
      guide
    • Biomes
      guide
    • Feature Types
  • Tutorials
    • Block Conditions for Features
    • Generating Custom Ores
    • Generating Custom Structures
    • Generating Patches
    • Heightmap Noise
  • Documentation
    • Biome Tags

Custom Trees

experimental
Custom Trees
  • Decaying Leaves
    • Basic JSON
    • Block States
    • Permutations
  • Custom Log
  • Stripped Log
  • Custom Sapling
  • Sapling Placer
  • Loot Tables
  • Exporting Structures
  • Tree Features
  • Resource Pack (optional guide)
  • Result
  • Download Example Pack

FORMAT & MIN ENGINE VERSION 1.21.40

This tutorial assumes an advanced understanding of blocks. Check out the blocks guide before starting.

Creating your own tree with decaying leaves is complex, but possible! Follow this tutorial and you'll have your own in no time.

  • Features:

    • Decaying leaves
    • Tree Feature compatible
    • Leaves will drop itself when broken by a shear
    • Leaves don't decay if placed by player
    • Logs are strippable and rotatable
    • Stripping logs is compatible with tools from other add-ons (if they have the minecraft:is_axe tag)
    • Saplings can be bonemealed and grow into a tree

Decaying Leaves ​

You will notice straight away that our custom leaves have a long list to search for a vanilla log/custom log by its block tag, although the code example uses the custom logs for this tutorial. The value is 4 and this method is used to search for the nearest log in a circular radius.

Decaying Leaves Showcase

Our custom leaves disables ticking when placed by the player which doesn't make the leaves decay and this removes the requirements for another duplicate leave block.

Basic JSON ​

Let's get started. We'll start with the JSON code for the leaf block.

BP/blocks/custom_leaves.json
json
{
    "format_version": "1.21.40",
    "minecraft:block": {
        "description": {
            "identifier": "wiki:custom_leaves"
        },
        "components": {
            "tag:wiki:custom_leaves": {},
            "minecraft:loot": "loot_tables/empty.json",
            "minecraft:geometry": {
                "identifier": "minecraft:geometry.full_block"
            },
            "minecraft:custom_components": [
                "wiki:leaves_stop_decay",
                "wiki:leaves_on_destroyed",
                "wiki:leaves_check"
            ],
            "minecraft:destructible_by_explosion": {
                "explosion_resistance": 1
            },
            "minecraft:destructible_by_mining": {
                "seconds_to_destroy": 0.3
            },
            "minecraft:map_color": "#DDDDDD",
            "minecraft:light_dampening": 0,
            "minecraft:material_instances": {
                "*": {
                    "texture": "custom_leaves",
                    "render_method": "blend"
                }
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

Block States ​

We have defined the basics our custom leaf blocks need. Our custom leaf is still missing a few features such as states, permutations and the JS code for the custom components. Let's add the following block states.

"minecraft:block" > "description"
json
"states": {
    "wiki:decay_tier": [4, 3, 2, 1, 0], // Distance in blocks to find the log
    "wiki:should_decay": [true, false], // Used when placed by the player or with features
    "wiki:opaque": [false, true] // Optional; makes the leaves opaque when surrounded
}
1
2
3
4
5

Permutations ​

Let's add our permutation code that will help shape our block's behaviour.

"minecraft:block" > "description"
json
"permutations": [
    {
        "condition": "q.block_state('wiki:decay_tier') == 0",
        "components": {
            "minecraft:custom_components": [
                "wiki:leaves_decay"
            ],
            "tag:decay_tier_0": {}
        }
    },
    {
        "condition": "q.block_state('wiki:decay_tier') == 1",
        "components": {
            "tag:decay_tier_1": {}
        }
    },
    {
        "condition": "q.block_state('wiki:decay_tier') == 2",
        "components": {
            "tag:decay_tier_2": {}
        }
    },
    {
        "condition": "q.block_state('wiki:decay_tier') == 3",
        "components": {
            "tag:decay_tier_3": {}
        }
    },
    {
    "condition": "q.block_state('wiki:decay_tier') == 4",
        "components": {
            "tag:decay_tier_4": {}
        }
    },
    {
    "condition": "q.block_state('wiki:opaque')",
        "components": {
            "minecraft:material_instances": {
                "*": {
                    "texture": "custom_leaves",
                    "render_method": "opaque"
                }
            }
        }
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Code
BP/blocks/custom_leaves.json
json
{
    "format_version": "1.21.40",
    "minecraft:block": {
        "description": {
            "identifier": "wiki:custom_leaves",
            "states": {
                "wiki:decay_tier": [4, 3, 2, 1, 0], // Distance in blocks to find the log
                "wiki:should_decay": [true, false], // Used when placed by the player or with features
                "wiki:opaque": [false, true] // Optional; makes the leaves opaque when surrounded
            }
        },
        "components": {
            "tag:wiki:custom_leaves": {},
            "minecraft:loot": "loot_tables/empty.json",
            "minecraft:geometry": {
                "identifier": "minecraft:geometry.full_block"
            },
            "minecraft:custom_components": [
                "wiki:leaves_stop_decay",
                "wiki:leaves_on_destroyed",
                "wiki:leaves_check"
            ],
            "minecraft:destructible_by_explosion": {
                "explosion_resistance": 1
            },
            "minecraft:destructible_by_mining": {
                "seconds_to_destroy": 0.3
            },
            "minecraft:map_color": "#DDDDDD",
            "minecraft:light_dampening": 0,
            "minecraft:material_instances": {
                "*": {
                    "texture": "custom_leaves",
                    "render_method": "blend"
                }
            }
        },
        "events": {
            // Defines the loot for the tool
            "wiki:on_destroyed": {
                "sequence": [
                    {
                        "condition": "q.is_item_name_any('slot.weapon.mainhand','minecraft:shears')",
                        "spawn_loot": {
                            "table": "loot_tables/blocks/custom_leaves_shears.json"
                        }
                    },
                    {
                        "condition": "!q.is_item_name_any('slot.weapon.mainhand','minecraft:shears')",
                        "spawn_loot": {
                            "table": "loot_tables/blocks/custom_leaves.json"
                        }
                    }
                ]
            },
            // Checks for the log
            "wiki:check": {
                "sequence": [
                    {
                        "condition": "q.block_state('wiki:should_decay')",
                        "set_block_state": {
                            "wiki:decay_tier": "(q.block_neighbor_has_any_tag(0,0,-1,'log') || q.block_neighbor_has_any_tag(0,0,1,'log') || q.block_neighbor_has_any_tag(-1,0,0,'log') || q.block_neighbor_has_any_tag(1,0,0,'log') || q.block_neighbor_has_any_tag(0,-1,0,'log') || q.block_neighbor_has_any_tag(0,1,0,'log')) ? 4 : ((q.block_neighbor_has_any_tag(0,0,-1,'decay_tier_4') || q.block_neighbor_has_any_tag(0,0,1,'decay_tier_4') || q.block_neighbor_has_any_tag(-1,0,0,'decay_tier_4') || q.block_neighbor_has_any_tag(1,0,0,'decay_tier_4') || q.block_neighbor_has_any_tag(0,-1,0,'decay_tier_4') || q.block_neighbor_has_any_tag(0,1,0,'decay_tier_4')) ? 3 : ( (q.block_neighbor_has_any_tag(0,0,-1,'decay_tier_3') || q.block_neighbor_has_any_tag(0,0,1,'decay_tier_3 ') || q.block_neighbor_has_any_tag(-1,0,0,'decay_tier_3') || q.block_neighbor_has_any_tag(1,0,0,'decay_tier_3') || q.block_neighbor_has_any_tag(0,-1,0,'decay_tier_3') || q.block_neighbor_has_any_tag(0,1,0,'decay_tier_3')) ? 2 : ( (q.block_neighbor_has_any_tag(0,0,-1,'decay_tier_2') || q.block_neighbor_has_any_tag(0,0,1,'decay_tier_2') || q.block_neighbor_has_any_tag(-1,0,0,'decay_tier_2') || q.block_neighbor_has_any_tag(1,0,0,'decay_tier_2') || q.block_neighbor_has_any_tag(0,-1,0,'decay_tier_2') || q.block_neighbor_has_any_tag(0,1,0,'decay_tier_2')) ? 1 : 0 ) ) )"
                        }
                    },
                    {
                        "set_block_state": {
                            "wiki:opaque": "q.block_neighbor_has_any_tag(0,0,-1,'log','stone','custom_leaves') && q.block_neighbor_has_any_tag(0,0,1,'log','stone','custom_leaves') && q.block_neighbor_has_any_tag(0,1,0,'log','stone','custom_leaves') && q.block_neighbor_has_any_tag(0,-1,0,'log','stone','custom_leaves') && q.block_neighbor_has_any_tag(-1,0,0,'log','stone','custom_leaves') && q.block_neighbor_has_any_tag(1,0,0,'log','stone','custom_leaves')"
                        }
                    }
                ]
            },
            // When placed
            "wiki:stop_decay": {
                "set_block_state": {
                    "wiki:should_decay": false
                }
            },
            // When decayed
            "wiki:decay": {
                "die": {},
                "spawn_loot": {
                    "table": "loot_tables/blocks/custom_leaves.json"
                }
            }
        },
        "permutations": [
            {
                "condition": "q.block_state('wiki:decay_tier') == 0",
                "components": {
                    "minecraft:random_ticking": {
                        "on_tick": {
                            "event": "wiki:decay"
                        }
                    },
                    "tag:decay_tier_0": {}
                }
            },
            {
                "condition": "q.block_state('wiki:decay_tier') == 1",
                "components": {
                    "tag:decay_tier_1": {}
                }
            },
            {
                "condition": "q.block_state('wiki:decay_tier') == 2",
                "components": {
                    "tag:decay_tier_2": {}
                }
            },
            {
                "condition": "q.block_state('wiki:decay_tier') == 3",
                "components": {
                    "tag:decay_tier_3": {}
                }
            },
            {
                "condition": "q.block_state('wiki:decay_tier') == 4",
                "components": {
                    "tag:decay_tier_4": {}
                }
            },
            {
                "condition": "q.block_state('wiki:opaque')",
                "components": {
                    "minecraft:material_instances": {
                        "*": {
                            "texture": "custom_leaves",
                            "render_method": "opaque"
                        }
                    }
                }
            }
        ]
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135

Custom Log ​

Code
BP/blocks/custom_log.json
json
{
    "format_version": "1.21.40",
    "minecraft:block": {
        "description": {
            "identifier": "wiki:custom_log",
            "menu_category": {
                "category": "nature",
                "group": "itemGroup.name.log"
            },
            "states": {
                // Log direction state
                "wiki:axis": [0, 1, 2]
            }
        },
        "components": {
            "tag:log": {},
            "minecraft:unit_cube": {},
            // Sets different textures for sides and top/bottom of log
            "minecraft:material_instances": {
                "*": {
                    "texture": "custom_log"
                },
                "ends": {
                    "texture": "custom_log_top"
                },
                "up": "ends",
                "down": "ends"
            },
            "minecraft:destructible_by_mining": {
                "seconds_to_destroy": 1
            },
            // Sets log rotation on player placing
            "minecraft:on_player_placing": {
                "event": "wiki:set_axis"
            },
            // Make log strippable
            "minecraft:on_interact": {
                "condition": "q.equipped_item_any_tag('slot.weapon.mainhand', 'minecraft:is_axe')",
                "event": "wiki:strip"
            }
        },
        "events": {
            "wiki:set_axis": {
                "set_block_state": {
                    "wiki:axis": "Math.floor(q.block_face / 2)"
                }
            },
            "wiki:strip": {
                "sequence": [
                    {
                        "run_command": {
                            "command": "playsound hit.wood @a ~~~"
                        },
                        // Damages axe of player who stripped the log
                        "damage": {
                            "type": "durability",
                            "amount": 1,
                            "target": "item"
                        }
                    },
                    {
                        "condition": "q.block_state('wiki:axis') == 0",
                        "run_command": {
                            "command": "setblock ~~~ wiki:custom_stripped_log [\"wiki:axis\"=0]"
                        }
                    },
                    {
                        "condition": "q.block_state('wiki:axis') == 1",
                        "run_command": {
                            "command": "setblock ~~~ wiki:custom_stripped_log [\"wiki:axis\"=1]"
                        }
                    },
                    {
                        "condition": "q.block_state('wiki:axis') == 2",
                        "run_command": {
                            "command": "setblock ~~~ wiki:custom_stripped_log [\"wiki:axis\"=2]"
                        }
                    }
                ]
            }
        },
        "permutations": [
            {
                "condition": "q.block_state('wiki:axis') == 0",
                "components": {
                    "minecraft:transformation": { "rotation": [0, 0, 0] }
                }
            },
            {
                "condition": "q.block_state('wiki:axis') == 1",
                "components": {
                    "minecraft:transformation": { "rotation": [90, 0, 0] }
                }
            },
            {
                "condition": "q.block_state('wiki:axis') == 2",
                "components": {
                    "minecraft:transformation": { "rotation": [0, 0, 90] }
                }
            }
        ]
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

Stripped Log ​

Here all components are the same

Code
BP/blocks/custom_stripped_log.json
json
{
    "format_version": "1.21.40",
    "minecraft:block": {
        "description": {
            "identifier": "wiki:custom_stripped_log",
            "menu_category": {
                "category": "nature",
                "group": "itemGroup.name.log"
            },
            "states": {
                // Log direction state
                "wiki:axis": [0, 1, 2]
            }
        },
        "components": {
            "tag:log": {},
            "minecraft:unit_cube": {},
            // Sets different textures for sides and top/bottom of log
            "minecraft:material_instances": {
                "*": {
                    "texture": "custom_stripped_log"
                },
                "ends": {
                    "texture": "custom_stripped_log_top"
                },
                "up": "ends",
                "down": "ends"
            },
            "minecraft:destructible_by_mining": {
                "seconds_to_destroy": 1
            },
            // Sets log rotation on player placing
            "minecraft:on_player_placing": {
                "event": "wiki:set_axis"
            }
        },
        "events": {
            "wiki:set_axis": {
                "set_block_state": {
                    "wiki:axis": "Math.floor(q.block_face / 2)"
                }
            }
        },
        "permutations": [
            {
                "condition": "q.block_state('wiki:axis') == 0",
                "components": {
                    "minecraft:transformation": { "rotation": [0, 0, 0] }
                }
            },
            {
                "condition": "q.block_state('wiki:axis') == 1",
                "components": {
                    "minecraft:transformation": { "rotation": [90, 0, 0] }
                }
            },
            {
                "condition": "q.block_state('wiki:axis') == 2",
                "components": {
                    "minecraft:transformation": { "rotation": [0, 0, 90] }
                }
            }
        ]
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

Custom Sapling ​

For the sapling we will need structures of our tree to make the sapling semi-realistic as features cannot currently be placed with commands on Minecraft Bedrock.

Code
BP/blocks/custom_sapling.json
json
{
    "format_version": "1.21.40",
    "minecraft:block": {
        "description": {
            "identifier": "wiki:custom_sapling",
            "states": {
                // Sapling's growth stage
                "wiki:growth_stage": [0, 1, 2]
            }
        },
        "components": {
            "minecraft:collision_box": false,
            "minecraft:selection_box": {
                "origin": [-6, 0, -6],
                "size": [12, 13, 12]
            },
            "minecraft:light_dampening": 0,
            "minecraft:geometry": "geometry.custom_sapling",
            "minecraft:material_instances": {
                "*": {
                    "texture": "custom_sapling",
                    "render_method": "alpha_test",
                    "face_dimming": false,
                    "ambient_occlusion": false
                }
            },
            // Add loot component so it will drop sapling placer item
            "minecraft:loot": "loot_tables/blocks/custom_sapling.json",
            // Allows to place block only on these blocks
            "minecraft:placement_filter": {
                "conditions": [
                    {
                        "allowed_faces": ["up"],
                        "block_filter": ["minecraft:dirt", "minecraft:grass", "minecraft:podzol"]
                    }
                ]
            },
            // Trigger growth on each random tick
            "minecraft:random_ticking": {
                "on_tick": {
                    "event": "wiki:grow"
                }
            },
            // Trigger growth when bone meal is used
            "minecraft:on_interact": {
                "condition": "q.is_item_name_any('slot.weapon.mainhand', 'minecraft:bone_meal')",
                "event": "wiki:fertilize"
            }
        },
        "events": {
            "wiki:grow": {
                "sequence": [
                    {
                        "condition": "q.block_state('wiki:growth_stage') < 2",
                        "set_block_state": {
                            "wiki:growth_stage": "q.block_state('wiki:growth_stage') + 1"
                        }
                    },
                    {
                        "condition": "q.block_state('wiki:growth_stage') == 2",
                        "run_command": {
                            "command": "structure load custom_tree ~-2~~-2"
                        }
                    }
                ]
            },
            "wiki:fertilize": {
                // Removes item that was used to interact
                "decrement_stack": {},
                // Trigger growth
                "trigger": {
                    "event": "wiki:grow"
                },
                // Trigger effects
                "run_command": {
                    "command": [
                        "particle minecraft:crop_growth_emitter ~~~",
                        "playsound item.bone_meal.use @a ~~~"
                    ]
                }
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

Sapling Placer ​

Code
BP/items/custom_sapling_placer.json
json
{
    "format_version": "1.21.40",
    "minecraft:item": {
        "description": {
            "identifier": "wiki:custom_sapling_placer",
            "menu_category": {
                "category": "nature",
                "group": "itemGroup.name.sapling"
            }
        },
        "components": {
            "minecraft:max_stack_size": 64,
            "minecraft:block_placer": {
                "block": "wiki:custom_sapling"
            },
            "minecraft:icon": {
                "texture": "custom_sapling_placer"
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

Loot Tables ​

Code

This loot will spawn leaves block (when you break it using shears)

BP/loot_tables/blocks/custom_leaves_shears.json
json
{
    "pools": [
        {
            "rolls": 1,
            "entries": [
                {
                    "type": "item",
                    "name": "wiki:custom_leaves"
                }
            ]
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13

Leaves default loot

BP/loot_tables/blocks/custom_leaves.json
json
{
    "pools": [
        {
            "rolls": 1,
            "entries": [
                {
                    "type": "item",
                    "name": "minecraft:apple",
                    "weight": 1
                },
                {
                    "type": "item",
                    "name": "wiki:custom_sapling_placer",
                    "weight": 5
                },
                {
                    // Nothing will drop
                    "type": "empty",
                    "weight": 10
                }
            ]
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

This will spawn wiki:custom_sapling

BP/loot_tables/blocks/custom_sapling.json
json
{
    "pools": [
        {
            "rolls": 1,
            "entries": [
                {
                    "type": "item",
                    "name": "wiki:custom_sapling_placer"
                }
            ]
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13

Exporting Structures ​

Build a tree for your sapling to grow into!

Tree Features ​

TIP

Tree Features are a really great way to get actual custom trees. You need some understanding on how they work but for this tutorial you can uses these templates.

Feature
BP/feature/custom_tree_feature.json
json
{
    "format_version": "1.13.0",
    "minecraft:tree_feature": {
        "description": {
            "identifier": "wiki:custom_tree_feature"
        },
        "trunk": {
            "trunk_block": "wiki:custom_log",
            "trunk_height": {
                "range_min": 4,
                "range_max": 7
            }
        },
        "canopy": {
            "leaf_block": "wiki:custom_leaves",
            "canopy_offset": {
                "min": -3,
                "max": 0
            },
            "variation_chance": [
                {
                    "numerator": 1,
                    "denominator": 2
                },
                {
                    "numerator": 1,
                    "denominator": 2
                },
                {
                    "numerator": 1,
                    "denominator": 2
                },
                {
                    "numerator": 1,
                    "denominator": 1
                }
            ]
        },
        "base_block": [
            "minecraft:dirt",
            {
                "name": "minecraft:dirt",
                "states": {
                    "dirt_type": "coarse"
                }
            }
        ],
        "may_grow_on": [
            "minecraft:dirt",
            "minecraft:grass",
            "minecraft:podzol",
            {
                "name": "minecraft:dirt",
                "states": {
                    "dirt_type": "coarse"
                }
            },
            {
                "name": "minecraft:farmland",
                "states": {
                    "moisturized_amount": 0
                }
            },
            {
                "name": "minecraft:farmland",
                "states": {
                    "moisturized_amount": 1
                }
            },
            {
                "name": "minecraft:farmland",
                "states": {
                    "moisturized_amount": 2
                }
            },
            {
                "name": "minecraft:farmland",
                "states": {
                    "moisturized_amount": 3
                }
            },
            {
                "name": "minecraft:farmland",
                "states": {
                    "moisturized_amount": 4
                }
            },
            {
                "name": "minecraft:farmland",
                "states": {
                    "moisturized_amount": 5
                }
            },
            {
                "name": "minecraft:farmland",
                "states": {
                    "moisturized_amount": 6
                }
            },
            {
                "name": "minecraft:farmland",
                "states": {
                    "moisturized_amount": 7
                }
            }
        ],
        "may_replace": [
            "minecraft:air",
            {
                "name": "minecraft:leaves",
                "states": {
                    "old_leaf_type": "oak"
                }
            },
            {
                "name": "minecraft:leaves",
                "states": {
                    "old_leaf_type": "spruce"
                }
            },
            {
                "name": "minecraft:leaves",
                "states": {
                    "old_leaf_type": "birch"
                }
            },
            {
                "name": "minecraft:leaves",
                "states": {
                    "old_leaf_type": "jungle"
                }
            },
            {
                "name": "minecraft:leaves2",
                "states": {
                    "new_leaf_type": "acacia"
                }
            },
            {
                "name": "minecraft:leaves2",
                "states": {
                    "new_leaf_type": "dark_oak"
                }
            }
        ],
        "may_grow_through": [
            "minecraft:dirt",
            "minecraft:grass",
            {
                "name": "minecraft:dirt",
                "states": {
                    "dirt_type": "coarse"
                }
            }
        ]
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
Feature Rule
BP/feature_rules/custom_tree_feature_rule.json
json
{
    "format_version": "1.13.0",
    "minecraft:feature_rules": {
        "description": {
            "identifier": "wiki:custom_tree_feature_rule",
            "places_feature": "wiki:custom_tree_feature"
        },
        "conditions": {
            "placement_pass": "surface_pass",
            "minecraft:biome_filter": [
                {
                    "test": "has_biome_tag",
                    "operator": "==",
                    "value": "plains"
                }
            ]
        },
        "distribution": {
            "iterations": 1,
            "x": {
                "distribution": "uniform",
                "extent": [0, 16]
            },
            "y": "q.heightmap(v.worldx, v.worldz)",
            "z": {
                "distribution": "uniform",
                "extent": [0, 16]
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

Resource Pack (optional guide) ​

Now it is time to make a resource pack!

Make translations for blocks:

RP/texts/en_US.lang
tile.wiki:custom_log.name=Custom Log
tile.wiki:custom_leaves.name=Custom Leaves
tile.wiki:custom_stripped_log.name=Custom Stripped Log
tile.wiki:custom_sapling.name=Custom Sapling
item.wiki:custom_sapling_placer=Custom Sapling
1
2
3
4
5

Make terrain_texture.json and textures.

RP/textures/terrain_texture.json
json
{
    "resource_pack_name": "custom-trees",
    "texture_name": "atlas.terrain",
    "texture_data": {
        "custom_leaves": {
            "textures": "textures/blocks/leaves_oak"
        },
        "custom_log": {
            "textures": "textures/blocks/log_oak"
        },
        "custom_log_top": {
            "textures": "textures/blocks/log_oak_top"
        },
        "custom_stripped_log": {
            "textures": "textures/blocks/stripped_oak_log"
        },
        "custom_stripped_log_top": {
            "textures": "textures/blocks/stripped_oak_log_top"
        },
        "custom_sapling": {
            "textures": "textures/blocks/sapling_oak"
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

Make geometry for sapling:

RP/models/blocks/custom_sapling.geo.json
json
{
    "format_version": "1.12.0",
    "minecraft:geometry": [
        {
            "description": {
                "identifier": "geometry.custom_sapling",
                "texture_width": 16,
                "texture_height": 16,
                "visible_bounds_width": 2,
                "visible_bounds_height": 2.5,
                "visible_bounds_offset": [0, 0.75, 0]
            },
            "bones": [
                {
                    "name": "sapling",
                    "pivot": [0, 0, 0],
                    "cubes": [
                        {
                            "origin": [-8, 0, 0],
                            "size": [16, 16, 0],
                            "pivot": [0, 0, 0],
                            "rotation": [0, 45, 0],
                            "uv": {
                                "north": { "uv": [0, 0], "uv_size": [16, 16] }
                            }
                        },
                        {
                            "origin": [-8, 0, 0],
                            "size": [16, 16, 0],
                            "pivot": [0, 0, 0],
                            "rotation": [0, -45, 0],
                            "uv": {
                                "north": { "uv": [0, 0], "uv_size": [16, 16] }
                            }
                        }
                    ]
                }
            ]
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

Make item_texture file

RP/textures/item_texture.json
json
{
    "resource_pack_name": "custom-trees",
    "texture_name": "atlas.items",
    "texture_data": {
        "custom_sapling_placer": {
            "textures": "textures/blocks/sapling_oak"
        }
    }
}
1
2
3
4
5
6
7
8
9

Add sounds to blocks

RP/blocks.json
json
{
    "format_version": "1.21.40",
    "wiki:custom_leaves": {
        "sound": "grass"
    },
    "wiki:custom_log": {
        "sound": "wood"
    },
    "wiki:custom_stripped_log": {
        "sound": "wood"
    },
    "wiki:custom_sapling": {
        "sound": "grass"
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Result ​

What you have created:

      • 📝custom_leaves.json
      • 📝custom_log.json
      • 📝custom_stripped_log.json
      • 📝custom_sapling.json
      • 📝custom_tree_feature.json
      • 📝custom_tree_feature_rule.json
      • 📝custom_sapling_placer.json
        • 📝custom_leaves.json
        • 📝custom_leaves_shears.json
        • 📝custom_sapling.json
      • 🏛custom_tree.mcstructure
    • 📝blocks.json
      • 🈵en_US.lang
      • 📝terrain_texture.json
      • 📝item_texture.json
        • 📝custom_sapling.geo.json

Download Example Pack ​

Template Pack to use in-game to get the idea.

Download MCADDON

Contributors

Edit Custom Trees on GitHub

Bedrock Wiki by Bedrock OSS

"Minecraft" is a trademark of Mojang AB.

Bedrock OSS, Bedrock Wiki and bedrock.dev are not affiliated in any way with Microsoft or Mojang AB.

  • Privacy Policy
  • Join our Discord
  • Learn how to Contribute
  • Visit our Repository