i have my code set out "public static Item genericEntity = new Item(5001).setUnlocalizedName("sapphire").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("genericEntity");" ive pasted it into the net.minecraft.items.Items. i dont see why it cant find it. is there something wrong with my code
to be fair eclipse wouldnt find the code unless i typed it in there
Also, if im meant to replace Item.genericEntity.ItemID, then its giving me errors.
That is why you should use a Mod API like Forge, it adds compatibility to mods so that you can have multiple mods which adds items. http://www.minecraftforge.net/forum/ <--- Forge's Forum
ive been following tutorials. I made a new package and called it tutorial.basic and i have a bunch of extra item testing classes within that package including blocks and items etc.
So I guess you have a mod class then, so you should place this in it:
public static Item genericEntity = new Item(5001).setUnlocalizedName("sapphire").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("genericEntity");
thing is, when i extract it as an actual mc mod, the entity shows up just fine, so im pretty sure theres nothing wrong with the coding of the item, but im sure that somethings wrong with the coding of my ore that drops the sapphire.
heres the code
public int idDropped(int metadata, Random random, int fortune){
return Basic.genericEntity.itemID;
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
// TODO Auto-generated method stub
if(par3World.getBlockId(par4, par5, par6) == Block.doorIron.blockID){
int id = par3World.getBlockMetadata(par4, par5, par6);
int j1 = 10 & 7;
j1 ^= 4;
switch(id){
case 0:
par3World.setBlockMetadataWithNotify(par4, par5, par6, j1 - 2, 2);
break;
case 1:
par3World.setBlockMetadataWithNotify(par4, par5, par6, j1 - 1, 2);
break;
case 2:
par3World.setBlockMetadataWithNotify(par4, par5, par6, j1, 2);
break;
case 3:
par3World.setBlockMetadataWithNotify(par4, par5, par6, j1 + 1, 2);
break;
case 4:
par3World.setBlockMetadataWithNotify(par4, par5, par6, j1 + 10, 2);
break;
case 5:
par3World.setBlockMetadataWithNotify(par4, par5, par6, j1 + 11, 2);
break;
case 6:
par3World.setBlockMetadataWithNotify(par4, par5, par6, j1 - 4, 2);
break;
case 7:
par3World.setBlockMetadataWithNotify(par4, par5, par6, j1 - 3, 2);
break;
}
par3World.playSound(par4, par5, par6, "mob.pig.death", 1, 1, true);
par3World.markBlockRangeForRenderUpdate(par4, par5, par6, par4, par5, par6);
}
return true;
}
}
added fact its only working when i click the bottom half of the doorfairly i think i might have been forced to correct some variables to fit the class...i think.
As it is right now it only checks for the main door block(the bottom one). I'm not at my computer at the moment so I can't really help, I'll look into it tomorrow unless somebody else does it
And don't worry about being a problem maker, nobody knows everything right
Art by me: MrPancakeWolfie@DeviantArt
(late response, going to bed now)
Art by me: MrPancakeWolfie@DeviantArt
to be fair eclipse wouldnt find the code unless i typed it in there
Also, if im meant to replace Item.genericEntity.ItemID, then its giving me errors.
what is?
That is why you should use a Mod API like Forge, it adds compatibility to mods so that you can have multiple mods which adds items.
http://www.minecraftforge.net/forum/ <--- Forge's Forum
Art by me: MrPancakeWolfie@DeviantArt
Art by me: MrPancakeWolfie@DeviantArt
Art by me: MrPancakeWolfie@DeviantArt
heres the code
in your block class too
If that doesn't work then I'm not sure
Art by me: MrPancakeWolfie@DeviantArt
Art by me: MrPancakeWolfie@DeviantArt
(wow i sound like a problem maker)
Art by me: MrPancakeWolfie@DeviantArt
Art by me: MrPancakeWolfie@DeviantArt
added fact its only working when i click the bottom half of the doorfairly i think i might have been forced to correct some variables to fit the class...i think.
And don't worry about being a problem maker, nobody knows everything right
Art by me: MrPancakeWolfie@DeviantArt