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've just begun updating my mod, and have found that setBlockHarvestLevel and setToolClass functions have moved, but no idea where they moved to. Anybody know?

Apparently you have to override it in your block class:

https://github.com/MinecraftForge/MinecraftForge/blob/master/src/main/java/net/minecraftforge/common/ForgeHooks.java

 

Line 99 -> method canToolHarvestBlock(Block block, int metadata, ItemStack stack)

 

You can see that block#getHarvestTool(metadata) & block.getHarvestLevel(metadata) are getting called. From that I can conclude you have to override it :)

 

As for setting a custom tool class, I couldnt find it as quickly as this. (I spent 5 minutes :P )

I am fairly new to Java and modding, so my answers are not always 100% correct. Sorry for that!

  • Author

Um, that wasn't what I was going for, but never mind, as I is dumb, and have found the problem.

Um, that wasn't what I was going for, but never mind, as I is dumb, and have found the problem.

so how did you fix it?

Only code when your having fun doing it.

  • Author

Vanilla Minecraft comes with the command, so you just use:

 

exampleBlock.setHardnessLevel("pickaxe", 2);

 

For the setToolClass, I still have no idea, but I was just worried about the harvest level, which you establish when you set the tool material.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.