Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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]

  • Author

ItemBlocks are registered in the above loop.

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

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

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.

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.

  • Author

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?

 

...no.

I'm trying to piece this together as I go along. Thank you for your help!

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

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.