Posted October 29, 201410 yr So i'm new to coding and i am trying to make a simple block but i keep getting the error Caused by: java.lang.IllegalArgumentException: Can't add the name (testBlock) without a prefix, object com.FiberSprite.SampleMod.blocks.TestBlock@3e94a6f6 at cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:356) at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:883) at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:858) at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:223) Here is my code: Core Class: http://pastebin.com/faU9vSeQ Core Blocks Class: http://pastebin.com/fRTei7RV TestBlock: http://pastebin.com/D200Uabb
October 29, 201410 yr What forge version are you using? Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
October 29, 201410 yr Pretty sure that gameregistry is supposed to be inside the preinit function. Try GameRegistry.registerBlock(block, "stringName") inside your init function. There's 10 types of people in this world; Those that understand binary and those that don't.
October 29, 201410 yr Author I added it to the preInit and it still isnt working. Heres My PreInit // Block, Items, ETC... @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { //ModBlocks.init(); GameRegistry.registerBlock(testBlock , TestBlock.name); }
October 29, 201410 yr second parameter should be a string. There's 10 types of people in this world; Those that understand binary and those that don't.
October 29, 201410 yr Author second parameter should be a string. it is its the string name of the block in the block file
October 29, 201410 yr It was in preInit, that wasn't the problem. Why did you comment out mod blocks.init? As a test try putting modid: before the name when you register the block. Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
October 29, 201410 yr ryancpexpert, yeah it is. Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
October 29, 201410 yr Author ryancpexpert, yeah it is. Fixed it. I didnt check constants and the file got reset some how and there wasnt a MOD_ID set lol . Im dumb sorry.
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.