[1.15.2] Mod Interaction - Kubejs
TheUntamed opened this issue ยท 7 comments
Hi,
I'm sorry, I was so busy the last month that I totally forgot this. I came back to this issue because I created a mod that adds blocks of material sand with a harvest level and it had the same problems as described above.
This weekend I tested a lot with your mod and the new commit you pushed to fix it.
Sadly the problem seems to be embedded deep down in the core of minecraft.
If a block of a material that has not the pickaxe as harvesttool (e.g. sand) and you give that block a harvestlevel, it is not treated as a block of that material anymore and also .canHarvestBlock() returns false for a shovel. Something about harvestlevels in combination with shovel or axe is completely broken. I hope mojang will fix that in the future.
But for now event.setCanceled(true); inside your StoneBreak class is always called for a block with harvestlevel of any material and any tooltype.
Most of the time that shouldn't be a problem. In my case it would be neat if you could add a boolean config value and wrap the whole content of your StoneBreak event in an if(conf value) statement.
PS: in the Use ItemStack#canHarvestBlock() instead of tooltype commit wood breaking is broken. Maybe (but im not sure) due to the
event.getPlayer().getHeldItemMainhand().canHarvestBlock(event.getState())
change. If that's the case I think you can just revert this change cause it didn't help anyway.
Huh ok, I'll look into other ways to implement this then. I can imagine where this is an issue it was just unexpected behavior!
Ok I think I've fixed it but I've still got to test it! I'll let you know how that goes :)
Can you post your KubeJS script? I have no idea how to use KubeJS enough to change a block's harvest tool.
I did exactly what you have here (other than changing the json
o use myharvestlevels.js
instead of mytooltips.js
) and I cannot get this to work. I'll just have to upload the new release and have you test it and see if it works?