Jump to content

Changing required harvest level?


Atijaf

Recommended Posts

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)

Link to comment
Share on other sites

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));

}

}

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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/

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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