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

Hello,

I believe i know how to change the harvest level of a vanilla block but what i was wondering was how to prevent it from being broken with your fist.  Thanks for any help.

  • Author

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.

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.

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.

  • Author

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?

  • Author

I find them to generally be messy in my experiences with them but i did say that i use them when i must.

  • Author

I find that for things like what im trying to achieve here i'd rather be able to change a value in the block class than check multiple values in an event and respond accordingly.

  • Author

Fair enough i didnt really think about that.  So can you explain to me where to put the events i need to use?

  • Author
11 minutes ago, Franckyi said:

HarvestDropsEvent::getDrops().clear() ?

Yes thank you that works perfectly

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.