jellefly12 Posted March 10, 2014 Posted March 10, 2014 Hello , i want to make an ore dropping one of my items this is the code for the Ore dropping an Item public static int idDropped(int par1 , random par2Random , int par3){ return mod.ItemRuby.itemID; } public int QuantityDropped(Random random){ return 1; } Why do i get an error at mod.ItemRuby.itemID i know you cant use itemids anymore but i juts cant find how i can fix the error Quote
Draco18s Posted March 10, 2014 Posted March 10, 2014 Why do i get an error at mod.ItemRuby.itemID Because IDs aren't used any more. Not having dug into 1.7 yet myself all I know is that you're doing it wrong. Check vanilla ores like diamond or coal. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
jellefly12 Posted March 10, 2014 Author Posted March 10, 2014 Why do i get an error at mod.ItemRuby.itemID Check vanilla ores like diamond or coal. I found this piece od code wich i found in BlockRedstoneOre.java.patch public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); } {{{{{ if}}}}}} (this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_) != Item.getItemFromBlock(this)) private Random rand = new Random(); private Random rand1 = new Random(); @Override // World, meta, fortune public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) { if (this.getItemDropped(p_149690_5_, rand, p_149690_7_) != Item.getItemFromBlock(this)) { int j1 = 1 + p_149690_1_.{{{{{{{{rand}}}}}}.nextInt(5); return 1 + rand.nextInt(5); } return 0; } i just copyed it and it gives me errors 0.0 i have marked the errosrs in these things {{{{{{ }}}}}} not that i dont know java i'm just not experienced enough to find the problem . Quote
Millennium3 Posted March 10, 2014 Posted March 10, 2014 Did you import it? is "mod" your main class file name? Remove the .itemID? Quote
jellefly12 Posted March 10, 2014 Author Posted March 10, 2014 Did you import it? is "mod" your main class file name? Remove the .itemID? I did try to remove .itemID and it gives error you can change the method return type to item (wich doesnt work) and you can change type of itemRuby to an Int (wich gives errors in your main modding class) Quote
Parker8283 Posted March 10, 2014 Posted March 10, 2014 public Item getItemDropped(int par1, Random par2Random, int par3) { return mod.exampleItem; } public int quantityDropped(Random par1Random) { return 1; } Quote
Recommended Posts
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.