Jump to content

Recommended Posts

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?

Posted

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.

Posted

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.

Posted

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)

Posted

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"?

Posted

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

}

}

Posted

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

Posted

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/

Posted

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?

Posted

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.

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.