Jump to content

Don't understand why my code does not work


Recommended Posts

I did a piece of code yesterday that worked fine , but I open up Eclipse again and it does not seem to work , so could someone hep me with this ?


Here are my codes :


Main Mod Class : InfinityBow.java



package traxys.infbow;


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;

import net.minecraft.item.ItemStack;

import net.minecraftforge.common.MinecraftForge;

import traxys.infbow.lib.GenBlock;

import traxys.infbow.lib.GenItem;

import traxys.infbow.lib.Reference;

import traxys.infbow.proxy.CommonProxy;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.Mod.Instance;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.event.FMLPostInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;


@Mod(modid= Reference.MOD_ID, name= Reference.MOD_NAME, version = Reference.VERSION)

public class InfinityBow {


public final static Item fletching = new GenItem(10048);


ItemStack obsidianStack = new ItemStack(Block.obsidian);

ItemStack ironStack = new ItemStack(Item.ingotIron);

ItemStack diamondStack = new ItemStack(Item.diamond);



public static InfinityBow instance;


@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)

public static CommonProxy proxy;



public void preInit(FMLPreInitializationEvent event){





public void init(FMLInitializationEvent event){

LanguageRegistry.addName(hardWall, "Hard Wall"); //Here are the crash , He can't link the hardWall here from the one in HardWall.java

MinecraftForge.setBlockHarvestLevel(hardWall, "pickaxe", 2);

GameRegistry.registerBlock(hardWall, "Hard Wall");

GameRegistry.addRecipe(new ItemStack(InfinityBow.hardWall, 32), "xxx","yyy","xzx",

'x', obsidianStack,'y',ironStack,'z',diamondStack);



public void postInit(FMLPostInitializationEvent event){










package traxys.infbow.block;


import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import traxys.infbow.lib.GenBlock;


public class HardWall{

public final static Block hardWall = new GenBlock(1048, Material.rock) 








GenBlock.java(just a class to be called for making all blocks I want)



package traxys.infbow.lib;


import net.minecraft.block.Block;

import net.minecraft.block.material.Material;


public class GenBlock extends Block {


public GenBlock(int par1, Material par2Material) {

super(par1, par2Material);






Please can someone can help me :)

I am just starting at moding , so I don't know much ....

Link to comment
Share on other sites

This topic is now closed to further replies.


  • Create New...

Important Information

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