Jump to content

[1.6.4] setting harvest level of vanilla minecraft blocks


Ziplock_Jim

Recommended Posts

I'm trying to make it so you need an axe to harvest wood and a shovel to harvest dirt.

I have tried to use the line

MinecraftForge.setBlockHarvestLevel(Block.wood, "axe", 2);

 

and also:

                MinecraftForge.setBlockHarvestLevel(Block.wood, 0, "axe", 1);
                MinecraftForge.setBlockHarvestLevel(Block.wood, 1, "axe", 1);
                MinecraftForge.setBlockHarvestLevel(Block.wood, 2, "axe", 1);
                MinecraftForge.setBlockHarvestLevel(Block.wood, 3, "axe", 1);

 

But, none of these have any effect. I can still harvest wood with my hands. I have tried similar code for dirt blocks, but it also had no effect.

However, if I use it on stone:

MinecraftForge.setBlockHarvestLevel(Block.stone, "pickaxe", 2);

Stone can only be mined with Iron or greater.

 

Any ideas on why it would work on stone but not on wood or dirt?

Link to comment
Share on other sites

Man, breaking block by hand != breaking with a tool, that is as simple as that.

 

I guess I wasn't clear on this. I want to be able to break the block with my hands, but don't want the block to drop if I do.

Like breaking stone without a pick, it breaks slower and doesn't drop anything when broken.

 

You should use the BlockEvent(s) if the conditions are met.

I already have it working using events, I was just wondering if there was an easier way to do it.

Link to comment
Share on other sites

  • 1 year later...

The best way I think is changing wood material to material which doesn't let you mine block w/ fists (like rock or iron). The

MinecraftForge.setBlockHarvestLevel(Block.wood, 3, "axe", 1);

code for wood or ground material makes such thing: "Breaking Block.wood:3 is faster w/ only stone+ axe". :)
Link to comment
Share on other sites

Leave vanilla alone. You can do it with events (HarvestDropsEvent or something like that) by checking the event.player's currently equipped item and then adjusting drop list to your needs. Done.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

This post is 2 years old! Why the f*ck are you replying to a 2 year old? This thread is now closed.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.