Sinhika Posted June 19, 2019 Posted June 19, 2019 (edited) Advice wanted. So: one can subclass ShearItem and make an adequate custom shear item that will shear sheep just fine. The problem is, it won't cut leaf blocks like minecraft:shears will. I did a bit of spelunking in the code and loot tables, and found that leaves being obtainable by breaking with shears is specified in the loot-table for each leaf block, by tool name (e.g. "minecraft:shears"). Because of this questionable design decision, the only way I can see to make custom shears work is to somehow iterate over all the vanilla loot-tables for each and every leaf type and add my custom shears (plural) to the list of tools that make leaves drop. First, is there a way to do this programmatically? I'm pretty sure it has changed since 1.12, everything else has. Second, how does one replace vanilla loot tables? Finally, any general advice on the best way to solve this problem? Edited June 29, 2019 by Sinhika Quote Stuff I maintain: https://minecraft.curseforge.com/members/sinhika/projects Repositories: https://github.com/Sinhika?tab=repositories
Sinhika Posted June 23, 2019 Author Posted June 23, 2019 Also, does anyone know if there's anything being done at the Forge end about this? Quote Stuff I maintain: https://minecraft.curseforge.com/members/sinhika/projects Repositories: https://github.com/Sinhika?tab=repositories
Sinhika Posted June 23, 2019 Author Posted June 23, 2019 (edited) It's a clumsy hack, but you can just override the vanilla loot tables with your own copies of them. I edited the "oak_leaves" loot table to add my mod shears. I'll have to edit all the other leaf loot tables as well. Unfortunately, this solution doesn't make my mod shears work on anyone else's leaves, nor do any other mod shears work on minecraft leaves unless they make the same override tables. It's not an ideal solution. Ideally, we'd have a shears tooltype that would dictate behavior on shear-harvestable things, not have to specify every single scythe, shear, sickle or kama in Every Single Leaf, Grass, Fern, other vegetation loot table. Tags would seem a solution to this, except the "item" predicates in loot table conditions don't seem to recognize tags. Edited June 23, 2019 by Sinhika Quote Stuff I maintain: https://minecraft.curseforge.com/members/sinhika/projects Repositories: https://github.com/Sinhika?tab=repositories
Sinhika Posted June 29, 2019 Author Posted June 29, 2019 (edited) We need a better way to do this. One of the problems I foresaw above has already come to pass: conflicting mod shears' drop tables. Help? ETA: Thread about that problem: Edited June 30, 2019 by Sinhika added link to relevant topic Quote Stuff I maintain: https://minecraft.curseforge.com/members/sinhika/projects Repositories: https://github.com/Sinhika?tab=repositories
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.