Separated Leaves

Adding custom Leaves

Creating a pack

To add Leaves to the mod, first create an empty data pack (or use your own mod's resources).
In the data folder, create a folder with the name of the mod ID of the mod you are adding support for. In there, add a folder named separated_leaves. We will add the JSON files in there.
Don't know what the mod ID is? Look at the text before the ":" when hovering over the Leaves block with Advanced Tooltips enabled.
For instance, the folders for atmospheric:morado_leaves would be data/atmospheric/separated_leaves.


In the folder, add a JSON file for every tree type you want to support. You can name these whatever you want, but the name of the tree would make sense. So our file could be named morado.json.
The file exists of two parts. The leaves list and the logs list. Inside the leaves list, add all Leaves that can connect to each other. In the logs list, add all Logs that all leaves from the leaves list can connect to.
"leaves": ["atmospheric:morado_leaves", "atmospheric:flowering_morado_leaves"],
"logs": ["#atmospheric:morado_logs"]
The lists accept both Blocks and Block Tags. You can even use both in the same list. Almost every mod has got tags for their Log variants, but if such a tag does not exist, you can put the separate logs in the list yourself. As well as the default log, it should contain the stripped, wood and stripped wood variants of the log.
It is important to make separate files for every tree, not every wood type. Oak and Azalea leaves can both connect to Oak Logs, but they should not be able to connect to wood through each other. Thus they should be split into two files.

Disabling the mod in certain Biomes/Structures

Some mods and data packs add new biomes/structures with custom trees which decay with Separated Leaves on. On 1.19+, you can configure biomes and structures where the functionality of the mod should be disabled, with tags. All leaves in the specified biomes and structures should stick to any log. Simply put those biomes in the tag data/separated_leaves/tags/worldgen/biome/allow_mismatched_leaves.json and the structures in the tag data/separated_leaves/tags/worldgen/structure/allow_mismatched_leaves.json.


That should be it! If you did it properly, your game logs will include your files in the list that gets outputted when joining a world or running /reload.
You can also use Unilock's Python script to generate your files!
Last modified 1mo ago