Daniat Posted February 12, 2017 Share Posted February 12, 2017 (edited) Hello, i am adding custom tools which uses uranium as Tool Material, but i am getting a crash when my preInit method calls ModItems.init to initialize all the items and tools ive read this older post: but his code is pretty much unreadable and the posts info are messed up, anyways it seems i need to initialize the material of the tools use before i create them, so i have tried two ways Calling Reference.preInitMaterial(); before ModItems.init(); then radioactiveaxe = new ItemRadioactiveAxe(Reference.uraniumMaterial); ive also tried creating the material directly in my ModItems class None of these worked for me, any ideas? Thanks Edited February 12, 2017 by Daniat Quote Link to comment Share on other sites More sharing options...
Anagkai Posted February 12, 2017 Share Posted February 12, 2017 Maybe you used the wrong constructor for the axe. If the other tools work fine. Quote Link to comment Share on other sites More sharing options...
Animefan8888 Posted February 12, 2017 Share Posted February 12, 2017 Please post your code in text and not images using the code sign in the posting area. Quote 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. Link to comment Share on other sites More sharing options...
Daniat Posted February 12, 2017 Author Share Posted February 12, 2017 2 minutes ago, Animefan8888 said: Please post your code in text and not images using the code sign in the posting area. okay i will, i am new on the forum this was the best way i found Quote Link to comment Share on other sites More sharing options...
Daniat Posted February 12, 2017 Author Share Posted February 12, 2017 (edited) 14 minutes ago, Anagkai said: Maybe you used the wrong constructor for the axe. If the other tools work fine. yes, the other tools work fine, but that is the default constructor for ItemAxe, the only thing strange i see is that i had to change it from protected to public because i initialize my items in a different folder Edited February 12, 2017 by Daniat Quote Link to comment Share on other sites More sharing options...
Daniat Posted February 12, 2017 Author Share Posted February 12, 2017 thanks for the tips, here is the crash log ---- Minecraft Crash Report ---- // Don't be sad. I'll do better next time, I promise! Time: 12/02/17 1:30 Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Tutorial Mod (uraniummod) Caused by: java.lang.ArrayIndexOutOfBoundsException: 5 at net.minecraft.item.ItemAxe.<init>(ItemAxe.java:19) at com.daniat.uraniummod.items.ItemRadioactiveAxe.<init>(ItemRadioactiveAxe.java:11) at com.daniat.uraniummod.init.ModItems.init(ModItems.java:43) at com.daniat.uraniummod.UraniumMod.preInit(UraniumMod.java:32) 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:618) 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:243) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:221) 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:145) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:624) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:259) 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: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.10.2 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0_121, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 153192920 bytes (146 MB) / 899153920 bytes (857 MB) up to 3806855168 bytes (3630 MB) JVM Flags: 0 total; IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.32 Powered by Forge 12.18.3.2221 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.3.2221.jar) UCH Forge{12.18.3.2221} [Minecraft Forge] (forgeSrc-1.10.2-12.18.3.2221.jar) UCE uraniummod{1.0} [Tutorial Mod] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.1.0' Renderer: 'GeForce GTX 560 Ti/PCI/SSE2' Quote Link to comment Share on other sites More sharing options...
Animefan8888 Posted February 12, 2017 Share Posted February 12, 2017 You need to use the other constructor of ItemAxe. Quote 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. Link to comment Share on other sites More sharing options...
Daniat Posted February 12, 2017 Author Share Posted February 12, 2017 i just saw one here: https://takahikokawasaki.github.io/minecraft-resources/javadoc/forge/1.8-11.14.1.1320/net/minecraft/item/ItemAxe.html i added attack and speed floats to the constructor and it worked, thanks [SOLVED] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.