Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

1.8 Rendering Items? [SOLVED]


TheDogePwner
 Share

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I've been trying to get a server running on my Raspberry Pi, but run.sh won't function properly! I've used chmod, but it fails every time I try to run it. Here's the output: pi@raspberrypi:~/🅱️orge $ sudo chmod +x run.sh pi@raspberrypi:~/🅱️orge $ ./run.sh Exception in thread "main" java.lang.ExceptionInInitializerError at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.SecureJar.from(SecureJar.java:58) at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.SecureJar.from(SecureJar.java:50) at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.SecureJar.from(SecureJar.java:42) at cpw.mods.bootstraplauncher@1.0.0/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:93) Caused by: java.lang.IllegalArgumentException: Error decoding percent encoded characters at java.base/sun.net.www.ParseUtil.decode(ParseUtil.java:218) at java.base/jdk.internal.loader.URLClassPath$FileLoader.<init>(URLClassPath.java:1219) at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:488) at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:482) at java.base/java.security.AccessController.doPrivileged(AccessController.java:712) at java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:481) at java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:449) at java.base/jdk.internal.loader.URLClassPath$1.next(URLClassPath.java:345) at java.base/jdk.internal.loader.URLClassPath$1.hasMoreElements(URLClassPath.java:356) at java.base/jdk.internal.loader.BuiltinClassLoader$1.hasNext(BuiltinClassLoader.java:408) at java.base/jdk.internal.loader.BuiltinClassLoader$1.hasMoreElements(BuiltinClassLoader.java:416) at java.base/java.lang.CompoundEnumeration.next(ClassLoader.java:2725) at java.base/java.lang.CompoundEnumeration.hasMoreElements(ClassLoader.java:2734) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1210) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) at java.base/java.nio.file.spi.FileSystemProvider.loadInstalledProviders(FileSystemProvider.java:156) at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:207) at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:204) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) at java.base/java.nio.file.spi.FileSystemProvider.installedProviders(FileSystemProvider.java:204) at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.impl.Jar.<clinit>(Jar.java:29) ... 4 more (Yes, the 🅱️s are intentional)
    • when i press install on any version it says "adfoc.us redirected you too many times" and i cant install any version. please help.
    • I've got flywheel installed but it still gives me the exit on error
    • https://www.dropbox.com/s/zrit7mgov31left/2022-08-14-7.log?dl=0
  • Topics

×
×
  • Create New...

Important Information

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