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][SOLVED] Inexplicable problem with basic item rendering...

Featured Replies

Posted

So, a couple days ago I decided to switch from using Forge 1.8 to 1.10.2. Setup went fine, and while putting together a basic item I only noticed a few minor changes. However, upon testing it out, I ran into a strange problem with the position/scale of the item in 3d space.

 

The item .json file is just a tweaked copy of a basic vanilla item model with just the texture switched out. It is clearly loading the model though, as indicated by the texture showing up. I just don't know if I'm missing something major that was changed since 1.8. :-\

 

Here are some pictures of the issue, followed by my code:

 


 

FtUEOVr.pngHdzUEGt.pngINPKh2z.png

 


 

Excerpt from "src/main/java/joshuastone/testmod/TestMod.java":

 

@SidedProxy(serverSide="joshuastone.testmod.proxy.CommonProxy", clientSide="joshuastone.testmod.proxy.ClientProxy")
public static CommonProxy proxy;

@EventHandler
public void preinit(FMLPreInitializationEvent event) {
proxy.preinit(event);
}

@EventHandler
public void init(FMLInitializationEvent event) {
proxy.init(event);
}

 

 

Excerpt from "src/main/java/joshuastone/testmod/proxy/CommonProxy.java":

 

public void preinit(FMLPreInitializationEvent event) {
TestItems.register();
}

public void init(FMLInitializationEvent event) {}

 

 

Excerpt from "src/main/java/joshuastone/testmod/proxy/ClientProxy.java":

 

public void preinit(FMLPreInitializationEvent event) {
super.preinit(event);
}

public void init(FMLInitializationEvent event) {
super.init(event);
TestItems.registerItemModels();
}

 

 

Excerpt from "src/main/java/joshuastone/testmod/items/TestItems.java":

 

public static Item testItem = new Item().setUnlocalizedName("test_item").setCreativeTab(CreativeTabs.MISC);

public static void register() {
registerItem(testItem);
}

private static void registerItem(Item item) {
GameRegistry.register(item.setRegistryName(item.getUnlocalizedName().substring(5)));
}

@SideOnly(Side.CLIENT)
public static void registerItemModels() {
registerItemModel(testItem);
}

@SideOnly(Side.CLIENT)
private static void registerItemModel(Item item) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}

 

 

Contents of "src/main/resources/assets/testmod/models/item/test_item.json":

 

{
"parent": "builtin/generated",
"textures": {
	"layer0": "testmod:items/test_item"
},
"display": {
	"thirdperson": {
		"rotation": [ -90, 0, 0 ],
		"translation": [ 0, 1, -3 ],
		"scale": [ 0.55, 0.55, 0.55 ]
	},
	"firstperson": {
		"rotation": [ 0, -135, 25 ],
		"translation": [ 0, 4, 2 ],
		"scale": [ 1.7, 1.7, 1.7 ]
	}
}
} 

 

 


 

Thank you for your time. Just let me know if you need any more information in order to understand my problem.  :P

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.