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]: #@[email protected]# Game crashed! Crash report saved to: #@[email protected]# 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.
Is the original 1.7 tutorial 1 posted anywhere? If so, could I get a link? I am still working on a 1.7 mod, and it seems that the setup instructions provided on the new tutorial do not work on 1.7.
I'm on 15a and i'm not sure if I've got it right, there are some errors that I don't understand
Code: (Underline=Error)
public class EntityRegistry
{
static int EntityID = 0;
static int i = 0;
public static void init()
{
}
public static void registerModProjectile(Class entityClass, String name)
{
EntityRegistry.registerModEntity(entityClass, name, ++startEntityID, CheeseCore.instance, 64, 10, true); LogHelper.info("Registering mod projectile " + name + " with ID = " + startEntityID);
}
public static void registerModEntity(Class entityClass, String name)
{
EntityRegistry.registerModEntity(entityClass, name, ++startEntityID, CheeseCore.instance, 80, 3, false);
LogHelper.info("Registering mod entity " + name + " with ID = " + startEntityID);
}
public static void registerModEntityEgg(Class entityClass, String name, int primary, int secondary)
{
registerModEntity(entityClass, name);
if (i == 0)
{
registerSpawnEgg(name, primary, secondary);
++i;
}
}
public static void registerSpawnEgg(String name, int primary, int secondary)
{
}
public static int getUniqueEntityId()
{
do
{ startEntityID++;
}
while (EntityList.getStringFromID(startEntityID) != null);
return startEntityID;
}
If anyone can tell me why these are errors let me know
LogHelper assumes you have that class already - if not, delete that line. As for startEntityID, that is your starting ID variable, in which yours is just EntityID. Change them so they are the same.
Is the original 1.7 tutorial 1 posted anywhere? If so, could I get a link? I am still working on a 1.7 mod, and it seems that the setup instructions provided on the new tutorial do not work on 1.7.
The setup is universal for 1.7+ versions of Forge. It doesn't matter which version you use, it is the same.
*facepalm* thanks
Anything else you need help with cocorj070?
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.
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.
Well, you'll have to figure out the problem with this:
ModBlocks.registerBlockRenderer();
What about the error under "instance"?
Did you create an instance variable in your main class?
Is the original 1.7 tutorial 1 posted anywhere? If so, could I get a link? I am still working on a 1.7 mod, and it seems that the setup instructions provided on the new tutorial do not work on 1.7.
When I hover over "instance" should I create a field or a constant in my main class?
I'm on 15a and i'm not sure if I've got it right, there are some errors that I don't understand
Code: (Underline=Error)
public class EntityRegistry
{
static int EntityID = 0;
static int i = 0;
public static void init()
{
}
public static void registerModProjectile(Class entityClass, String name)
{
EntityRegistry.registerModEntity(entityClass, name, ++startEntityID, CheeseCore.instance, 64, 10, true);
LogHelper.info("Registering mod projectile " + name + " with ID = " + startEntityID);
}
public static void registerModEntity(Class entityClass, String name)
{
EntityRegistry.registerModEntity(entityClass, name, ++startEntityID, CheeseCore.instance, 80, 3, false);
LogHelper.info("Registering mod entity " + name + " with ID = " + startEntityID);
}
public static void registerModEntityEgg(Class entityClass, String name, int primary, int secondary)
{
registerModEntity(entityClass, name);
if (i == 0)
{
registerSpawnEgg(name, primary, secondary);
++i;
}
}
public static void registerSpawnEgg(String name, int primary, int secondary)
{
}
public static int getUniqueEntityId()
{
do
{
startEntityID++;
}
while (EntityList.getStringFromID(startEntityID) != null);
return startEntityID;
}
If anyone can tell me why these are errors let me know
LogHelper assumes you have that class already - if not, delete that line. As for startEntityID, that is your starting ID variable, in which yours is just EntityID. Change them so they are the same.
The setup is universal for 1.7+ versions of Forge. It doesn't matter which version you use, it is the same.
All of your initialization events are FMLInitializationEvent
np
Thank you for putting them all in pastebin even thou I didn't see them all in time.
Thanks for the help!
Although the "ModName.instance" is still an error,
^ (I did replace my Modname in there)
l
Am I missing something? It feels like a I skipped a part of the tutorial
Actually it looks like Brockstar01 is having the same issue as me, is the tutorial missing something?
Points to a variable you have to set up in your Main Class like this
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class YourMainClassName{
@Instance(Reference.MODID)
public static YourMainClassName instance;
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){//init events below
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNot to brag, but my first mod got 250 downloads in a month. That's 230 more than yours. Still, I have you to thank.
Well thats good to hear
What is your modid?