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.

[1.10.2] The import net.minecraft.client.resources.model cannot be resolved.

Featured Replies

Posted

Hi, I'm a newbie modder trying to follow MrCrayfish's 1.8 modding tutorial

 

 

in 1.10.2. While trying to import ModelResourceLocation, I got an error saying that the import net.minecraft.client.resources.model cannot be resolved. I'm guessing this was caused by the new dual wielding in 1.9. Can someone ELI5 how this kind of thing is done now? Preferably by converting this code to 1.10.2 since I probably won't understand what you're talking about otherwise:

 

 

package com.thlurb.tutorial.init;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class TutorialItems {

public static Item test_item;

public static void  init() {

	test_item = new Item().setUnlocalizedName("test_item");
}

public static void register() {

	GameRegistry.registerItem(test_item, test_item.getUnlocalizedName().substring(5));

}

public static void registerRenders() {

}

public static void registerRenders(Item item) {

	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
}

 

 

Thanks!

  • Author

This has nothing to do with versions.

 

1. Client only classes (models) have to be moved to proxy:

http://mcforge.readthedocs.io/en/latest/concepts/sides/

 

Google proxy tutorials.

 

2. Stop using unlocalizedName.subString "way" - it's an abomination :P

 

So the code is just wrong? Not because I'm on 1.10.2? Because that's the exact code from MrCrayfish's tutorial

ModelResourceLocation

was moved to the

net.minecraft.client.renderer.block.model

package.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.