Jump to content

[1.12.2] Item JSON model fails to load


SapphireSky

Recommended Posts

I'm trying to make an item that transforms, changing its model, when it's used.

But the model for some reason just won't load and of course the error couldn't be more vague so I can't figure it out myself.

Any help would be appreciated....

 

Error:

Spoiler

[15:00:01] [main/ERROR] [FML]: Could not load vanilla model parent 'lootboxes:item/lightsaber' for 'net.minecraft.client.renderer.block.model.ModelBlock@52a1a375
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model lootboxes:item/lightsaber with loader VanillaLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModelOrLogError(ModelLoaderRegistry.java:211) [ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader$VanillaModelWrapper.getTextures(ModelLoader.java:386) [ModelLoader$VanillaModelWrapper.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:171) [ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:302) [ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) [ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:151) [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:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
	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_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: com.google.gson.JsonSyntaxException: Missing model, expected to find a string
	at net.minecraft.util.JsonUtils.getString(JsonUtils.java:111) ~[JsonUtils.class:?]
	at net.minecraft.client.renderer.block.model.ItemOverride$Deserializer.deserialize(ItemOverride.java:66) ~[ItemOverride$Deserializer.class:?]
	at net.minecraft.client.renderer.block.model.ItemOverride$Deserializer.deserialize(ItemOverride.java:60) ~[ItemOverride$Deserializer.class:?]
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[TreeTypeAdapter.class:?]
	at com.google.gson.Gson.fromJson(Gson.java:887) ~[Gson.class:?]
	at com.google.gson.Gson.fromJson(Gson.java:952) ~[Gson.class:?]
	at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162) ~[TreeTypeAdapter$GsonContextImpl.class:?]
	at net.minecraft.client.renderer.block.model.ModelBlock$Deserializer.getItemOverrides(ModelBlock.java:273) ~[ModelBlock$Deserializer.class:?]
	at net.minecraft.client.renderer.block.model.ModelBlock$Deserializer.deserialize(ModelBlock.java:260) ~[ModelBlock$Deserializer.class:?]
	at net.minecraft.client.renderer.block.model.ModelBlock$Deserializer.deserialize(ModelBlock.java:242) ~[ModelBlock$Deserializer.class:?]
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[TreeTypeAdapter.class:?]
	at net.minecraft.util.JsonUtils.gsonDeserialize(JsonUtils.java:435) ~[JsonUtils.class:?]
	at net.minecraft.client.renderer.block.model.ModelBlock.deserialize(ModelBlock.java:51) ~[ModelBlock.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:338) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.access$1400(ModelLoader.java:115) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:861) ~[ModelLoader$VanillaLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
	... 23 more
[15:00:05] [main/INFO] [FML]: Max texture size: 8192
[15:00:05] [main/INFO] [minecraft/TextureMap]: Created: 1024x1024 textures-atlas
[15:00:07] [main/ERROR] [FML]: Exception loading model for variant lootboxes:lightsabergreen#inventory for item "lootboxes:lightsabergreen", normal location exception: 
java.lang.IllegalStateException: vanilla model 'net.minecraft.client.renderer.block.model.ModelBlock@52a1a375' can't have non-vanilla parent
	at net.minecraftforge.client.model.ModelLoader$VanillaModelWrapper.getTextures(ModelLoader.java:393) ~[ModelLoader$VanillaModelWrapper.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:171) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:302) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:151) ~[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:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
	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_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
[15:00:07] [main/ERROR] [FML]: Exception loading model for variant lootboxes:lightsabergreen#inventory for item "lootboxes:lightsabergreen", blockstate location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model lootboxes:lightsabergreen#inventory with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:296) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:151) ~[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:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
	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_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1175) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
	... 20 more

 

 

Base model:

Spoiler

lightsaber.json


