Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi All its me again you all told me to start running all my stuff through my main.class so im doing that now however im having a few issues with the texturing I get the item to show however the texture is not showing I have attached all the files that I currently have.

 

Main.java

package COLCTut;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import COLCTut.items.testitem;

@Mod(modid = Main.MODID, version = Main.VERSION)
public class Main
{
    public static final String MODID = "COLCMod";
    public static final String VERSION = "1.0";
    
    
    public static Item testitem = new testitem();
    
    
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    	CraftingRecipies();
    	
    	
    	GameRegistry.registerItem(testitem, "testitem");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(testitem, 0, new ModelResourceLocation(MODID + ":" + testitem.getUnlocalizedName().substring(5),"inventory"));
    	
    }
    
    @EventHandler
    public void Postinit(FMLPostInitializationEvent event)
    {

    }
    
    @EventHandler
    public void Preinit(FMLPreInitializationEvent event)
    {

    }
    
//    ########### This Your Recipes CRAFTING And SMELTING ###########
    public void CraftingRecipies()
    
    {
//    	########### Recipe 1 - Shaped ###########
	GameRegistry.addRecipe(new ItemStack(Items.diamond,64),new Object[]{

		"ddd",
		"dsd",
		"ddd",
		Character.valueOf('d'),Blocks.dirt,
		Character.valueOf('s'),Items.apple			
	});
//		########### End Of Recipes - Shaped ###########

//    	########### Recipe 2 - UnShaped ###########

	GameRegistry.addShapelessRecipe(new ItemStack(Items.diamond,64 ),new ItemStack(Blocks.dirt));

//		########### End Of Recipes - UnShaped ###########   	

//    	########### Smelting Section ###########	

	GameRegistry.addSmelting(Blocks.dirt, new ItemStack(Items.iron_ingot), 200);

//		########### End of Smelting ###########  


    }
    
}

 

testitem.json

{
    "parent": "builtin/generated",
    "textures": {
        "layer0": "COLCMod:items/testitem"
    },
    "display": {
        "thirdperson": {
            "rotation": [ -90, 0, 0 ],
            "translation": [ 0, 1, -3 ],
            "scale": [ 0.55, 0.55, 0.55 ]
        },
        "firstperson": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }
}

 

testitem.java

package COLCTut.items;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class testitem extends Item {

public testitem() {

	this.setUnlocalizedName("testitem");
	this.setCreativeTab(CreativeTabs.tabMaterials);

}


}

 

Package Explorer

6nrySh7.png

I'm pretty sure the assets/modid has to be all lowercase, as well as every reference to it. If not then I'm not sure what the issue is, could you ellaborate on "not showing I have attached all the files that I currently have" I don't understand this "attaching files" statement. Also a bit of a nitpick, method names should be camelcase so instead of Postinit and Preinit, postInit and preInit

  • Author

I'm pretty sure the assets/modid has to be all lowercase, as well as every reference to it. If not then I'm not sure what the issue is, could you ellaborate on "not showing I have attached all the files that I currently have" I don't understand this "attaching files" statement. Also a bit of a nitpick, method names should be camelcase so instead of Postinit and Preinit, postInit and preInit

 

Sorry I meant I have displayed on the forum all files that are being used for the Item....

 

I don't think that the uppercase is the issue here ???

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.