Jump to content

Can't get Item model to work


Asweez

Recommended Posts

The item is staying as a purple and black box. How do I fix it?

 

Main:

 

package com.example.examplemod;

import net.minecraft.creativetab.CreativeTabs;
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.registry.GameRegistry;

@Mod(modid = Test.MODID, version = Test.VERSION)
public class Test
{
public static ItemBase test;

    public static final String MODID = "modid";
    public static final String VERSION = "1.0";
    
    @SidedProxy(clientSide = "com.example.examplemod.ClientProxy", serverSide = "com.example.examplemod.CommonProxy")
    public static CommonProxy proxy;
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    	
	test = (ItemBase) new ItemBase("test").setCreativeTab(CreativeTabs.tabCombat);
	GameRegistry.registerItem(test, "test");

	proxy.init();
    }
}

 

 

Item:

 

package com.example.examplemod;

import net.minecraft.item.Item;

public class ItemBase extends Item{

private String name;

public ItemBase(String name){
	super();
	this.name = name;
	this.setUnlocalizedName(name);
}

public String getName(){
	return name;
}
}

 

 

ClientProxy:

 

package com.example.examplemod;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;

public class ClientProxy extends CommonProxy{
public void init(){
	ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation("modid:test", "inventory");
    final int DEFAULT_ITEM_SUBTYPE = 0;
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Test.test, DEFAULT_ITEM_SUBTYPE, itemModelResourceLocation);
}
}

 

 

JSON file: test.json

 

{
    "parent": "builtin/generated",
    "textures": {
        "layer0": “modid:items/test”
    },
    "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 ]
        }
    }
}

 

 

Path:

 

src/main/resources/assets/modid/models/item/test.json

 

src/main/resources/assets/modid/textures/items/test.png

 

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Link to comment
Share on other sites

log:

 

[16:01:45] [main/INFO] [GradleStart]: Extra: []

[16:01:45] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --accessToken, {REDACTED}, --assetIndex, 1.8, --assetsDir, /Users/Kids/.gradle/caches/minecraft/assets, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]

[16:01:45] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[16:01:45] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[16:01:45] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker

[16:01:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

[16:01:45] [main/INFO] [FML]: Forge Mod Loader version 8.99.124.1450 for Minecraft 1.8 loading

[16:01:45] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.7.0_71, running on Mac OS X:x86_64:10.10.3, installed at /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre

[16:01:45] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[16:01:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker

[16:01:45] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

[16:01:45] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[16:01:45] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:01:45] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[16:01:45] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[16:01:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:01:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:01:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[16:01:45] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[16:01:46] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[16:01:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[16:01:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[16:01:47] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[16:01:47] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

[16:01:47] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

[16:01:47] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[16:01:47] [Client thread/INFO]: Setting user: Player669

[16:01:49] [Client thread/INFO]: LWJGL Version: 2.9.2

[16:01:49] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:235]: ---- Minecraft Crash Report ----

// Daisy, daisy...

 

Time: 7/14/15 4:01 PM

Description: Loading screen debug info

 

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.8

Operating System: Mac OS X (x86_64) version 10.10.3

Java Version: 1.7.0_71, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 750031840 bytes (715 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML:

Loaded coremods (and transformers):

GL info: ' Vendor: 'ATI Technologies Inc.' Version: '2.1 ATI-1.32.20' Renderer: 'ATI Radeon HD 5770 OpenGL Engine'

[16:01:49] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

[16:01:49] [Client thread/INFO] [FML]: MinecraftForge v11.14.3.1450 Initialized

[16:01:50] [Client thread/INFO] [FML]: Replaced 204 ore recipies

[16:01:50] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

[16:01:50] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer

[16:01:50] [Client thread/INFO] [FML]: Searching /Users/Kids/Desktop/MiniMods/MyFit 1.8/eclipse/mods for mods

[16:01:50] [Client thread/INFO] [modid]: Mod modid is missing the required element 'name'. Substituting modid

[16:01:51] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

[16:01:51] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, modid] at CLIENT

[16:01:51] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, modid] at SERVER

[16:01:51] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:modid

[16:01:51] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[16:01:51] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations

[16:01:51] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations

[16:01:51] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations

[16:01:51] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[16:01:51] [Client thread/INFO] [FML]: Applying holder lookups

[16:01:51] [Client thread/INFO] [FML]: Holder lookups applied

[16:01:51] [Client thread/INFO] [FML]: Injecting itemstacks

[16:01:51] [Client thread/INFO] [FML]: Itemstack injection complete

[16:01:52] [sound Library Loader/INFO]: Starting up SoundSystem...

[16:01:52] [Thread-8/INFO]: Initializing LWJGL OpenAL

[16:01:52] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[16:01:52] [Thread-8/INFO]: OpenAL initialized.

[16:01:52] [sound Library Loader/INFO]: Sound engine started

[16:01:54] [Client thread/INFO]: Created: 512x512 textures-atlas

[16:01:54] [Client thread/INFO] [FML]: Injecting itemstacks

[16:01:54] [Client thread/INFO] [FML]: Itemstack injection complete

[16:01:54] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods

[16:01:54] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:modid

[16:01:54] [Client thread/INFO]: SoundSystem shutting down...

[16:01:54] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

[16:01:54] [sound Library Loader/INFO]: Starting up SoundSystem...

[16:01:55] [Thread-10/INFO]: Initializing LWJGL OpenAL

[16:01:55] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[16:01:55] [Thread-10/INFO]: OpenAL initialized.

[16:01:55] [sound Library Loader/INFO]: Sound engine started

[16:01:55] [Client thread/ERROR] [FML]: Exception loading model modid:item/test with loader instance, skipping

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 4 column 26

at com.google.gson.internal.Streams.parse(Streams.java:56) ~[streams.class:?]

at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54) ~[TreeTypeAdapter.class:?]

at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]