{
	"textures": {
		"0": "lootboxes:items/lightsaber",
		"particle": "lootboxes:items/lightsaber"
	},
	"elements": [
		{
			"name": "bottom",
			"from": [6, -16, 6],
			"to": [10, -15, 10],
			"faces": {
				"north": {"uv": [1, 14.25, 2, 14.5], "texture": "#0"},
				"east": {"uv": [0, 14.25, 1, 14.5], "texture": "#0"},
				"south": {"uv": [3, 14.25, 4, 14.5], "texture": "#0"},
				"west": {"uv": [2, 14.25, 3, 14.5], "texture": "#0"},
				"up": {"uv": [2, 14.25, 1, 13.25], "texture": "#0"},
				"down": {"uv": [3, 13.25, 2, 14.25], "texture": "#0"}
			}
		},
		{
			"name": "base_edge",
			"from": [5, -15, 5],
			"to": [11, -12, 11],
			"faces": {
				"north": {"uv": [1.5, 9, 3, 9.75], "texture": "#0"},
				"east": {"uv": [0, 9, 1.5, 9.75], "texture": "#0"},
				"south": {"uv": [4.5, 9, 6, 9.75], "texture": "#0"},
				"west": {"uv": [3, 9, 4.5, 9.75], "texture": "#0"},
				"up": {"uv": [3, 9, 1.5, 7.5], "texture": "#0"},
				"down": {"uv": [4.5, 7.5, 3, 9], "texture": "#0"}
			}
		},
		{
			"name": "main_handle",
			"from": [6, -12, 6],
			"to": [10, -2, 10],
			"faces": {
				"north": {"uv": [1, 10.75, 2, 13.25], "texture": "#0"},
				"east": {"uv": [0, 10.75, 1, 13.25], "texture": "#0"},
				"south": {"uv": [3, 10.75, 4, 13.25], "texture": "#0"},
				"west": {"uv": [2, 10.75, 3, 13.25], "texture": "#0"},
				"up": {"uv": [2, 10.75, 1, 9.75], "texture": "#0"},
				"down": {"uv": [3, 9.75, 2, 10.75], "texture": "#0"}
			}
		},
		{
			"name": "main_handle_break",
			"from": [6.5, -2, 6.5],
			"to": [9.5, -1, 9.5],
			"faces": {
				"north": {"uv": [4.75, 14, 5.5, 14.25], "texture": "#0"},
				"east": {"uv": [4, 14, 4.75, 14.25], "texture": "#0"},
				"south": {"uv": [6.25, 14, 7, 14.25], "texture": "#0"},
				"west": {"uv": [5.5, 14, 6.25, 14.25], "texture": "#0"},
				"up": {"uv": [5.5, 14, 4.75, 13.25], "texture": "#0"},
				"down": {"uv": [6.25, 13.25, 5.5, 14], "texture": "#0"}
			}
		},
		{
			"name": "main_handle_top",
			"from": [6, -1, 6],
			"to": [10, 4, 10],
			"faces": {
				"north": {"uv": [5, 10.75, 6, 12], "texture": "#0"},
				"east": {"uv": [4, 10.75, 5, 12], "texture": "#0"},
				"south": {"uv": [7, 10.75, 8, 12], "texture": "#0"},
				"west": {"uv": [6, 10.75, 7, 12], "texture": "#0"},
				"up": {"uv": [6, 10.75, 5, 9.75], "texture": "#0"},
				"down": {"uv": [7, 9.75, 6, 10.75], "texture": "#0"}
			}
		},
		{
			"name": "main_edge_top",
			"from": [5, 2, 5],
			"to": [11, 3, 11],
			"faces": {
				"north": {"uv": [7.5, 9, 9, 9.25], "texture": "#0"},
				"east": {"uv": [6, 9, 7.5, 9.25], "texture": "#0"},
				"south": {"uv": [10.5, 9, 12, 9.25], "texture": "#0"},
				"west": {"uv": [9, 9, 10.5, 9.25], "texture": "#0"},
				"up": {"uv": [9, 9, 7.5, 7.5], "texture": "#0"},
				"down": {"uv": [10.5, 7.5, 9, 9], "texture": "#0"}
			}
		},
		{
			"name": "button_1",
			"from": [7.5, -5, 5.8],
			"to": [8.5, -4, 6.8],
			"faces": {
				"north": {"uv": [7.25, 14, 7.5, 14.25], "texture": "#0"},
				"east": {"uv": [7, 14, 7.25, 14.25], "texture": "#0"},
				"south": {"uv": [7.75, 14, 8, 14.25], "texture": "#0"},
				"west": {"uv": [7.5, 14, 7.75, 14.25], "texture": "#0"},
				"up": {"uv": [7.5, 14, 7.25, 13.75], "texture": "#0"},
				"down": {"uv": [7.75, 13.75, 7.5, 14], "texture": "#0"}
			}
		},
		{
			"name": "button_2",
			"from": [7.5, -7, 5.8],
			"to": [8.5, -6, 6.8],
			"faces": {
				"north": {"uv": [7.25, 13.5, 7.5, 13.75], "texture": "#0"},
				"east": {"uv": [7, 13.5, 7.25, 13.75], "texture": "#0"},
				"south": {"uv": [7.75, 13.5, 8, 13.75], "texture": "#0"},
				"west": {"uv": [7.5, 13.5, 7.75, 13.75], "texture": "#0"},
				"up": {"uv": [7.5, 13.5, 7.25, 13.25], "texture": "#0"},
				"down": {"uv": [7.75, 13.25, 7.5, 13.5], "texture": "#0"}
			}
		},
		{
			"name": "saber_outter",
			"from": [7, 4, 7],
			"to": [9, 32, 9],
			"faces": {
				"north": {"uv": [0.5, 0.5, 1, 7.5], "texture": "#0"},
				"east": {"uv": [0, 0.5, 0.5, 7.5], "texture": "#0"},
				"south": {"uv": [1.5, 0.5, 2, 7.5], "texture": "#0"},
				"west": {"uv": [1, 0.5, 1.5, 7.5], "texture": "#0"},
				"up": {"uv": [1, 0.5, 0.5, 0], "texture": "#0"},
				"down": {"uv": [1.5, 0, 1, 0.5], "texture": "#0"}
			}
		},
		{
			"name": "saber_inner",
			"from": [7.5, 3.05882, 7.5],
			"to": [8.5, 31.05882, 8.5],
			"faces": {
				"north": {"uv": [2.25, 0.25, 2.5, 7.25], "texture": "#0"},
				"east": {"uv": [2, 0.25, 2.25, 7.25], "texture": "#0"},
				"south": {"uv": [2.75, 0.25, 3, 7.25], "texture": "#0"},
				"west": {"uv": [2.5, 0.25, 2.75, 7.25], "texture": "#0"},
				"up": {"uv": [2.5, 0.25, 2.25, 0], "texture": "#0"},
				"down": {"uv": [2.75, 0, 2.5, 0.25], "texture": "#0"}
			}
		}
	],
	"display": {
		"thirdperson_righthand": {
			"translation": [0, 5.5, 2],
			"scale": [0.5, 0.5, 0.5]
		},
		"thirdperson_lefthand": {
			"translation": [0, 5.5, 2],
			"scale": [0.5, 0.5, 0.5]
		},
		"firstperson_righthand": {
			"rotation": [-5, 90, 0],
			"translation": [2, 6.5, 0],
			"scale": [0.5, 0.5, 0.5]
		},
		"firstperson_lefthand": {
			"rotation": [-5, 90, 0],
			"translation": [2, 6.5, 0],
			"scale": [0.5, 0.5, 0.5]
		},
		"ground": {
			"translation": [0, 7, 0],
			"scale": [0.5, 0.5, 0.5]
		},
		"gui": {
			"rotation": [0, -180, 45],
			"scale": [0.4, 0.4, 0.4]
		},
		"fixed": {
			"rotation": [0, 0, 45],
			"scale": [0.5, 0.5, 0.5]
		}
	}
}

 

 

Untransformed model:

Spoiler

lightsabergreen.json


{
    "parent": "lootboxes:item/lightsaber",
    "overrides": [
        {
            "predicate": {
                "transformed": 1
            },
            "model": "lootboxes:item/lightsaberextendedgreen"
        }
    ]
}

 

 

Transformed model:

Spoiler

lightsaberextendedgreen.json


{
    "parent": "lootboxes:item/lightsabergreen",
	"textures": {
		"0": "lootboxes:items/lightsaber_extended_green",
		"particle": "lootboxes:items/lightsaber_extended_green"
	}
}

 

 

Link to comment
Share on other sites

6 hours ago, SapphireSky said:

Caused by: com.google.gson.JsonSyntaxException: Missing model, expected to find a string

 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.