I've got this error which I've been struggling with for ages. I've narrowed it down to in RegisterHelper where it gets item from block, its returning null, could anyone help please:
@GameRegistry.ObjectHolder(Reference.MOD_ID)
public class ModBlocks {
public static Block flag = new BlockFlag().setUnlocalizedName("flag");
public static Block oreEngland = new BlockEnglandOre().setUnlocalizedName("oreEngland");
public static void registerBlocks()
{
LogHelper.info(flag.getUnlocalizedName());
LogHelper.info(oreEngland.getUnlocalizedName());
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
}
Crash Report
[20:02:58] [Sound Library Loader/INFO]: Sound engine started
[20:03:12] [Client thread/INFO]: Created: 512x512 textures-atlas
[20:03:19] [Client thread/ERROR] [ModTesting]: tile.flag
[20:03:19] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
[20:03:19] [Client thread/ERROR] [FML]:
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{8.99.4.1410} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1410.jar) Unloaded->Constructed->Pre-initialized->Initialized
Forge{11.14.1.1410} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1410.jar) Unloaded->Constructed->Pre-initialized->Initialized
modtesting{1.8_0.0.1} [modtesting] (bin) Unloaded->Constructed->Pre-initialized->Errored
[20:03:19] [Client thread/ERROR] [FML]: The following problems were captured during this phase
[20:03:19] [Client thread/ERROR] [FML]: Caught exception from modtesting
java.lang.NullPointerException
at com.justkunas.ModTesting.Utility.RegisterHelper.registerBlockRenderer(RegisterHelper.java:33) ~[bin/:?]
at com.justkunas.ModTesting.init.ModBlocks.registerBlockRenderer(ModBlocks.java:29) ~[bin/:?]
at com.justkunas.ModTesting.proxy.ClientProxy.registerRenderers(ClientProxy.java:18) ~[bin/:?]
at com.justkunas.ModTesting.ModTesting.init(ModTesting.java:35) ~[bin/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:537) ~[forgeSrc-1.8-11.14.1.1410.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) ~[forgeSrc-1.8-11.14.1.1410.jar:?]
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) ~[forgeSrc-1.8-11.14.1.1410.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?]
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:707) [Loader.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:312) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:528) [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.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
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/:?]
[20:03:19] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: ---- Minecraft Crash Report ----
// But it works on my machine.
Time: 20/05/15 20:03
Description: Initializing game
java.lang.NullPointerException: Initializing game
at com.justkunas.ModTesting.Utility.RegisterHelper.registerBlockRenderer(RegisterHelper.java:33)
at com.justkunas.ModTesting.init.ModBlocks.registerBlockRenderer(ModBlocks.java:29)
at com.justkunas.ModTesting.proxy.ClientProxy.registerRenderers(ClientProxy.java:18)
at com.justkunas.ModTesting.ModTesting.init(ModTesting.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:707)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:312)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:528)
at net.minecraft.client.Minecraft.run(Minecraft.java:356)
at net.minecraft.client.main.Main.main(Main.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Stacktrace:
at com.justkunas.ModTesting.Utility.RegisterHelper.registerBlockRenderer(RegisterHelper.java:33)
at com.justkunas.ModTesting.init.ModBlocks.registerBlockRenderer(ModBlocks.java:29)
at com.justkunas.ModTesting.proxy.ClientProxy.registerRenderers(ClientProxy.java:18)
at com.justkunas.ModTesting.ModTesting.init(ModTesting.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:707)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:312)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:528)
-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:356)
at net.minecraft.client.main.Main.main(Main.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)
-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows 8.1 (amd64) version 6.3
Java Version: 1.8.0_45, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 96715704 bytes (92 MB) / 212336640 bytes (202 MB) up to 928514048 bytes (885 MB)
JVM Flags: 0 total;
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.10 FML v8.99.4.1410 Minecraft Forge 11.14.1.1410 4 mods loaded, 4 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{8.99.4.1410} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1410.jar) Unloaded->Constructed->Pre-initialized->Initialized
Forge{11.14.1.1410} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1410.jar) Unloaded->Constructed->Pre-initialized->Initialized
modtesting{1.8_0.0.1} [modtesting] (bin) Unloaded->Constructed->Pre-initialized->Errored
Loaded coremods (and transformers):
GL info: ' Vendor: 'Intel' Version: '4.0.0 - Build 10.18.10.3345' Renderer: 'Intel(R) HD Graphics 4000'
Launched Version: 1.8
LWJGL: 2.9.1
OpenGL: Intel(R) HD Graphics 4000 GL version 4.0.0 - Build 10.18.10.3345, Intel
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.
Using VBOs: No
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (US)
Profiler Position: N/A (disabled)
[20:03:19] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Justin\Documents\Projects\Minecraft\1.8\ModTesting\.\crash-reports\crash-2015-05-20_20.03.19-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed
at com.justkunas.ModTesting.Utility.RegisterHelper.registerBlockRenderer(RegisterHelper.java:33) ~[bin/:?]
at com.justkunas.ModTesting.init.ModBlocks.registerBlockRenderer(ModBlocks.java:29) ~[bin/:?]
at com.justkunas.ModTesting.proxy.ClientProxy.registerRenderers(ClientProxy.java:18) ~[bin/:?]
at com.justkunas.ModTesting.ModTesting.init(ModTesting.java:35) ~[bin/:?]
Please post you code on pastebin, so we can see the numbers of the lines. We need to see you ClientProxy and ModTesting.
Monsters have taken up the surface of The World of Minecraft. You have never been able to make tools, weapons, and armor. You gather as much resources before night. You are starving, but you have to live. The only choice for you is to live underground. Monsters come running after you and you punch them with you fist. You try to hide for the rest of the night.
The sun rises; you wake up and look for a village. You travel through deserts and plains, but you still cannot find a village. The sun is going down again and you must go back underground.
Next day, you wake up early in the morning. You see monsters burning and you try to outrun them. You continue to search for a village.
You find a village and learn many things. You learned how to make leather armor and wooden weapons and tools. You kill all the villagers for revenge and watch the sun set. You continue to live underground. You must find a zombie villager to kill you because you want to sacrifice your life to the gods.
You have figured out how to make stone tools and weapons. You must find a desert and build a pyramid for your last body out of sandstone and you continue to live underground. Next, you must build a ziggurat next to the pyramid out of spruce, dark oak, and sandstone. You decide to sacrifice yourself again.
Next, you must build ancient Mesopotamian and Egypt and become Pharaoh. You can make anything out of everything in The World of Minecraft.
So I want to make a custom mod for my modpack, how would I go about making a mod with only events no blocks or items.
What kind of events? If you don't want blocks or items, then you simply do not add the class to the MainRegistry and make the classes for the blocks or items.
so where would i go to find the source code for vanilla minecraft
You will not have the entire source code for things like apples, bread, etc, but you will have all the files you need.
Where to find Src:
build\tmp\recompSrc
build.tmp.recompSrc
You will start figuring out things yourself on modding if you put yourself up to it. I find modding easier than making a java game from scratch because you can read and understand the files instead of making your own not knowing what to do. Knowing java isn't enough.
The source is located here. And a future tip, be careful with what you 'consider' open-source - you could find yourself in a bit of trouble.
What bit of trouble? Would you like me to change what I said? The .class files are also the same as the .java files except for when you have things like "{" it's moved to the next line.
I don't see the source and texture, but this looks like a very good project. I can open .jar files and read .class files with two special programs, so I can call anything open-source. Please at least give the .jar file.
at com.abeticdi.mymod.init.ModItems.init(ModItems.java:13)
at MyMod.MyMod.PreInit(MyMod.java:22)
The numbers at the end next to the parentheses tell you what line of code errored. The other thing in the parentheses tells you which .java file was errored. Everything else before the parentheses tells you the location of the .java file.
Error in mod items:
RegisterHelper.registerItems(magnet);
We still need to see the MyMod.java to find what errored on line 22. If you changed anything in either classes, then we need to see the new crash report. We also will need to see the updated classes if you changed anything.
0
Thank you for putting them all in pastebin even thou I didn't see them all in time.
0
Well, you'll have to figure out the problem with this:
ModBlocks.registerBlockRenderer();
0
I couldn't find line 18 in the ClientProxy. I did find this in ModTesting:
proxy.registerRenderers();
Try taking off the s at the end.
0
at com.justkunas.ModTesting.Utility.RegisterHelper.registerBlockRenderer(RegisterHelper.java:33) ~[bin/:?]
at com.justkunas.ModTesting.init.ModBlocks.registerBlockRenderer(ModBlocks.java:29) ~[bin/:?]
at com.justkunas.ModTesting.proxy.ClientProxy.registerRenderers(ClientProxy.java:18) ~[bin/:?]
at com.justkunas.ModTesting.ModTesting.init(ModTesting.java:35) ~[bin/:?]
Please post you code on pastebin, so we can see the numbers of the lines. We need to see you ClientProxy and ModTesting.
0
Anything else you need help with cocorj070?
0
Monsters have taken up the surface of The World of Minecraft. You have never been able to make tools, weapons, and armor. You gather as much resources before night. You are starving, but you have to live. The only choice for you is to live underground. Monsters come running after you and you punch them with you fist. You try to hide for the rest of the night.
The sun rises; you wake up and look for a village. You travel through deserts and plains, but you still cannot find a village. The sun is going down again and you must go back underground.
Next day, you wake up early in the morning. You see monsters burning and you try to outrun them. You continue to search for a village.
You find a village and learn many things. You learned how to make leather armor and wooden weapons and tools. You kill all the villagers for revenge and watch the sun set. You continue to live underground. You must find a zombie villager to kill you because you want to sacrifice your life to the gods.
You have figured out how to make stone tools and weapons. You must find a desert and build a pyramid for your last body out of sandstone and you continue to live underground. Next, you must build a ziggurat next to the pyramid out of spruce, dark oak, and sandstone. You decide to sacrifice yourself again.
Next, you must build ancient Mesopotamian and Egypt and become Pharaoh. You can make anything out of everything in The World of Minecraft.
1.Find a stronghold.
2.Find an abandoned mine shaft.
3.Find a natural cobblestone generator.
4.Find diamonds.
5.Eat a pig.
6.Find a lead.
7.Find a saddle.
8.Find an ancient pyramid.
Document:
http://adf.ly/1HQuTs
Tell me what you think.
0
Thank you so much. It all makes perfect sense.
0
What kind of events? If you don't want blocks or items, then you simply do not add the class to the MainRegistry and make the classes for the blocks or items.
0
You will not have the entire source code for things like apples, bread, etc, but you will have all the files you need.
Where to find Src:
build\tmp\recompSrc
build.tmp.recompSrc
You will start figuring out things yourself on modding if you put yourself up to it. I find modding easier than making a java game from scratch because you can read and understand the files instead of making your own not knowing what to do. Knowing java isn't enough.
Follow the tutorials to setup everything.
0
Where would my commands go in the MainRegistry? How do I figure out what goes in PreLoad, load, and PostLoad?
0
What bit of trouble? Would you like me to change what I said? The .class files are also the same as the .java files except for when you have things like "{" it's moved to the next line.
0
I don't see the source and texture, but this looks like a very good project. I can open .jar files and read .class files with two special programs, so I can call anything open-source. Please at least give the .jar file.
0
Here's what I found:
at com.abeticdi.mymod.init.ModItems.init(ModItems.java:13)
at MyMod.MyMod.PreInit(MyMod.java:22)
The numbers at the end next to the parentheses tell you what line of code errored. The other thing in the parentheses tells you which .java file was errored. Everything else before the parentheses tells you the location of the .java file.
Error in mod items:
RegisterHelper.registerItems(magnet);
We still need to see the MyMod.java to find what errored on line 22. If you changed anything in either classes, then we need to see the new crash report. We also will need to see the updated classes if you changed anything.
0
How do I make a boss with command blocks?
0
It's supposed to be JRE! But make sure it's not directed to the bin folder.