Jump to content

Set Harvest Level of Vanilla Block


drok0920

Recommended Posts

I have tried using 

Blocks.LOG.setHarvestLevel("axe", 0);

But i can still harvest it with my fist.  I can even harvest it with wood axe when i change the level to 2.  Am i doing something wrong or is it not possible to change vanilla block properties.

Link to comment
Share on other sites

1 hour ago, drok0920 said:

I have tried using 


Blocks.LOG.setHarvestLevel("axe", 0);

But i can still harvest it with my fist.  I can even harvest it with wood axe when i change the level to 2.  Am i doing something wrong or is it not possible to change vanilla block properties.

It actually only seems to be certain Blocks. For example I can do Blocks.DIAMOND_ORE, but not to either of the Logs. If you really want to override the logs like that use events.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

2 hours ago, drok0920 said:

I have tried using 


Blocks.LOG.setHarvestLevel("axe", 0);

But i can still harvest it with my fist.  I can even harvest it with wood axe when i change the level to 2.  Am i doing something wrong or is it not possible to change vanilla block properties.

You forgot about the can_harvest_with_fist_if_Material_allows_it property


    public static final Material WOOD = (new Material(MapColor.WOOD)).setBurning(); //does not need tool
    public static final Material ROCK = (new Material(MapColor.STONE)).setRequiresTool(); //requires tool

Edited by Draco18s

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.

Link to comment
Share on other sites

Well i'd like to avoid using events because i personally dislike them but i will use them if it's the only way to achieve this.  @Draco18sThe methods used to set whether or not ir requires a tool are protected so i cannot change them.  Are events the only way to do what i'd like to do?

Link to comment
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.
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.