boyonk913 / item-components

Change the default components for items! Server-side and data-driven, refreshes on /reload! (and does it properly)
Other
2 stars 2 forks source link

Am I using the "minecraft:tool" component righ? #6

Open ppblitto opened 1 week ago

ppblitto commented 1 week ago

Hello. I'm currently using the 1.21.1 version of this mod and I don't seem to get the "minecraft:tool" component to work. I'm trying to edit the iron pickaxe break speed and make it unbreakable just for a test.

If I only put "minecraft:unbreakable": {} in components, it works, but when I add the "tool" component, the pickaxe becomes breakable again and doesn't break blocks faster, making me believe that the json isn't being read anymore.

I also tried to put just the "minecraft:tool" component with it's rules, without adding "minecraft:unbreakable" or something else, but it also won't work.

Here's the .json code below:

{ "targets": "minecraft:iron_pickaxe", "components": { "minecraft:tool": { "default_mining_speed": 1, "damage_per_block": 1, "rules": [ { "blocks": "#minecraft:mineable/pickaxe", "speed": 12, "correct_for_drops": true } ] }, "minecraft:unbreakable": {} } }

Am I missing something? Is someone else not being able to get this to work?

ppblitto commented 1 week ago

Additional info:

It works if you don't put rules, like so: image

The result is a pickaxe that can break all blocks faster than with bare hands, but cannot drop pickaxe-specific blocks, like cobblestone or ores. Meaning that you have to put rules to make the pickaxe work as intended.

It seems like the "rules" part is what is bugged.