Jump to content

[Solved][1.10.2] Loading exception for .json file


Skye4Life

Recommended Posts

So I'm following the 1.10.2 tutorial by Shadowfacts and I get to the JSON item model section and for the life of me I can't get the texture to load correctly with this exception popping up

 

 

[14:00:25] [Client thread/ERROR] [FML]: Exception loading model for variant bs_mod:Stone Hammer#inventory for item "bs_mod:Stone Hammer", blockstate location exception:

net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model bs_mod:Stone Hammer#inventory with loader VariantLoader.INSTANCE, skipping

at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]

at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:325) ~[ModelLoader.class:?]

at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]

at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) ~[ModelLoader.class:?]

at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [simpleReloadableResourceManager.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:540) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException

at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]

at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1183) ~[ModelLoader$VariantLoader.class:?]

at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]

... 20 more

 

 

Here's the code to my ModItems.java

 

 

package com.Skye4Life.Blacksmithery.items;

 

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraftforge.fml.common.registry.GameRegistry;

 

public class ModItems

{

 

public static ItemBase stone_hammer;

 

public static void init()

{

stone_hammer = register(new ItemBase("Stone Hammer").setCreativeTab(CreativeTabs.TOOLS));

}

 

private static <T extends Item> T register(T item)

{

GameRegistry.register(item);

 

if (item instanceof ItemBase)

{

((ItemBase)item).registerItemModel();

}

return item;

}

}

 

 

 

The Code to my ItemBase.java

 

 

package com.Skye4Life.Blacksmithery.items;

 

import net.minecraft.item.Item;

import net.minecraft.creativetab.CreativeTabs;

import com.Skye4Life.Blacksmithery.Main;

 

public class ItemBase extends Item

{

protected String name;

 

public ItemBase(String name)

{

this.name = name;

setUnlocalizedName(name);

setRegistryName(name);

}

public void registerItemModel()

{

Main.proxy.registerItemRenderer(this, 0, name);

}

 

@Override

public ItemBase setCreativeTab(CreativeTabs tab)

{

super.setCreativeTab(tab);

return this;

}

 

 

}

 

 

 

and the stone_hammer.json

 

 

{

    "parent": "item/generated",

    "textures":

    {

        "layer0":"bs_mod:items/stone_hammer"

    }

}

 

 

And before you say that I named files wrong I double checked that even my .png for the texture is stone_hammer.png

 

And just for the hell of it if anyone needs it this is my Main.java class file

 

 

package com.Skye4Life.Blacksmithery;

 

import com.Skye4Life.Blacksmithery.items.ModItems;

import com.Skye4Life.Blacksmithery.proxy.CommonProxy;

 

import net.minecraftforge.fml.common.Mod;

import net.minecraftforge.fml.common.Mod.EventHandler;

import net.minecraftforge.fml.common.Mod.Instance;

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;

 

@Mod(modid = Main.modId, name = Main.name, version = Main.version, acceptedMinecraftVersions = "[1.10.2]")

 

public class Main

{

public static final String modId = "bs_mod";

public static final String name = "Blacksmithery";

public static final String version = "1.0";

 

@Mod.Instance(modId)

public static Main instance;

 

@SidedProxy

(serverSide = "com.Skye4Life.Blacksmithery.proxy.CommonProxy", clientSide = "com.Skye4Life.Blacksmithery.proxy.ClientProxy")

public static CommonProxy proxy;

 

@Mod.EventHandler

public void preInit(FMLPreInitializationEvent event)

{

System.out.println(name + " is loading!");

ModItems.init();

}

@Mod.EventHandler

public void init(FMLInitializationEvent event)

{

 

}

@Mod.EventHandler

public void postInit(FMLPostInitializationEvent event)

{

 

}

 

}

 

 

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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