at com.google.gson.Gson.fromJson(Gson.java:741) ~[Gson.class:?]

at net.minecraft.client.renderer.block.model.ModelBlock.deserialize(ModelBlock.java:47) ~[ModelBlock.class:?]

at net.minecraft.client.resources.model.ModelBakery.loadModel(ModelBakery.java:269) ~[ModelBakery.class:?]

at net.minecraftforge.client.model.ModelLoader.access$900(ModelLoader.java:71) ~[ModelLoader.class:?]

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

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

at net.minecraftforge.client.model.ModelLoader.loadAnyModel(ModelLoader.java:201) [ModelLoader.class:?]

at net.minecraftforge.client.model.ModelLoader.getModel(ModelLoader.java:184) [ModelLoader.class:?]

at net.minecraftforge.client.model.ModelLoader.loadItems(ModelLoader.java:171) [ModelLoader.class:?]

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

at net.minecraft.client.resources.model.ModelManager.onResourceManagerReload(ModelManager.java:29) [ModelManager.class:?]

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

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

at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:775) [Minecraft.class:?]

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:331) [FMLClientHandler.class:?]

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

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

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

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_71]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_71]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_71]

at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_71]

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

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

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

at GradleStart.main(Unknown Source) [start/:?]

Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 4 column 26

at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1505) ~[JsonReader.class:?]

at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:480) ~[JsonReader.class:?]

at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:403) ~[JsonReader.class:?]

at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:666) ~[TypeAdapters$25.class:?]

at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:667) ~[TypeAdapters$25.class:?]

at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:642) ~[TypeAdapters$25.class:?]

at com.google.gson.internal.Streams.parse(Streams.java:44) ~[streams.class:?]

... 28 more

[16:01:56] [Client thread/INFO]: Created: 512x512 textures-atlas

[16:01:56] [Client thread/ERROR] [FML]: Model definition for location modid:test#inventory not found

 

 

 

edited the original json (at the beginning of the post) to match my current one

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Link to comment
Share on other sites

I don't know exactly how, but it seems your quotation marks around your texture path are... different. I'm not sure why, but if you change it it should fix it. Use this:

{
    "parent":"builtin/generated",
    "textures": {
        "layer0":"modid:items/test"
    },
    "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 ]
        }
    }
}

I'll put something here when I have something of value I need to put at the end of every post. For now it's this mostly pointless text.

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.