I've Just started trying to make
this is the Mod file I think pretty sure lol
package io.github.SamGurtler;import io.github.SamGurtler.Item_Red_Dyed_Water_Bottle;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.Mod;
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.registry.GameRegistry;
@Mod(modid = CRSoda.MODID, version = CRSoda.VERSION)
public class CRSoda
{
public static final String MODID = "CRSoda";
public static final String VERSION = "1.0";
public static Item Red_Dyed_Water_Bottle;
@EventHandler
public void preinit(FMLPreInitializationEvent event)
{
CRSoda.register(Red_Dyed_Water_Bottle);
CRSoda.init();
/*
// some example code
Red_Dyed_Water_Bottle = new Item_Red_Dyed_Water_Bottle().setRegistryName(CRSoda.MODID, "Red Dyed Water Bottle");
GameRegistry.register(Red_Dyed_Water_Bottle.setRegistryName(Red_Dyed_Water_Bottle.getRegistryName()));
//GameRegistry.registerItem(Red_Dyed_Water_Bottle,"Red Dyed Water Bottle");
//GameRegistry.register(Red_Dyed_Water_Bottle.)
*/
}
public static final void init() {
Red_Dyed_Water_Bottle = new Item_Red_Dyed_Water_Bottle().setRegistryName(CRSoda.MODID, "Red Dyed Water Bottle");
register(Red_Dyed_Water_Bottle);
}
private static final void register(Item i) {
GameRegistry.register(i.setUnlocalizedName(i.getRegistryName().toString()));
}
/*
@EventHandler
public void init(FMLInitializationEvent event)
{
// some example code
ItemStack Water_Bottle = new ItemStack(Items.GLASS_BOTTLE.)
GameRegistry.addShapelessRecipe(ItemStack (Items.Red_Dyed_Water_Bottle), Items.);
GameRegistry.registerItem(Red_Dyed_Water_Bottle,"Red_Dyed_Water_Bottle");
}*/
}
and this is the Item file that I think might be the problem
package io.github.SamGurtler;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class Item_Red_Dyed_Water_Bottle extends Item
{
public Item_Red_Dyed_Water_Bottle()
{
setUnlocalizedName(CRSoda.MODID+"_"+"Red Dyed Water Bottle");
// my book says to do this again and I'm not sure why
GameRegistry.registerItem(this,CRSoda.MODID+":"+"Red Dyed Water Bottle");
setCreativeTab(CreativeTabs.MISC);
}
}
Here is the crash report
---- Minecraft Crash Report ----
// But it works on my machine.
Time: 7/21/16 12:57 PM
Description: Initializing game
java.lang.NullPointerException: Initializing game
at io.github.SamGurtler.CRSoda.register(CRSoda.java:42)
at io.github.SamGurtler.CRSoda.preinit(CRSoda.java:25)
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:568)
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:228)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:206)
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:135)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:586)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:475)
at net.minecraft.client.Minecraft.run(Minecraft.java:384)
at net.minecraft.client.main.Main.main(Main.java:118)
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 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.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Client thread
Stacktrace:
at io.github.SamGurtler.CRSoda.register(CRSoda.java:42)
at io.github.SamGurtler.CRSoda.preinit(CRSoda.java:25)
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:568)
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:228)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:206)
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:135)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:586)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:475)
-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:384)
at net.minecraft.client.main.Main.main(Main.java:118)
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 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.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)
-- System Details --
Details:
Minecraft Version: 1.9.4
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_91, Oracle Corporation
Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 851784208 bytes (812 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP 9.28 Powered by Forge 12.17.0.1976 7 mods loaded, 7 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCH mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.9.4-12.17.0.1976.jar)
UCH Forge{12.17.0.1976} [Minecraft Forge] (forgeSrc-1.9.4-12.17.0.1976.jar)
UCH examplemod{1.0} [Example Mod] (bin)
UCE CRSoda{1.0} [CRSoda] (bin)
UCH Flint Sharpener{0.1} [Flint Sharpener] (bin)
UCH Sam's mod test code{0.01} [sam's mod test code] (bin)
Loaded coremods (and transformers):
GL info: ' Vendor: 'Intel' Version: '4.3.0 - Build 10.18.15.4256' Renderer: 'Intel® HD Graphics'
Launched Version: 1.9.4
LWJGL: 2.9.4
OpenGL: Intel® HD Graphics GL version 4.3.0 - Build 10.18.15.4256, 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)
CPU: net.minecraft.client.Minecraft$15@3f3e6c03
I've made sure that my file path (I think is what it's called) is my modid
\src\main\resources\assets\CRSoda\lang
and I think I have my texture in the right spot I think
\src\main\resources\assets\CRSoda\textures
so what am I doing wrong?
also sorry If I posted in the wrong spot this I my first time posting modding and I'm really stuck.
[/size]