Jump to content

flamehougher

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by flamehougher

  1. Yay i now have a sword that dose damage but its problem now is the texture is missing and wont do anything and i have know idea why it is doing this or what part of code it making it do this and it says the texture ZanofieSword.png is missing but its not, it scans right over it and goes here it..........wait here is no texture while holding it arg im gonna smash my computer soon pleas help....... :'( package mods.zanofite.common; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemSword; import net.minecraftforge.common.EnumHelper; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="Zanofite", name = "Zanofite", version = "0.0.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class Zanofite { public static final int itemzanofite = 501; public static final int itemzanofitesword=502; public static final EnumToolMaterial ZanofiteToolMaterial = EnumHelper.addToolMaterial("Zanofite", 6, 3000, 12, 6, 21); public static final Item ZanofiteItem = new ItemZanofite(itemzanofite).setUnlocalizedName("Itemzanofite"); public static final Item ZanofiteSword = new ItemSword(itemzanofitesword, ZanofiteToolMaterial).setUnlocalizedName("ZanofiteSword"); @Init public void load(FMLInitializationEvent event){ ZanoItemWork(); SwordWork(); } private static void ZanoItemWork(){ LanguageRegistry.addName(ZanofiteItem, "Zanofite Item"); } private static void SwordWork(){ GameRegistry.registerItem((net.minecraft.item.ItemSword) ZanofiteSword, "ZanofiteSword"); LanguageRegistry.addName(ZanofiteSword, "Zanofite Sword"); } }
  2. Okay so i copied the code you put up word for word respectively and i get this package mods.zanofite.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.ItemSword; import net.minecraft.item.ItemTool; import net.minecraftforge.common.EnumHelper; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Item; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="Zanofite", name = "Zanofite", version = "0.0.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class Zanofite { public static final int itemzanofite = 501; public static final int itemzanofitesword=502; public static final EnumToolMaterial ZanofiteToolMaterial = EnumHelper.addToolMaterial("Zanofite", 6, 3000, 12, 6, 21); public static final Item ZanofiteItem = new ItemZanofite(itemzanofite).setUnlocalizedName("Itemzanofite"); //error^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from Item to Mod.Item public static final Item ZanofiteSword = (new ItemSword(itemzanofitesword, ZanofiteToolMaterial)).setUnlocalizedName(ZanofiteSword, "ZanofiteSword"); //error^^^^^^^^^^^^^^^^^^^^^^^^^ Cannot reference a field before it is defined @Init public void load(FMLInitializationEvent event){ itemzanofite = new ItemZanofite(501).setUnlocalizedName("Itemzanofite"); //error^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Type mismatch: cannot convert from Item to int ZanoItemWork(); } private static void ZanoItemWork(){ GameRegistry.registerItem((net.minecraft.item.Item) itemzanofite, "ItemZanofite"); //error^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Cannot cast from int to Item LanguageRegistry.addName(ZanofiteItem, "Zanofite Item"); } private static void SwordWork(){ GameRegistry.registerItem((net.minecraft.item.ItemSword) ZanofiteSword, "ItemZanofite"); LanguageRegistry.addName(ZanofiteSword, "Zanofite Sword"); } } and the error when starting it is
  3. OK so i moved all the files but i'm still getting the same problems
  4. Okay I hate to bother people but I need help again, there are red lines under all of the comers, ItemZanosword and the semi colon at the end of new item sword and I don't know what is wrong. package mods.zanofite.common; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.item.Item; 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.util.Icon; public class ItemZanosword extends Item{ //error^^^^^^^ public static final EnumToolMaterial ZanofiteToolMaterial = EnumHelper.addToolMaterial ( "Zanofite", [harvestLevel (6)],//<error [maxUses (3000)],//<error [eficiency (12)],//<error [damage (6)],//<error [enchantability (21)]//<error ); public static final Item ZanofiteSword = (new ItemSword(itemzanofitesword, ZanofiteToolMaterial).setUnlocalizedName(ZanofiteSword, "ZanofiteSword");//<error } By this I mean that it's telling me to create the class EnumHelper and all the damage Maxuses and all that needs to be created as a method and ItemZanoSword needs a constructor.
  5. i think i'm in love with you for explaining everything, the main reason i hate forge is the none of it makes sense but you putting this in made it so much better thanks!!!!!!!
  6. Well even though I had fixed the item problem I had(with the help of the kind people on the modder support) I have run into another problem :'( The problem is that when ever I try to make the sword do the thing where it starts up with the mod it says it can't be bound to ItemSword/ItemTool/Item/ANYTHING!!!! Main Code package mods.zanofite.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.ItemTool; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Item; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="Zanofite", name = "Zanofite", version = "0.0.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class Zanofite { public static net.minecraft.item.Item ZanofiteItem; int itemzanofite = 501; public static net.minecraft.item.Item ZanofiteSword; int itemzanofitesword = 502; @Init public void load(FMLInitializationEvent event){ ZanofiteItem = new ItemZanofite(501).setUnlocalizedName("Itemzanofite"); ZanoItemWork(); ZanofiteSword = new ItemZanosword(502).setUnlocalizedName("Zanofite Sword"); SwordWork(); } private static void ZanoItemWork(){ GameRegistry.registerItem((net.minecraft.item.Item) ZanofiteItem, "ItemZanofite"); LanguageRegistry.addName(ZanofiteItem, "Zanofite Item"); } private static void SwordWork(){ //This is the Problem GameRegistry.registerItem((net.minecraft.item.ItemSword) ZanofiteSword, "ItemZanofite"); //This is the Problem ^^^^^^^^^^^^^^^^^^^^ LanguageRegistry.addName(ZanofiteSword, "Zanofite Sword"); } } Sword Code (works Fine) package mods.zanofite.common; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.item.Item; 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.util.Icon; public class ItemZanosword extends Item{ private int weaponDamage; public ItemZanosword(int id) { super(id); this.setCreativeTab(CreativeTabs.tabCombat); this.setMaxDamage(200); this.maxStackSize = 1; this.weaponDamage = 12; } public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { if (par2Block.blockID == Block.web.blockID) { return 15.0F; } else { Material var3 = par2Block.blockMaterial; return var3 != Material.plants && var3 != Material.vine && var3 != Material.coral && var3 != Material.leaves && var3 != Material.pumpkin ? 1.0F : 1.5F; } } public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) { par1ItemStack.damageItem(1, par3EntityLiving); return true; } public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving) { if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D) { par1ItemStack.damageItem(2, par7EntityLiving); } return true; } public int getDamageVsEntity(Entity par1Entity) { return this.weaponDamage; } @SideOnly(Side.CLIENT) public boolean isFull3D() { return true; } public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.block; } public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 2000; } @SideOnly(Side.CLIENT) @Override public void updateIcons(IconRegister par1IconRegister){ this.iconIndex=par1IconRegister.registerIcon("zanofite:zanofitesword1"); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); return par1ItemStack; } public boolean canHarvestBlock(Block par1Block) { return par1Block.blockID == Block.web.blockID; } } It says
  7. wow talk about rookie error never mind I fixed it.
  8. okay well changing that now gives me package mods.zanofite.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Item; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="Zanofite", name = "Zanofite", version = "0.0.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class Zanofite { public static net.minecraft.item.Item ZanofiteItem; int itemzanofite = 501; public static Block ZanofiteBlock; int blockZanofiteid = 500; @Init public void load(FMLInitializationEvent event){ ZanofiteItem = new ItemZanofite(501).setUnlocalizedName("Itemzanofite"); gameRegisters(); languageRegisters(); } private static void gameRegisters(){ GameRegistry.registerItem((net.minecraft.item.Item) ZanofiteItem, "ItemZanofite"); } private static void languageRegisters(){ LanguageRegistry.addName(ZanofiteBlock, "Zanofite Block"); } } there are no errors now though eclipse, but when I start it I get this. I now have idea what is happening
  9. I don't want to sound like a 12 year old but if someone could show me the code for just a basic item, no crafting or anything just the item it would be great. I hate getting angry at this and that's all that's happening at the moment.
  10. sorry the line that has //Problem above it is the one i'm getting red lines under it and it's saying that i need to make it and item.....which it already is but then once i do what it says the hole class goes red.
  11. I have been trying to make myself a sword that will work in a server or just normal Minecraft. I have run into many problems but I have been able to fix them. It's the same problem every time but this time I can not fix it. Zanofite Class code package mods.zanofite.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Item; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="Zanofite", name = "Zanofite", version = "0.0.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class Zanofite { static Item ZanofiteItem; int itemzanofite = 501; static Block ZanofiteBlock; int blockZanofiteid = 500; @Init public void load(FMLInitializationEvent event){ //Problem ZanofiteItem = new ItemZanofite(Item()).setUnlocalizedName("Itemzanofite"); gameRegisters(); languageRegisters(); } private static void gameRegisters(){ GameRegistry.registerItem((net.minecraft.item.Item) ZanofiteItem, "ItemZanofite"); } private static void languageRegisters(){ LanguageRegistry.addName(ZanofiteBlock, "Zanofite Block"); } } And the ZanofiteItem Code package mods.zanofite.common; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.item.Item; 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.util.Icon; public class ItemZanofite extends Item{ public ItemZanofite(int id) { super(id); this.setMaxStackSize(64); this.setCreativeTab(CreativeTabs.tabMaterials); this.setUnlocalizedName("Zanofite"); } @SideOnly(Side.CLIENT) @Override public void updateIcons(IconRegister par1IconRegister){ this.iconIndex=par1IconRegister.registerIcon("zanofite:zanofite"); } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.