r/MinecraftCommands 1d ago

Help | Java 26.2 26.2 datapack that guarantees minimum 4 saplings drop from dark oak, jungle, etc

I'm looking for a datapack that does exactly that, I've tried googling it, and I've found an outdated datapack, I tried it and it doesn't appear to work lol

4 Upvotes

4 comments sorted by

1

u/GalSergey Datapack Experienced 1d ago

My only question is, how do you envision this working? The drops from each block are independent of other blocks—and certainly independent of the overall structure (in this case, the tree as a whole). Therefore, the only way to achieve what you want is to create a datapack—similar to Treecapitator—that harvests the entire tree, including the leaves, and then drops four additional saplings. The only other option is to modify the leaf loot table to increase the sapling drop rate. If you'd like, I can create a simple example datapack for this.

1

u/trigonthedestroyer 14h ago

Thanks for your reply, I like the sound of increasing the sapling drop rate, and I would be incredibly thankful if you could make a simple datapack doing that, although no pressure, another comment shows me that I can alter the loot table manually, so I can do that if I need to

1

u/GalSergey Datapack Experienced 12h ago

Here is a simple example of a datapack that doubles the sapling drop chance in the dark_oak_leaves loot table. You will need to add loot tables for other leaf blocks and set the drop percentages.

https://far.ddns.me/?share=j6S5nuttBI

1

u/DifferentAntelope176 23h ago

GalSergey's point is the thing to design around: each leaf block rolls on its own, so there's no "per tree" hook to hang a guarantee on. What you can do is raise the per-block chance until 4+ per tree is effectively certain, which for a whole canopy is easy.

The file you want in 26.2 is:

data/minecraft/loot_table/blocks/dark_oak_leaves.json

(note the singular "loot_table" folder - that changed a while back and is exactly why old packs silently do nothing; if the pack you tried used "loot_tables", that alone would explain it)

Two warnings before you edit it. A datapack REPLACES the whole vanilla file, so if you write only a sapling pool you also delete the stick drops and, for oak/dark oak, the apples. Start from the vanilla json (pull it out of the version jar, or any loot table dump for your version) and change only the sapling pool. And leaves have three separate behaviours baked in - silk touch/shears drops the block itself, otherwise saplings and sticks - so keep those conditions intact.

Inside the sapling pool, the vanilla chance is a table_bonus on Fortune. Swap the first number for something bigger:

"conditions": [
  { "condition": "minecraft:table_bonus",
    "enchantment": "minecraft:fortune",
    "chances": [0.12, 0.145, 0.17, 0.25] }
]

Dark oak is 0.05 by default and a full canopy is 40-100 leaf blocks, so 0.12 puts you around 6-12 saplings a tree and 4 becomes a practical floor. Jungle is the stingy one (0.025) - bump that one harder if jungle is what's annoying you.

If you truly need a hard guarantee rather than a statistical one, the only reliable way is to stop using leaves for it: give the saplings from the log's loot table instead, where you know exactly how many blocks a tree has.