Unable to change leaf loot tables (1.16.5-0.10.0-Beta12)
Lyle-Tafoya opened this issue · 5 comments
Describe the bug
For various reasons, a person may wish to change the loot tables for various leaf blocks. When using a data pack to change loot tables for leaf blocks, Dynamic Trees causes the leaf loot tables to revert to their defaults, ignoring any changes made by data packs. In my case, I am trying to increase the drop rate of sticks.
To Reproduce
Install Dynamic Trees
Override the loot table for a leaf block (ie. "datapacks/vanilla/data/minecraft/loot_tables/blocks/spruce_leaves.json")
Start breaking leaves (it will soon become apparent that the loot table does not work)
I have also tried creating loot table entries for the same blocks under the dynamictrees namespace to see if that would work, but that doesn't appear to make a difference either.
The reason I am reporting this as a bug rather than a feature request is because it looks like this was an issue in the past and has already been fixed: #455
I have verified that my loot tables work correctly without mods installed and only stop working once Dynamic Trees is installed.
We handle drops these drops in a different way since trees are a multi block structure. We instead use "drop creators", which also handle voluntary leaves drops, log drops, and leaves drop (both when harvested by the player and when cutting down a tree).
Whilst at the moment you're unable to edit these using Tree Packs, I'm working on an entry for them. This will give the player full access to any drops from a dynamic tree added by the aforementioned drop creators.
However I suppose we could also load any drops from loot tables if one is present, which would allow you to add your own loot tables (using the dynamictrees
namespace) for when leaves blocks are broken individually until we the add drop creators to tree packs.
However I suppose we could also load any drops from loot tables if one is present, which would allow you to add your own loot tables (using the
dynamictrees
namespace) for when leaves blocks are broken individually until we the add drop creators to tree packs.
If that's easy for you to do, it would help me to get my mod pack working the way I want. However, I wouldn't want duplication of efforts if this same functionality will be achievable via tree packs.
It's all right I looked into it and will only take a couple of lines of code. In fact, we already allow for using loot tables for the apple fruit. I'm going to release a new version later due to some major world gen bug fixes and this will be included there (though note it will still only be for when breaking the block by hand, not when the tree falls over).
Awesome! Thank you. I just built it with that commit and tested it out. It seems to be working.
As far as the loot from falling trees goes, will that be changeable via tree packs in the future? The only reason I ask is because I will probably want to change the loot from that based on whether an axe was used to fell the tree or another tool etc...