- Item texture.
-
Item texture.
You probably do not own that domain. This is outdated and broken. You should be using ModelLoader.setCustomModelResourceLocation in preInit in your client proxy. You cannot have client-only code like this in classes that will be loaded on a server. Moreover please don't use the unlocalized name to generate the model location. A much simpler way: new ModelResourceLocation(item.getRegistryName(), "inventory") . Your unlocalized names should include your ModID to avoid conflicts with other mods. GameRegistry.registerItem is deprecated, update to the new version. As above, please don't use the unlocalized name to generate the registry name. If you want to only have an identifying string in one place, generate the unlocalized name from the registry name (setUnlocalizedName(getRegistryName().toString()) ), this will also solve the above problem, as the registry name will include your ModID by default. You do not need all this stuff, it is included in the "item/generated" model already, which you have set as the parent. I am using forge 1.8.8 not he latest 1.11. I tried that and I just get errors when I put it in.
-
Item texture.
That's your mcmod.info file, which while it contains JSON content is not an item json model. https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/resources/assets/oreflowers/models/item/goldwand.json Oops. I forgot to paste the JSON file. Fixed!
-
Item texture.
How do I set an item texture? I have a JSON file and PNG file. I remember the old way of doing it which was this.setTextureName but that doesn't work anymore for 1.8.8 and up. Here is my code package com.ren3dm.ExpandedFood; import com.ren3dm.ExpandedFood.Reference; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.registry.LanguageRegistry; public class Food{ public static Item Bagel; public static void registerRenders() { registerRender(Bagel); } public static void registerRender(Item item) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory")); } public static void Init() { Bagel = new ItemFood(3, 0.9f, false).setUnlocalizedName("Bagel").setCreativeTab(CreativeTabs.tabFood).setMaxStackSize(64); } public static void register() { GameRegistry.registerItem(Bagel, Bagel.getUnlocalizedName().substring(5)); } package com.ren3dm.ExpandedFood; import com.ren3dm.ExpandedFood.proxy.ServerP; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; 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.event.FMLServerStartingEvent; @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION) public class Main { @SidedProxy(clientSide = Reference.MOD_CLIENT_PROXY, serverSide = Reference.MOD_SERVER_PROXY) public static ServerP proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { Food.Init(); Food.register(); } @EventHandler public void Init(FMLInitializationEvent event) { proxy.registerRenders(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } @EventHandler public void serverLoad(FMLServerStartingEvent event) { } } My json is in: assets.expandedfood.models.item My PNG is in: assets.expandedfood.textures.items My JSON is named: Bagel.json My PNG is named: Bagel.png The text inside my JSON is: { "parent": "item/generated" "textures": { "layer0": "expandedfood:items/Bagel" }, "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] } } }
IPS spam blocked by CleanTalk.