Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[SOLVED] [1.16.1] Block harvest level and tool is ignored.


Recommended Posts

Hello,

I've set my mod block harvest tool to pickaxe and level to 1, which should cause it to drop nothing when mined with a wooden pickaxe. However this not only does not take place, but I'm even able to harvest the block by mining it with a bare hand.

 

Code details

Block registration:

public static final RegistryObject<Block> COPPER_ORE = BLOCKS.register("copper_ore", MetalOreBlock::new);

MetalOreBlock class:

package ...

import ...

public class MetalOreBlock extends Block {

    public MetalOreBlock() {
        super(Block.Properties
                .create(Material.ROCK)
                .sound(SoundType.STONE)
                .hardnessAndResistance(3.0f, 3.0f)
                .harvestLevel(1)
                .harvestTool(ToolType.PICKAXE)
        );
    }
}

 

How to fix it?

Thanks in advance!

Edited by RubyNaxela
  • Like 1
Link to post
Share on other sites

What version of Forge?  I believe this was fixed in, uhm, 32.0.55.

 

Quote

Build: 1.16.1-32.0.55 - Mon Jul 06 21:12:45 GMT 2020
	richard:
		Fix harvest level and tool type not actually getting set #6906 (#6922)

 

Link to post
Share on other sites

Hello! 

 

I am experiencing an identical problem with the exact line of code you posted above 

 and I was wondering if you could be more specific with how you implemented the solution (mentioned in your latest comment) to the problem...

 

Thanks!

Link to post
Share on other sites
4 hours ago, Lazertops64 said:

I am experiencing an identical problem with the exact line of code you posted above 

 and I was wondering if you could be more specific with how you implemented the solution (mentioned in your latest comment) to the problem...

My block class look like this:

package ...

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraftforge.common.ToolType;

public class MetalBlock extends Block {

    public MetalBlock() {
        super(Block.Properties
                .create(Material.IRON)
                .sound(SoundType.METAL)
                .hardnessAndResistance(5.0f, 6.0f)
                .harvestLevel(1)
                .harvestTool(ToolType.PICKAXE)
                .setRequiresTool()  //or func_235861_h_()
        );
    }
}

and I'm mining it with vanilla tools. I haven't created any tools in my mod yet to test it out. Are you experiencing the problem with vanilla tools?

  • Thanks 2
Link to post
Share on other sites
8 hours ago, RubyNaxela said:

.harvestLevel(1)

0 = none

1 = wood

2 = stone

3 = iron

4 = diamond

  • Thanks 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to post
Share on other sites

I'm using forge MDK version 32.0.74.

 

I  haven't gotten to trying my hand at making custom tools yet. So I am also mining it with vanilla tools to test it out...

 

i am currently testing out the solution:

 

.setRequiresTool()

 

for me its 

.func_235861_h_()
Edited by Lazertops64
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.