Posted September 19, 20169 yr 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]
September 20, 20169 yr 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]
September 20, 20169 yr 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.
September 20, 20169 yr 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.
September 21, 20169 yr 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.