Jump to content

Recommended Posts

Posted

Hey, I was wondering if and how you change the harvest level of a block with multiple variants or metadata.

 

For example I have made this block which in my initiation class is called "ORE_OVERWORLD" which is in the class BlockOres  where it's currently split into two variants of ores and I want the first ore to be able to be minable by iron by setting its harvest level to 2 but I want the second ore to only be able to be minable by the first ore by setting its harvest level to 4 but I don't know how to go about doing this.


I've seen people talking about overriding the setHarvestLevel but I don't know how to do that either so if someone could point me in a direction where I can read up on that more that'd be great.

Posted

override canHarvestBlock

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.

Posted

It worked!

This was far more easier than I anticipated, I have a tendancy to overcomplicate everything that has the easiest of solutions... Thank you so much for pointing out that I was missing the obvious :D

Posted
1 hour ago, Phealin said:

Isn't that for tools only though?


What I wanted to change was the harvest levels required on the two different variants of the block.

That's a method in the Block class.

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.

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

×   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.

Announcements



×
×
  • Create New...

Important Information

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