KubeJS-Mods / KubeJS

https://kubejs.com
GNU Lesser General Public License v3.0
309 stars 91 forks source link

【BUG】Can not change "Block Modification" requiredTool #418

Open blood789 opened 2 years ago

blood789 commented 2 years ago

Minecraft Version

1.19

KubeJS Version

kubejs-fabric-1900.5.5-build.27

Rhino Version

rhino-fabric-1802.1.14-build.190

Architectury Version

architectury-5.9.31-fabric

Forge/Fabric Version

fabric-api-0.57.0+1.19/1.19-Fabric 0.14.8

Describe your issue

I making a modpack, and want to change the harvest level of the tool and Modify the tools needed to mine the block.

Here is an example.

  1. Can not change requiredTool of the block. I write as this, and I would like to change the player to need an axe to chop down trees. But it does't work, I can chop down trees with hand. Can you give some example to change harvestTool('tool', level) for all block ? For example, Iron ore requires a copper pickaxe to mine and stone pickaxe can not mine the iron ore. -------------Level(Change)-----------vanilla
    wooden ----0 -----------------------------0 stone--------1----------------------------1 copper------2------------------------------- iron---------3-----------------------------2 diamond----4-----------------------------3 Mithril-------5 Netherite----6 ...

onEvent('block.modification', event => { event.modify('minecraft:birch_log', block => { block.requiredTool = true // Make chop down the tree need an axe. }) })

  1. In minecraft, the level of iron tool is 2, and it can mine the diamond ore. So is there a way to change the require level of the block? For example, mine the diamond ore need level 5.

Crash report/logs

No response

ChiefArug commented 2 years ago

In 1.18 Mojang changed the tool tier and type system to use block tags instead. I updated the custom blocks page to reflect that, but forgot to do block mod too.

For more info which tags are what see the custom blocks page, or I'm sure the vanilla wiki has a page on it. You can also look at existing blocks with F3 open to see the tags they use.

ChiefArug commented 2 years ago

Not being able to change if a tool is required may still be a bug, or it could be failing due to what I described above.