Jump to content

[1.10.2] ItemBlock not working in game


KeeganDeathman

Recommended Posts

I am attempting to register an ItemBlock that has a parent of it's block model.

However, no matter what I try, I can't get it to load any model except a big missing texture block.

Here's my registry code:

for(Block block : labstuffBlocks)
		{
			if(block.getRegistryName() != null)
			{
				block.setUnlocalizedName(block.getRegistryName().getResourcePath());
				GameRegistry.register(block);
				ItemBlock item = new ItemBlock(block);
				item.setRegistryName(block.getRegistryName());
				labstuffItemBlocks.put(block, item);
				GameRegistry.register(item);
			}
		}

It should be noted that the block itself is fine, and using Minecraft.getMinecraft()etc doesn't even put the item in the game.

Any help? I feel really dumb atm

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

Link to comment
Share on other sites

ItemBlocks are registered in the above loop.

I am not sure why I remove the modid. I don't anymore

Do you use ModelLoader.setCustomModelResourceLocation(...) in preInit?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

if(block.getRegistryName() != null)

If you're unsure whether your blocks have set their names, then you need to show us some block initialization/constructor code so we can tell you what might be wrong with it. You should probably also emit a warning to the log whenever that check does catch a block's name being null.

 

If you have a problem with missing textures, then get ready to post all related JSON files and a most-recent log file (not console output).

 

Running in the debugger can help you see what's happening so you can make more progress on your own and give us more info on a more narrowly defined problem when you get stuck.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.

Guest
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.

Announcements



×
×
  • Create New...

Important Information

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