flamehougher
-
Posts
11 -
Joined
-
Last visited
Posts posted by flamehougher
-
-
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
2013-04-06 10:58:46 [iNFO] [ForgeModLoader] Forge Mod Loader version 5.1.8.611 for Minecraft 1.5.1 loading2013-04-06 10:58:46 [iNFO] [ForgeModLoader] Java is Java HotSpot 64-Bit Server VM, version 1.7.0_17, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
2013-04-06 10:58:46 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
2013-04-06 10:58:48 [iNFO] [sTDOUT] 229 recipes
2013-04-06 10:58:48 [iNFO] [sTDOUT] 27 achievements
2013-04-06 10:58:48 [iNFO] [Minecraft-Client] Setting user: Player824
2013-04-06 10:58:48 [iNFO] [sTDOUT] (Session ID is -)
2013-04-06 10:58:48 [iNFO] [sTDERR] Client asked for parameter: server
2013-04-06 10:58:48 [iNFO] [Minecraft-Client] LWJGL Version: 2.4.2
2013-04-06 10:58:49 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization
2013-04-06 10:58:49 [iNFO] [sTDOUT] MinecraftForge v7.7.1.611 Initialized
2013-04-06 10:58:49 [iNFO] [ForgeModLoader] MinecraftForge v7.7.1.611 Initialized
2013-04-06 10:58:49 [iNFO] [sTDOUT] Replaced 85 ore recipies
2013-04-06 10:58:49 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization
2013-04-06 10:58:49 [iNFO] [ForgeModLoader] Reading custom logging properties from A:\Minecraft Mods\forge\mcp\jars\config\logging.properties
2013-04-06 10:58:49 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
2013-04-06 10:58:49 [iNFO] [ForgeModLoader] Searching A:\Minecraft Mods\forge\mcp\jars\mods for mods
2013-04-06 10:58:51 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2013-04-06 10:58:51 [iNFO] [mcp] Activating mod mcp
2013-04-06 10:58:51 [iNFO] [FML] Activating mod FML
2013-04-06 10:58:51 [iNFO] [Forge] Activating mod Forge
2013-04-06 10:58:51 [iNFO] [Zanofite] Activating mod Zanofite
2013-04-06 10:58:51 [iNFO] [sTDERR] Exception in thread "Minecraft main thread" java.lang.Error: Unresolved compilation problems:
2013-04-06 10:58:51 [iNFO] [sTDERR] Type mismatch: cannot convert from Item to Mod.Item
2013-04-06 10:58:51 [iNFO] [sTDERR] The method setUnlocalizedName(String) in the type Item is not applicable for the arguments (Mod.Item, String)
2013-04-06 10:58:51 [iNFO] [sTDERR] Cannot reference a field before it is defined
2013-04-06 10:58:51 [iNFO] [sTDERR] Type mismatch: cannot convert from Item to int
2013-04-06 10:58:51 [iNFO] [sTDERR] Cannot cast from int to Item
2013-04-06 10:58:51 [iNFO] [sTDERR]
2013-04-06 10:58:51 [iNFO] [sTDERR] at mods.zanofite.common.Zanofite.<init>(Zanofite.java:26)
2013-04-06 10:58:51 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2013-04-06 10:58:51 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
2013-04-06 10:58:51 [iNFO] [sTDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
2013-04-06 10:58:51 [iNFO] [sTDERR] at java.lang.reflect.Constructor.newInstance(Unknown Source)
2013-04-06 10:58:51 [iNFO] [sTDERR] at java.lang.Class.newInstance0(Unknown Source)
2013-04-06 10:58:51 [iNFO] [sTDERR] at java.lang.Class.newInstance(Unknown Source)
2013-04-06 10:58:51 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer$JavaAdapter.getNewInstance(FMLModContainer.java:129)
2013-04-06 10:58:51 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:487)
2013-04-06 10:58:51 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-04-06 10:58:51 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-04-06 10:58:51 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-04-06 10:58:51 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source)
2013-04-06 10:58:51 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
2013-04-06 10:58:51 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-04-06 10:58:51 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
2013-04-06 10:58:51 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
2013-04-06 10:58:51 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267)
2013-04-06 10:58:51 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
2013-04-06 10:58:51 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-04-06 10:58:51 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-04-06 10:58:51 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-04-06 10:58:51 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source)
2013-04-06 10:58:51 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
2013-04-06 10:58:51 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-04-06 10:58:51 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
2013-04-06 10:58:51 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
2013-04-06 10:58:51 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267)
2013-04-06 10:58:51 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
2013-04-06 10:58:51 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:502)
2013-04-06 10:58:51 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:160)
2013-04-06 10:58:51 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:407)
2013-04-06 10:58:51 [iNFO] [sTDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
2013-04-06 10:58:51 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:729)
2013-04-06 10:58:51 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source)
2013-04-06 10:59:33 [iNFO] [sTDERR] Someone is closing me!
-
OK so i moved all the files but i'm still getting the same problems
-
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.
-
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!!!!!!!
-
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
2013-04-01 15:33:19 [iNFO] [ForgeModLoader] Forge Mod Loader version 5.1.8.611 for Minecraft 1.5.1 loading2013-04-01 15:33:19 [iNFO] [ForgeModLoader] Java is Java HotSpot 64-Bit Server VM, version 1.7.0_17, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
2013-04-01 15:33:19 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
2013-04-01 15:33:21 [iNFO] [sTDOUT] 229 recipes
2013-04-01 15:33:21 [iNFO] [sTDOUT] 27 achievements
2013-04-01 15:33:21 [iNFO] [Minecraft-Client] Setting user: Player992
2013-04-01 15:33:21 [iNFO] [sTDOUT] (Session ID is -)
2013-04-01 15:33:21 [iNFO] [sTDERR] Client asked for parameter: server
2013-04-01 15:33:21 [iNFO] [Minecraft-Client] LWJGL Version: 2.4.2
2013-04-01 15:33:22 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization
2013-04-01 15:33:22 [iNFO] [sTDOUT] MinecraftForge v7.7.1.611 Initialized
2013-04-01 15:33:22 [iNFO] [ForgeModLoader] MinecraftForge v7.7.1.611 Initialized
2013-04-01 15:33:22 [iNFO] [sTDOUT] Replaced 85 ore recipies
2013-04-01 15:33:22 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization
2013-04-01 15:33:22 [iNFO] [ForgeModLoader] Reading custom logging properties from A:\Minecraft Mods\forge\mcp\jars\config\logging.properties
2013-04-01 15:33:22 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
2013-04-01 15:33:22 [iNFO] [ForgeModLoader] Searching A:\Minecraft Mods\forge\mcp\jars\mods for mods
2013-04-01 15:33:24 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2013-04-01 15:33:24 [iNFO] [mcp] Activating mod mcp
2013-04-01 15:33:24 [iNFO] [FML] Activating mod FML
2013-04-01 15:33:24 [iNFO] [Forge] Activating mod Forge
2013-04-01 15:33:24 [iNFO] [Zanofite] Activating mod Zanofite
2013-04-01 15:33:24 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2013-04-01 15:33:24 [iNFO] [sTDOUT]
2013-04-01 15:33:24 [iNFO] [sTDOUT] Starting up SoundSystem...
2013-04-01 15:33:24 [iNFO] [sTDOUT] Initializing LWJGL OpenAL
2013-04-01 15:33:24 [iNFO] [sTDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
2013-04-01 15:33:24 [iNFO] [sTDOUT] OpenAL initialized.
2013-04-01 15:33:25 [iNFO] [sTDOUT]
2013-04-01 15:33:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
2013-04-01 15:33:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
2013-04-01 15:33:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
2013-04-01 15:33:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
2013-04-01 15:33:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
2013-04-01 15:33:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
2013-04-01 15:33:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
2013-04-01 15:33:26 [iNFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
2013-04-01 15:33:26 [iNFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
2013-04-01 15:33:26 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
2013-04-01 15:33:26 [sEVERE] [ForgeModLoader]
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Zanofite [Zanofite] (bin) Unloaded->Constructed->Pre-initialized->Errored
2013-04-01 15:33:26 [sEVERE] [ForgeModLoader] The following problems were captured during this phase
2013-04-01 15:33:26 [sEVERE] [ForgeModLoader] Caught exception from Zanofite
java.lang.ClassCastException: mods.zanofite.common.ItemZanosword cannot be cast to net.minecraft.item.ItemSword
at mods.zanofite.common.Zanofite.SwordWork(Zanofite.java:44)
at mods.zanofite.common.Zanofite.load(Zanofite.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:689)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:444)
at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
at net.minecraft.client.Minecraft.run(Minecraft.java:729)
at java.lang.Thread.run(Unknown Source)
2013-04-01 15:33:26 [iNFO] [sTDERR] java.lang.ClassCastException: mods.zanofite.common.ItemZanosword cannot be cast to net.minecraft.item.ItemSword
2013-04-01 15:33:26 [iNFO] [sTDERR] at mods.zanofite.common.Zanofite.SwordWork(Zanofite.java:44)
2013-04-01 15:33:26 [iNFO] [sTDERR] at mods.zanofite.common.Zanofite.load(Zanofite.java:30)
2013-04-01 15:33:26 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-04-01 15:33:26 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-04-01 15:33:26 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-04-01 15:33:26 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source)
2013-04-01 15:33:26 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515)
2013-04-01 15:33:26 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-04-01 15:33:26 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-04-01 15:33:26 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-04-01 15:33:26 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source)
2013-04-01 15:33:26 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
2013-04-01 15:33:26 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-04-01 15:33:26 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
2013-04-01 15:33:26 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
2013-04-01 15:33:26 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267)
2013-04-01 15:33:26 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
2013-04-01 15:33:26 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-04-01 15:33:26 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-04-01 15:33:26 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-04-01 15:33:26 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source)
2013-04-01 15:33:26 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
2013-04-01 15:33:26 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-04-01 15:33:26 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
2013-04-01 15:33:26 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
2013-04-01 15:33:26 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267)
2013-04-01 15:33:26 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
2013-04-01 15:33:26 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.initializeMods(Loader.java:689)
2013-04-01 15:33:26 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)
2013-04-01 15:33:26 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:444)
2013-04-01 15:33:26 [iNFO] [sTDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
2013-04-01 15:33:26 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:729)
2013-04-01 15:33:26 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source)
2013-04-01 15:33:55 [iNFO] [sTDERR] Someone is closing me!
-
wow talk about rookie error never mind I fixed it.
-
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.
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Failed to start game
A full error report has been saved to A:\Minecraft Mods\forge\mcp\jars\.\crash-reports\crash-2013-04-01_14.07.50-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash
--- BEGIN ERROR REPORT 64d33ccc --------
Full report at:
A:\Minecraft Mods\forge\mcp\jars\.\crash-reports\crash-2013-04-01_14.07.50-client.txt
Please show that file to Mojang, NOT just this screen!
Generated 1/04/13 2:07 PM
-- System Details --
Details:
Minecraft Version: 1.5.1
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_17, Oracle Corporation
Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 877742800 bytes (837 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v7.44 FML v5.1.8.611 Minecraft Forge 7.7.1.611 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Zanofite [Zanofite] (bin) Unloaded->Constructed->Pre-initialized->Errored
LWJGL: 2.4.2
OpenGL: Intel® HD Graphics Family GL version 3.1.0 - Build 8.15.10.2559, Intel
Is Modded: Definitely; Client brand changed to 'forge,fml'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
java.lang.IllegalArgumentException: Illegal object for naming null
at cpw.mods.fml.common.registry.LanguageRegistry.addNameForObject(LanguageRegistry.java:112)
at cpw.mods.fml.common.registry.LanguageRegistry.addName(LanguageRegistry.java:120)
at mods.zanofite.common.Zanofite.languageRegisters(Zanofite.java:41)
at mods.zanofite.common.Zanofite.load(Zanofite.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:689)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:444)
at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
at net.minecraft.client.Minecraft.run(Minecraft.java:729)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 6fe0170e ----------
I now have idea what is happening
-
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.
-
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.
-
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"); } }
Custom Sword Error.
in Modder Support
Posted
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....... :'(