Strength/Hardness/Resistance being set improperly high on blocks with custom class
See original GitHub issueI have a several custom blocks that all mine 10x+ slower than the block that they copy the settings of. None of the classes touch the settings at all, simply passing it to their super.
public CompressedBlock(Settings settings,int level) {
super(settings);
this.setDefaultState(this.getDefaultState().with(compression,level));
}
public static final Block monuple_compressed_cobblestone_block = new CompressedBlock(FabricBlockSettings.copyOf(Blocks.COBBLESTONE), 1);
This is an example of one of the blocks. When mining it breaks as slow as obsidian. I tried this as well (copied straight from vanilla minecraft code)
public static final Block monuple_compressed_cobblestone_block = new CompressedBlock(AbstractBlock.Settings.of(Material.STONE).requiresTool().strength(2.0F, 6.0F), 1);
and it had the same result. Testing it by changing it to a vanilla class, like HayBlock, did work however. Then it would copy all of the settings of the block and break at the appropriate speed, however I lose my custom functionality.
Would love for someone to tell me that I’m dumb and what I did wrong, but this system worked fine with 1.16.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
WordPress Editor » Add Additional CSS Classes to Blocks
To add an additional CSS class to a block, click on the block you are editing. Then, check the block settings on the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
BTW if anyone else was wondering, you still have to add your tools to the tag in fabric/tags/items for it to work
Alright I solved it. Minecraft tag jsons don’t matter. You have to append
.breakByTool(FabricToolTags.PICKAXES)
to the registration.what I was doing
what works
The Json file seems to matter for… well I don’t know what it would matter for actually. Doesn’t make a bit of a difference here.