Posted August 14, 20169 yr For some reason my minecraft is crashing after adding a custom material for my tools, im not sure what is causing it as I have no errors. Crash report ---- Minecraft Crash Report ---- // On the bright side, I bought you a teddy bear! Time: 15/08/16 02:47 Description: Initializing game java.lang.NullPointerException: Initializing game at net.minecraft.item.ItemSword.<init>(ItemSword.java:27) at top.mod.init.coppersword.<init>(coppersword.java: at top.mod.init._items.preinit(_items.java:25) at top.mod.proxy.CommonProxy.preinit(CommonProxy.java:14) at top.mod.proxy.ClientProxy.preinit(ClientProxy.java:15) at top.mod.main.topmod.preinit(topmod.java:30) 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:597) 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:239) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:217) 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:142) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:607) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:255) at net.minecraft.client.Minecraft.startGame(Minecraft.java:477) at net.minecraft.client.Minecraft.run(Minecraft.java:386) 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 net.minecraft.item.ItemSword.<init>(ItemSword.java:27) at top.mod.init.coppersword.<init>(coppersword.java: at top.mod.init._items.preinit(_items.java:25) at top.mod.proxy.CommonProxy.preinit(CommonProxy.java:14) at top.mod.proxy.ClientProxy.preinit(ClientProxy.java:15) at top.mod.main.topmod.preinit(topmod.java:30) 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:597) 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:239) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:217) 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:142) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:607) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:255) at net.minecraft.client.Minecraft.startGame(Minecraft.java:477) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:386) 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.10.2 Operating System: Windows 8.1 (x86) version 6.3 Java Version: 1.8.0_45, Oracle Corporation Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation Memory: 909705992 bytes (867 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.32 Powered by Forge 12.18.1.2056 4 mods loaded, 4 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.10.2-12.18.1.2056.jar) UCH Forge{12.18.1.2056} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2056.jar) UCE tm{1.10-R1} [Miner's Delight] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'Intel' Version: '3.1.0 - Build 9.17.10.4229' Renderer: 'Intel® HD Graphics' Launched Version: 1.10.2 LWJGL: 2.9.4 OpenGL: Intel® HD Graphics GL version 3.1.0 - Build 9.17.10.4229, 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: 2x Intel® Celeron® CPU G530 @ 2.40GHz Here is my Items registry class package top.mod.init; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.common.registry.GameRegistry; import top.mod.main.reference; import top.mod.mat._toolmat; public class _items { public static Item copper; public static Item coppersword; public static Item copperpick; public static Item coppershovel; public static Item copperaxe; public static Item copperhoe; public static final void preinit(){ copper = registerItem(new copper(), "copper"); coppersword = registerItem(new coppersword(_toolmat.coppermaterial), "coppersword"); copperpick = registerItem(new copperpick(_toolmat.coppermaterial), "copperpick"); coppershovel = registerItem(new coppershovel(_toolmat.coppermaterial), "coppershovel"); copperaxe = registerItem(new copperaxe(_toolmat.coppermaterial), "copperaxe"); copperhoe = registerItem(new copperhoe(_toolmat.coppermaterial), "copperhoe"); } public static final void registerRenders() { registerRender(copper); registerRender(coppersword); registerRender(copperpick); registerRender(coppershovel); registerRender(copperaxe); registerRender(copperhoe); } public static final void registerRender(Item i){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(i,0, new ModelResourceLocation(reference.MODID + ":" + i.getRegistryName().getResourcePath(), "inventory")); } public static final Item registerItem(Item i, String n){ ResourceLocation r = new ResourceLocation(reference.MODID, n); i.setUnlocalizedName(n); i.setRegistryName®; i.setCreativeTab(CreativeTabs.MATERIALS); GameRegistry.register(i); return i; } } Custom material class package top.mod.mat; import net.minecraft.item.Item.ToolMaterial; import net.minecraftforge.common.util.EnumHelper; public class _toolmat { public static ToolMaterial coppermaterial; public static final void preinit(){ coppermaterial = EnumHelper.addToolMaterial("coppermaterial", 1, 181, 6.0F, 2.0F, 14); } } Copper sword class package top.mod.init; import net.minecraft.item.ItemSword; public class coppersword extends ItemSword{ public coppersword(ToolMaterial mat) { super(mat); } }
August 14, 20169 yr Does your material get created before you use it? VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 14, 20169 yr Author so how do I fix it then? Can you give me an example of where the _toolmat.preinit should be?
August 14, 20169 yr At the top of your preInit method/before you create/register your items. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 14, 20169 yr No COPPER_MATERIAL = EnumHelper... VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 14, 20169 yr Author I deleted my custom material package and class, I guess I will start again
August 14, 20169 yr Author Still getting crash Look im just confused why its crashing, I restarted again here are my classes now New crash report ---- Minecraft Crash Report ---- // Hey, that tickles! Hehehe! Time: 15/08/16 03:49 Description: Initializing game java.lang.ArrayIndexOutOfBoundsException: 5 at net.minecraft.item.ItemAxe.<init>(ItemAxe.java:19) at top.mod.init.copperaxe.<init>(copperaxe.java:9) at top.mod.init._items.preinit(_items.java:34) at top.mod.proxy.CommonProxy.preinit(CommonProxy.java:14) at top.mod.proxy.ClientProxy.preinit(ClientProxy.java:15) at top.mod.main.topmod.preinit(topmod.java:30) 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:597) 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:239) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:217) 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:142) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:607) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:255) at net.minecraft.client.Minecraft.startGame(Minecraft.java:477) at net.minecraft.client.Minecraft.run(Minecraft.java:386) 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 net.minecraft.item.ItemAxe.<init>(ItemAxe.java:19) at top.mod.init.copperaxe.<init>(copperaxe.java:9) at top.mod.init._items.preinit(_items.java:34) at top.mod.proxy.CommonProxy.preinit(CommonProxy.java:14) at top.mod.proxy.ClientProxy.preinit(ClientProxy.java:15) at top.mod.main.topmod.preinit(topmod.java:30) 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:597) 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:239) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:217) 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:142) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:607) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:255) at net.minecraft.client.Minecraft.startGame(Minecraft.java:477) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:386) 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.10.2 Operating System: Windows 8.1 (x86) version 6.3 Java Version: 1.8.0_45, Oracle Corporation Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation Memory: 906933136 bytes (864 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.32 Powered by Forge 12.18.1.2056 4 mods loaded, 4 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.10.2-12.18.1.2056.jar) UCH Forge{12.18.1.2056} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2056.jar) UCE tm{1.10-R1} [Miner's Delight] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'Intel' Version: '3.1.0 - Build 9.17.10.4229' Renderer: 'Intel® HD Graphics' Launched Version: 1.10.2 LWJGL: 2.9.4 OpenGL: Intel® HD Graphics GL version 3.1.0 - Build 9.17.10.4229, 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: 2x Intel® Celeron® CPU G530 @ 2.40GHz Items package top.mod.init; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemSword; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fml.common.registry.GameRegistry; import top.mod.main.reference; public class _items { public static Item copper; public static Item coppersword; public static Item copperpick; public static Item coppershovel; public static Item copperaxe; public static Item copperhoe; public static final void preinit(){ coppersword = registerItem(new coppersword(toolmat.COPPER), "coppersword"); copperpick = registerItem(new copperpick(toolmat.COPPER), "copperpick"); coppershovel = registerItem(new coppershovel(toolmat.COPPER), "coppershovel"); copperaxe = registerItem(new copperaxe(toolmat.COPPER), "copperaxe"); copperhoe = registerItem(new copperhoe(toolmat.COPPER), "copperhoe"); copper = registerItem(new copper(), "copper"); } public static final void registerRenders() { registerRender(copper); registerRender(coppersword); registerRender(copperpick); registerRender(coppershovel); registerRender(copperaxe); registerRender(copperhoe); } public static final void registerRender(Item i){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(i,0, new ModelResourceLocation(reference.MODID + ":" + i.getRegistryName().getResourcePath(), "inventory")); } public static final Item registerItem(Item i, String n){ ResourceLocation r = new ResourceLocation(reference.MODID, n); i.setUnlocalizedName(n); i.setRegistryName®; i.setCreativeTab(CreativeTabs.MATERIALS); GameRegistry.register(i); return i; } } Tool mat package top.mod.init; import net.minecraft.item.Item.ToolMaterial; import net.minecraftforge.common.util.EnumHelper; public class toolmat { public static ToolMaterial COPPER = EnumHelper.addToolMaterial("COPPER", 1, 181, 6.0F, 2.0F, 14); } CommonProxy package top.mod.proxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import top.mod.block._blocks; import top.mod.init._items; public class ClientProxy extends CommonProxy{ @Override public void preinit(FMLPreInitializationEvent event) { super.preinit(event); } @Override public void init(FMLInitializationEvent event) { super.init(event); _items.registerRenders(); _blocks.registerRenders(); } @Override public void postinit(FMLPostInitializationEvent event) { super.postinit(event); } }
August 14, 20169 yr Different crash mind you, but use ItemAxe(Item.ToolMaterial, float, float) instead of ItemAxe(Item.ToolMaterial) VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 14, 20169 yr Author This is my axe class, so how would it look, to stop the crash? package top.mod.init; import net.minecraft.item.ItemAxe; public class copperaxe extends ItemAxe{ protected copperaxe(ToolMaterial mat) { super(mat); } }
August 14, 20169 yr add to the super(mat) two flaots (hardness and speed ? ) catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
August 14, 20169 yr Change the constructor to the one I specified. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
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.