Kamber56 Posted February 13, 2014 Posted February 13, 2014 Can anyone point out why my ore Isn't dropping any XP? I'm clueless public void dropBlockAsItemWithChance(World world, int par2, int par3, int par4, int par5, float par6, int par7){ super.dropBlockAsItemWithChance(world, par2, par3, par4, par5, par6, par7); if (this.idDropped(par5, world.rand, par7) != this.blockID){ int xp = 0; xp = MathHelper.getRandomIntegerInRange(world.rand, 2, 75); this.dropXpOnBlockBreak(world, par2, par3, par4, xp);
Jdb100 Posted February 13, 2014 Posted February 13, 2014 Haven't tried this but shouldn't it be == instead of != in your if statement. Creator of Jobo's ModLoader If I helped you could you please click the thank you button and applaud my karma.
mardiff Posted February 13, 2014 Posted February 13, 2014 Haven't tried this but shouldn't it be == instead of != in your if statement. It depends on whether or not the id that is being dropped is his ore or not. Usually if it is the ore then the block won't drop experience and will instead drop experience during smelting. He probably has another item being dropped besides his ore, so it would then make sense to drop experience since you wouldn't be smelting the item at all. If you really want help, give that modder a thank you. Modders LOVE thank yous.
Kamber56 Posted February 13, 2014 Author Posted February 13, 2014 I haven't set it to drop anything else, So By default I'm guessing its dropping itself, which it does in-game. If that helps
coolboy4531 Posted February 13, 2014 Posted February 13, 2014 Well, what you are basically telling it to do is: If the block I mined is not (the block I want's ID), then drop XP. You are basically CANCELLING the whole process because the if statement can't send you to the things you want it to do, since it doesn't match. Like Jdb100 said, try replacing != with ==, unless you are doing something extremely different then how we are seeing it.
Kamber56 Posted February 13, 2014 Author Posted February 13, 2014 I can't edit it right now as I'm on my iPad in bed; but ill be sure to do what you guys have suggested tomorrow, thanks!
Recommended Posts