Jump to content

1.8 Rendering Items? [SOLVED]


TheDogePwner

Recommended Posts

Hi, I was wondering how to render items in 1.8.

 

I have:

 

Item item = new SteelIngot();
RenderItem renderer = Minecraft.getMinecraft().getRenderItem();
renderer.getItemModelMesher().register(
			item,
			0,
			new ModelResourceLocation("UltraCraft:models/item/"
					+ item.getUnlocalizedName(),
					"inventory"));

 

Here is my SteelIngot class:

package uc.items;

import net.minecraft.item.Item;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import uc.mainmod.UltraCraft;

public class SteelIngot extends Item {
public SteelIngot() {
	setMaxStackSize(64);
	setCreativeTab(UltraCraft.mechanicalItemsTab);
	setUnlocalizedName("SteelIngot");
}
}

 

Yet somehow my CreativeTab that has SteelIngot for its logo has a default missing texture.

Sup bruh.

Link to comment
Share on other sites

Oh, and here is my JSON file:

{
"parent": "builtin/generated",
"textures": {
"layer0": "UltraCraft:textures/items/SteelIngot"
},
"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 ]
}
}
}

Sup bruh.

Link to comment
Share on other sites

>Put the render calls in the "init" block...

 

>Verify the location of your textures...

 

 

Show the folder structure(image) and complete class plz. ^^'

// BSc CIS, hardcore gamer and a big fan of Minecraft.

 

TmzOS ::..

Link to comment
Share on other sites

Here is my main class:

package uc.mainmod;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
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.registry.GameRegistry;
import uc.items.SteelIngot;
import uc.tabs.MechanicalItemsTab;

@Mod(modid = UltraCraft.MODID, version = UltraCraft.VERSION)
public class UltraCraft {
public static final String MODID = "examplemod";
public static final String VERSION = "1.0";

public static Item steelIngot;

public static CreativeTabs mechanicalItemsTab;

@EventHandler
public void init(FMLInitializationEvent event) {
	RenderItem renderer = getRenderer();

	steelIngot = new SteelIngot();

	mechanicalItemsTab = new MechanicalItemsTab("Mechanical Items");

	GameRegistry.registerItem(UltraCraft.steelIngot, "SteelIngot", "UltraCraft");
	renderItem(renderer, steelIngot);
}
public void renderItem(RenderItem renderer, Item item) {

	renderer.getItemModelMesher().register(
			item,
			0,
			new ModelResourceLocation("UltraCraft:"
					+ item.getUnlocalizedName(),
					"inventory"));
}
public RenderItem getRenderer() {

	return Minecraft.getMinecraft().getRenderItem();
}
}

 

Here is a image of my folder structure:

https://www.dropbox.com/s/ckiuxo2ovat0uo9/ForgeStructure.PNG?dl=0

Sup bruh.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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