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

how to make a block that only can be harvested by one toolclass

Recommended Posts

i don't want to make an github don't want to make it open-source it's still in development gonna realease it soon and what i did imported IBlockState needs to be IBlockAccess. about open-source maybe in the feature i'm gonna make some sort of api or something for my mod and that you can use it for you're mod

Link to post
Share on other sites
10 minutes ago, DiamondMiner88 said:

Then whats a better way to do it? I posted my code at the top of my page and is that bad too?

There should be no code needed, this is absolute basic Java.

But: You do not need the if and using equals to compare Item instances makes no sense.

Link to post
Share on other sites
On 12/30/2018 at 1:14 AM, diesieben07 said:

Override Block#canHarvestBlock and only return true if the player is using your tool.

This is a good tutorial


however it requires you to sign up I think. I personally like https://www.tutorialspoint.com/java, but it’s a bit technical and assumes a bit of prior knowledge

Edited by Cadiboo

About Me


My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.

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.