Jump to content

[1.10.2][SOLVED] Inexplicable problem with basic item rendering...


Joshua Stone

Recommended Posts

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

Link to comment
Share on other sites

Switch your parent to "item/generated" and get rid of your display, thirdperson, and firstperson tags.

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

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.