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, 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.

  • Author

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.

>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 ::..

where you register the item texture remove "models/item", again minecraft defaults to that location so you don't need to specifiy it

Did you really need to know?

  • Author

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.

  • Author

Thank you so much! I have spent weeks looking everywhere for an answer like this... kudos to you!

Sup bruh.

Guest
This topic is now closed to further replies.

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.