Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

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

By the way, the default ItemAxe harvest most things wooden independently of the block harvest level.

 

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

  • Author
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.

  • 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". :)

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.

Out of interest, why are you still modding in 1.6.4?

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

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/

Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.