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 attempted to change the required harvest level of diamond ore to 0, but it reverts back after the game started.

 

How would I change the required harvest level for a block?

Try this in Init or postInit...

 

Blocks.diamond_ore.setHarvestLevel("pickaxe", harvestLevel);

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

  • Author

I've tried it in both.  While debugging, it shows that it changed it, but once the game starts and i attempt to break it, it doesn't drop.  It also breaks as slow as it would using my hand.

I messed a lot with that and it seems that set harvest level wont work for vanilla Blocks as you  might expect. My solution was to use breakspeed check for (in my case). Iron ore, if its iron speed It up and you got The harvest speed. For The drops use harvest drop,check for diamonds,if its diamond ore and The player isnt already getting items add some diamonds (make sure to check that The list is empty so he wont get diamonds twice when mining with iron)

  • Author

I'm using "BlockEvent.HarvestDropsEvent event", But it isn't being called because nothing is being dropped.

 

Do I have to declare that it will drop inside the "BlockEvent.BreakEvent event"?

I only used HarvestDrops and BreakSpeed and its working. show your code? are u using subscribe annotations? are u registering ur event handler?

  • Author

How do I manually use spoilers?  Not working for me:(

 

@SubscribeEvent

public void onHarvestBlock(BlockEvent.HarvestDropsEvent event){

world = event.world;

pos = event.pos;

state = event.state;

int fortune = event.fortuneLevel;

 

List<ItemStack> blockDrops = event.state.getBlock().getDrops(world, pos, state, fortune);

event.drops.clear();

event.dropChance = 1.0F;

for(int i = 0; i < blockDrops.size(); i++){

event.drops.add(blockDrops.get(i));

}

}

[.code] Epic code here[./code] (Of course without the dots I dont know how to post unformatted text)

you are clearing the list and then you iterate over the size.. so you will ALWAYS iterate over an empty list. so you wont be doing anything.

I dont know how to post unformatted text

Surround the text you want to have unformatted with the [nobbc][nobbc][/nobbc][/nobbc] tags.

How do I manually use spoilers?

Surround the text you want in a spoiler using the [nobbc]

[/nobbc] tags.

Not working for me:(

Define "not working". What is happening currently and what do you expect to happen?

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author

I have learned that you cannot edit vanilla minecraft's block hardness or harvest levels required.

 

I am now looking for an alternative...

 

How would I make diamond ore drop, even if i'm using my hand or any other tool that does not have the required harvest level to harvest diamond ore?

BlockEvent.BreakEvent.

 

When the block is broken, check the harvest level of the player's held item. If it is below the normal requirement, drop the diamond. You can also modify the amount of XP dropped.

Maker of the Craft++ mod.

Read my post. You dont use breakevent to drop items. You use harvest drops. U just need to fix ur errors and itll work

Guest
This topic is now closed to further replies.

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.