Jump to content

[SOLVED] Can't Add The Name (TestBlock) Without A Prefix? [SOLVED]


Recommended Posts

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

Link to comment
Share on other sites

I added it to the preInit and it still isnt working.


Heres My PreInit




// Block, Items, ETC...


    public void preInit(FMLPreInitializationEvent event)





    GameRegistry.registerBlock(testBlock , TestBlock.name);





Link to comment
Share on other sites

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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.