Posted May 11, 20205 yr I'm starting recently with making simple mod. I add new block but i found problem with adding block item. Can someone help me with that ? This is my code : in RegistryHandler: public static final RegistryObject<Item> ROCK_BLOCK_ITEM = Items.register("rock_Block", () -> new BlockItemBase(ROCK_BLOCK.get())); in BlockItemBase: public class BlockItemBase extends BlockItem { public BlockItemBase(Block block) { super(block, new Item.Properties().group(CMain.Tab)); } }
May 11, 20205 yr Author The error is : [14:14:30] [modloading-worker-2/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Failed to create mod instance. ModID: skysagamod, class com.Destiny.skysagamod.CMain java.lang.ExceptionInInitializerError: null at com.Destiny.skysagamod.CMain.<init>(CMain.java:26) ~[?:?] {re:classloading} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181] {} at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_181] {} at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_181] {} at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_181] {} At this line in CMain class I have : RegistryHandler.init(); When I add // in RegistryHandler before public static final RegistryObject<Item> ROCK_BLOCK_ITEM = Items.register("rock_Block", () -> new BlockItemBase(ROCK_BLOCK.get())); code compile so problem is with registration itemblock.
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.