Jump to content

1.8 change textures of Item


Recommended Posts

You need to say - based on what? ItemStack's NBT? ISmartItemModel is your shot.

You willl still need json models etc.


Other option would be having variants and change item's meta (recreate item on certain action).



1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

What if he wants to bind textures not of .JSON models dynamically in-game? Why would he want to pre-create a bunch of .JSON models for his item? There really needs to be a feature for binding textures to items just like IItemRenderer had back then...


Yes, you can use IPerspectiveAwareModel to change the model based on the camera transform, ISmartItemModel based on the itemstack information, IFlexibleBakedModel for an explicit vertex format, etc. If you just want to create a bunch of .JSON models but don't need any of the interfaces above, simply override the getModel() method your item class and return any ModelResourceLocation you want for that item. Don't forget to add your extra .JSONs do the ModelBakery by using the ModelBakery.addVariantName(String) method. Hope that helps you out!

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

Link to comment
Share on other sites

But well, this model thing does only, like model, is called when the player holds it in his hand, I much more smarter thing would be, because I want to use the already existing jsons from other items, so does anyone know how to get them, and then bind them to the renderer?


I don't think that will work, because that qould change all the Items:


BTTagCompound nbt = stack.getTagCompound();
	String renderItem = nbt.getString("unlocalizedRender");
	ItemStack theRenderStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) nbt.getTag("stackTag"));
	IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(theRenderStack);
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(this, new ModelResourceLocation(model.getTexture().toString(), "inventory"));

Creator of Extra Shoes


Watch out, I'm total jerk, and I'll troll anybody if it feels like its necessary. Pls report me then

Link to comment
Share on other sites

Yes based on the NBT, so I will try this getModel thingy out, lets see how this one works


For NBT you want to create a class implementing ISmartItemModel and checking NBT data in the handleItemState() method. You can switch between different models based on NBT their, since handleItemState() returns an IBakedModel type. You may have to add your ModelResourceLocation to the model bakery - ModelBakery.addVariantName(Item, Meta, modelresourcelocation(ID + : +NameOfModel, inv);

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

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.

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.


  • Create New...

Important Information

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