Everything posted by HDCREEPS
-
Creating an item with eclipse: Not working
I am sorry, I think I messed up the code while moving it to the post. Excluding the error with the semicolons and such, I seem to have an error that tells me that I have an invalid enum. The full error code: [Client thread/ERROR] [FML]: Exception loading model for variant hdm1:ItemFlash#inventory for item "hdm1:ItemFlash", normal location exception: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model hdm1:item/ItemFlash with loader VanillaLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:317) ~[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: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 2 column 2 at com.google.gson.internal.Streams.parse(Streams.java:56) ~[streams.class:?] at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54) ~[TreeTypeAdapter.class:?] at net.minecraft.util.JsonUtils.gsonDeserialize(JsonUtils.java:453) ~[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:315) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:868) ~[ModelLoader$VanillaLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?] ... 20 more Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 2 column 2 at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1505) ~[JsonReader.class:?] at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1386) ~[JsonReader.class:?] at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:497) ~[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:642) ~[TypeAdapters$25.class:?] at com.google.gson.internal.Streams.parse(Streams.java:44) ~[streams.class:?] at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54) ~[TreeTypeAdapter.class:?] at net.minecraft.util.JsonUtils.gsonDeserialize(JsonUtils.java:453) ~[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:315) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:868) ~[ModelLoader$VanillaLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?] ... 20 more [22:43:51] [Client thread/ERROR] [FML]: Exception loading model for variant hdm1:ItemFlash#inventory for item "hdm1:ItemFlash", blockstate location exception: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model hdm1:ItemFlash#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:1184) ~[ModelLoader$VariantLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?] ... 20 more
-
Creating an item with eclipse: Not working
I am new to modding Minecraft, and I seem to have a problem with making a custom Item named "Flash". I cannot notice a flaw in my code, except for the fact that I compiled my ItemFlash.json file with UTF-8 (not sure if that matters) language. Here are my codes: hdcreeps.modHD1.Reference.java: package hdcreeps.modHD1; public class Reference { public static final String MODID = "hdm1"; public static final String name=%26quot%3BHDCREEPS%26%23039%3B Mod 1"; public static final String VERSION = "1.0"; public static final String CLIENTPROXY = "hdcreeps.modHD1.proxy.ClientProxy"; public static final String SERVERPROXY = "hdcreeps.modHD1.proxy.ServerProxy"; public static enum ModHD1Items{ FLASH("flash", "ItemFlash"); private String unlocalizedName; private String registryName; ModHD1Items(String unlocalizedName, String registryName){ this.unlocalizedname=unlocalizedName%3B this.registryname=registryName%3B } public String getUnlocalizedName(){ return unlocalizedName; } public String getRegistryName(){ return registryName; } } } hdcreeps.modHD1.init.ModItems.java: package hdcreeps.modHD1.init; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; import hdcreeps.modHD1.Reference; import hdcreeps.modHD1.items.ItemFlash; public class ModItems { public static Item flash; public static void init(){ flash = new ItemFlash(); } public static void register(){ GameRegistry.register(flash); } public static void registerRenders(){ registerRender(flash); } public static void registerRender(Item item){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory")); } } hdcreeps.modHD1.items.ItemFlash.java: package hdcreeps.modHD1.items; import net.minecraft.item.Item; import hdcreeps.modHD1.Reference; public class ItemFlash extends Item{ public ItemFlash(){ setUnlocalizedName(Reference.ModHD1Items.FLASH.getUnlocalizedName()); setRegistryName(Reference.ModHD1Items.FLASH.getRegistryName()); } } hdcreeps.modHD1.ModHD1.java: package hdcreeps.modHD1; import hdcreeps.modHD1.init.ModItems; import hdcreeps.modHD1.proxy.CommonProxy; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; @Mod(modid=Reference.MODID,name=Reference%2ENAME%2Cversion%3DReference%2EVERSION%29 public class ModHD1 { @Instance public static ModHD1 instance; @SidedProxy(clientSide=Reference.CLIENTPROXY,serverSide=Reference.SERVERPROXY) public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { System.out.println("Pre Init"); ModItems.init(); ModItems.register(); } @EventHandler public void init(FMLInitializationEvent event) { System.out.println("Init"); proxy.init(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { System.out.println("Post Init"); } } assets.hdm1.models.item.ItemFlash.json: { "parent": "builtin/generated", "textures": { "layer0": "hdm1:items/flash" }, "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 ] } } } assets.hdm1.lang.en_US_lang: item.flash.name=Flash
IPS spam blocked by CleanTalk.