RegalBlaze Posted March 31, 2013 Posted March 31, 2013 Hi guys, This is probably very easy to fix but i don't know what is wrong.. I made a block of salt. When mined this block should drop 4 salt items. Think of redstone dropping redstone dust. I use the idDropped(){} code which used to work just fine, but now when it needs to drop an item nothing happens. I tried to let it drop blocks and it works just fine but when it should drop an item i get the following error: Attempted to add a EntityItem to the world with a invalid item: ID 601 at (-787,39, 4,68, 1122,23), this is most likely a config issue between you and the server. Please double check your configs What should i do? Quote
Draco18s Posted March 31, 2013 Posted March 31, 2013 There's another function saying how many items should drop. Uh...ah, public int quantityDropped(Random par1Random) 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.
RegalBlaze Posted March 31, 2013 Author Posted March 31, 2013 I've added it but still the same error... For good measure, here's my code SaltBlock: package mods.aom.common; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; public class BlockSalt extends Block { public BlockSalt(int ID, Material material) { super(ID, material); this.setCreativeTab(CreativeTabs.tabBlock); } public void registerIcons(IconRegister iconreg){ this.blockIcon = iconreg.registerIcon("aom:SaltBlock"); } public int idDropped(int par1, Random par2Random, int par3) { return Aom.SaltID; } public int quantityDropped(Random par1Random) { return 4 + par1Random.nextInt(5); } } SaltItem: package mods.aom.common; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; public class ItemSalt extends Item { public ItemSalt(int par1) { super(par1); this.setCreativeTab(CreativeTabs.tabMaterials); } public void updateIcons(IconRegister iconregister){ this.iconIndex = iconregister.registerIcon("aom:Salt"); } } Quote
endershadow Posted March 31, 2013 Posted March 31, 2013 you have to tell it to do Aom.Salt.ItemID otherwise it will try to drop something with the unshifted ID. Quote
RegalBlaze Posted April 1, 2013 Author Posted April 1, 2013 Works like a charm, thank you very much 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.