Vswe's Summer Courses | You're not logged in. Sign up or log in | Server time: | Donate
One can now see other persons' badge hunts. Simply head over to their profiles to access them.

Go back to course page

Forging a Minecraft mod

Basic Minecraft modding with Minecraft Forge

my item don't appaer in the game

  • 2013-11-08 17:13:34
    this are my class:
    Itz(as Steve's Example)

    package example;

    import net.minecraft.item.ItemStack;
    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.network.NetworkMod;
    import cpw.mods.fml.common.registry.GameRegistry;
    import example.config.ConfigHandler;
    import example.items.Items;
    import example.network.PacketHandler;
    import example.proxies.CommonProxy;

    @Mod(modid = ModInformation.ID, name = ModInformation.NAME, version = ModInformation.VERSION)
    @NetworkMod(channels = {ModInformation.CHANNEL}, clientSideRequired = true, serverSideRequired = true, packetHandler = PacketHandler.class)
    public class Itz {

        
        @Instance(ModInformation.ID)
        public static Itz instance;
        
        @SidedProxy(clientSide = "example.proxies.ClientProxy", serverSide = "example.proxies.CommonProxy")
        public static CommonProxy proxy;
        
        
        @EventHandler
        public void preInit(FMLPreInitializationEvent event) {
            ConfigHandler.init(event.getSuggestedConfigurationFile());
            Items.init();
            
            proxy.initSounds();
            proxy.initRenderers();
        }
        
        @EventHandler
        public void load(FMLInitializationEvent event) {
            Items.addNames();
        
            }
        
        
        
        @EventHandler
        public void modsLoaded(FMLPostInitializationEvent event) {
            
        }
        
    }
  • 2013-11-08 23:46:55
    if the item is not showing in the creative tab, make sure you have setCreativeTab(CreativeTabs.something) in the class of your item

    if you have other problems, show us the code of the item that is not showing up and the Items class.
  • 2013-11-09 03:35:45
    ItemWand

    package example.items;

    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;


    public class ItemWand extends Item {

    public ItemWand(int id) {
            super(5001);
            setCreativeTab(CreativeTabs.tabCombat);
            setMaxStackSize(1);
            setUnlocalizedName(ItemInfo.WAND_UNLOCALIZED_NAME);
        }

    public boolean func_111207_a(ItemStack itemstack, EntityPlayer player, EntityLivingBase target) {
            if(!target.worldObj.isRemote) {
                target.motionY = 2;    
            }
        
         return false;
        }

    @Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister register) {
        itemIcon = register.registerIcon(ItemInfo.TEXTURE_LOCATION + ":" + ItemInfo.WAND_ICON);
        
        
    }


    }
  • 2013-11-09 06:07:01
    Are you initializing it in the Items.init() function
  • 2013-11-09 18:15:52
    that's a question? I don't understood you
  • 2013-11-09 18:17:25
    this is the Items.class

    package example.items;

    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.common.registry.LanguageRegistry;
    import net.minecraft.block.*;

    public class Items {

        public static Item EspadaDeObsidiana;
        
        public static void init() {
         EspadaDeObsidiana = new Item(ItemInfo.WAND_ID);
        }
        
        
        public static void addNames() {
            LanguageRegistry.addName(EspadaDeObsidiana, ItemInfo.WAND_NAME);
        }
        
        
        public static void registerRecipes() {
            GameRegistry.addRecipe(new ItemStack (EspadaDeObsidiana, 1),
                new Object[] {     " X ",
                 " X ",
                 " / ",
                
                
                 'X', "Block.BlockObsidian",
                 '/', "Item.stick",
                
             });
  • 2013-11-09 21:35:34
    Do you have any errors? Because I can't see anything wrong with this. Does it tell you that your mod has loaded, in the console when you start Minecraft?
  • 2013-11-09 22:04:11
    You should create a new instance of your item.

    EspadaDeObsidiana = new Item(ItemInfo.WAND_ID);

    should be:

    EspadaDeObsidiana = new ItemWand(ItemInfo.WAND_ID);
  • 2013-11-09 23:26:24
    how must be the file? where I place the instance?
  • 2013-11-09 23:34:13
    I saw the console, and says: [Itz] Mod Itz is missing a pack.mcmeta file, things may not work well
  • 2013-11-09 23:54:27
    I don't know what I do, the item now are in the tab finally, but, the crafting; help! I need somebody, help! no just anybody, help! you know I need someone, help! please Vswe, how I give a recipe to my item? that will be a sword, how I give it the propeties of a sword? the recipe include Obsidian, how I make its recipe?
  • 2013-11-10 03:23:26
    change your registerRecipes() to this:

    public static void registerRecipes() {
    GameRegistry.addRecipe(new ItemStack (EspadaDeObsidiana, 1),
    new Object[] { " X ",
    " X ",
    " / ",


    'X', Block.obsidian,
    '/', Item.stick,

    });

    you are not supposed to have quotation marks when passing a block as an argument. and its Block.obsidian not Block.BlockObsidian
  • 2013-11-10 03:28:11
    To make an item a sword, it is a little more advance but you basically extend ItemSword instead of Item and then override a few methods or change some variables.
  • 2013-11-10 03:30:55
    You might want to check out some other tutorials that teach you how to make swords since this course doesn't teach you that.
  • 2013-11-10 03:32:44
    all right, Noob, thank you so much
  • Log in or sign up to reply to this thread