Posted June 4, 201510 yr net.minecraftforge.fml.common.LoaderException: java.lang.NoSuchMethodException: com.thedubsteppingninja.MyMod.MyItemBlock.<init>(net.minecraft.block.Block) at net.minecraftforge.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:225) at net.minecraftforge.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:182) at com.thedubsteppingninja.MyMod.Mod.init(Mod.java:37) 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:515) 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:208) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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:118) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:692) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:291) at net.minecraft.client.Minecraft.startGame(Minecraft.java:484) at net.minecraft.client.Minecraft.run(Minecraft.java:325) 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(GradleStartCommon.java:78) at GradleStart.main(GradleStart.java:45) So I tracked down where the problem happened..... public static Block registerBlock(Block block, Class<? extends ItemBlock> itemclass, String name, Object... itemCtorArgs) { if (Loader.instance().isInState(LoaderState.CONSTRUCTING)) { FMLLog.warning("The mod %s is attempting to register a block whilst it it being constructed. This is bad modding practice - please use a proper mod lifecycle event.", Loader.instance().activeModContainer()); } try { assert block != null : "registerBlock: block cannot be null"; ItemBlock i = null; if (itemclass != null) { Class<?>[] ctorArgClasses = new Class<?>[itemCtorArgs.length + 1]; ctorArgClasses[0] = Block.class; for (int idx = 1; idx < ctorArgClasses.length; idx++) { ctorArgClasses[idx] = itemCtorArgs[idx-1].getClass(); } Constructor<? extends ItemBlock> itemCtor = itemclass.getConstructor(ctorArgClasses); -.getConstructor is throwing this exception but I don't know how........... @EventHandler public void init(FMLInitializationEvent event) { variableMyBlock = new MyBlock(Material.wood); GameRegistry.registerBlock(MyBlock, MyItemBlock.class, "name"); CommonProxy.registerRenderThings(); } -Where I registered everything public class MyItemBlock extends ItemBlock { public MyItemBlock() { super(MyMod.variableMyBlock); //calling the block made in the forge mod file this.maxStackSize = 16; this.setCreativeTab(CreativeTabs.tabDecorations); this.setHasSubtypes(true); this.setMaxDamage(0); } -Constructor of my ItemBlock Class So can someone explain to me what I am doing wrong?
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.