Posted October 28, 20177 yr For some reason, I am getting an ArrayIndexOutOfBounds exception from the item obsidianaxe when I load up the game. The other two tools I have added (obsidianpickaxe and obsidiansword) have no problems at all, and I used the same structure to create this item. Here is the GitHub repo: https://github.com/InterdimensionalCat/ModTest The classes effected are: ObsidianAxe: https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/items/ObsidianAxe.java ModItems: https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/ModItems.java and CommonProxy: https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/proxy/CommonProxy.java And here is the crash log: ---- Minecraft Crash Report ---- // Don't be sad. I'll do better next time, I promise! Time: 10/28/17 7:19 PM Description: Initializing game java.lang.ArrayIndexOutOfBoundsException: 5 at net.minecraft.item.ItemAxe.<init>(ItemAxe.java:19) at com.benthom123.test.items.ObsidianAxe.<init>(ObsidianAxe.java:16) at com.benthom123.test.proxy.CommonProxy.registerItems(CommonProxy.java:70) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_5_CommonProxy_registerItems_Register.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:143) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:741) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:603) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:266) at net.minecraft.client.Minecraft.init(Minecraft.java:513) at net.minecraft.client.Minecraft.run(Minecraft.java:421) 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 com.benthom123.test.items.ObsidianAxe.<init>(ObsidianAxe.java:16) at com.benthom123.test.proxy.CommonProxy.registerItems(CommonProxy.java:70) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_5_CommonProxy_registerItems_Register.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:143) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:741) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:603) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:266) at net.minecraft.client.Minecraft.init(Minecraft.java:513) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:421) 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.12.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_151, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 809018528 bytes (771 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.42 Powered by Forge 14.23.0.2515 5 mods loaded, 5 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored | State | ID | Version | Source | Signature | |:----- |:--------- |:------------ |:-------------------------------- |:--------- | | UCH | minecraft | 1.12.2 | minecraft.jar | None | | UCH | mcp | 9.42 | minecraft.jar | None | | UCH | FML | 8.0.99.99 | forgeSrc-1.12.2-14.23.0.2515.jar | None | | UCH | forge | 14.23.0.2515 | forgeSrc-1.12.2-14.23.0.2515.jar | None | | UCH | btm | 0.0.1 | bin | None | Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 385.41' Renderer: 'GeForce GTX 1080 Ti/PCIe/SSE2' Launched Version: 1.12.2 LWJGL: 2.9.4 OpenGL: GeForce GTX 1080 Ti/PCIe/SSE2 GL version 4.5.0 NVIDIA 385.41, NVIDIA Corporation 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: Yes 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: 8x Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz As the stacktrace indicates an issue assigning the attack value, I tried lowering the attack value of my obsidian material, but that didn't change anything. Since the issue was in registering items, I thought that I might be registering too many items using this method. However looking at other registry for 1.12.2 this does not appear to be the case either. Any help would be greatly appreciated!
October 28, 20177 yr Use the constructor that takes 2 floats. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
October 29, 20177 yr Author 1 hour ago, Draco18s said: Use the constructor that takes 2 floats. Thanks, it is loading without error now. From what I understand this means that axes have set possible attack speed and attack damage values. Is there a way to override these values when making an axe? (IE: an axe with even less attack speed than what is possible in the array) EDIT: nvm the constructor allows for that already and I didn't realize it Edited October 29, 20177 yr by InterdimensionalCat
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.