Posted June 14, 201411 yr So, I am using getItemDropped(...) to set the items dropped from my blocks. However, I want it to multiply based on fortune - Is this automatic? And if not, what do I have to do to multiply it, considering the fact that it returns an Item, and I'm not sure how to give multiple items without an ItemStack? My block code: package us.xddrummer.harmonyrpg.blocks; import java.util.Random; import us.xddrummer.harmonyrpg.HarmonyRPG; import us.xddrummer.harmonyrpg.init.HarmonyItems; import us.xddrummer.harmonyrpg.modinfo.ItemTypes; import us.xddrummer.harmonyrpg.modinfo.ModInfo; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class AgateOre extends Block{ public AgateOre() { super(Material.rock); this.setHardness(3.0f); this.setHarvestLevel("pickaxe", ItemTypes.stoneLevel); this.setResistance(3.0f); this.setCreativeTab(HarmonyRPG.harmonyBlocksTab); this.setBlockTextureName(ModInfo.MODID + ":oreAgate"); } @Override public Item getItemDropped(int metadata, Random random, int fortune){ return HarmonyItems.agate; } } Thanks!
June 14, 201411 yr getItemDropped(...) is the call to decide what item a block drops. use quantityDropped(Random random) for non fortune drops. The method you are interested in is quantityDropped(int meta, int fortune, Random random) { return quantityDroppedWithBonus(fortune, random); } You will want to override public int quantityDroppedWithBonus(int p_149679_1_, Random p_149679_2_) to return something with the fortune value rather than the default return this.quantityDropped(p_149679_2_); My, this needs to be mapped doesn't it maybe I could go name some variables http://i1279.photobucket.com/albums/y523/textcraft/Jun%202014%20-%202/a77dd69ddfa9e622422c5e5cd7e377b14d5cdedec1b7a8e19dde68c9e22be6dfbf81219d3893f419da39a3ee5e6b4b0d3255bfef95601890afd8070929aa338b0dfc68d48355_zps0c847cf3.png[/img] I have a reputation for text walls. If you ask me a question I will most likely explain it in the most wordy way possible. -0 characters left
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.