Greenem Posted June 29, 2022 Share Posted June 29, 2022 I have and Item/ItemStack and I need to get it's texture as an usual image. (I'm quite new to modding) I tried doing random stuff with ResourceLocation, ItemRenderer and BlockRenderDispatcher, but didn't succeed. I know that now it's all models and not textures (and some other info), but I'm just too new to this to know what ways to do this exist Can you help me? Quote Link to comment Share on other sites More sharing options...
Greenem Posted June 29, 2022 Author Share Posted June 29, 2022 (edited) Thanks, but I sill don't understand some details I tried your way and created this: Player p = Minecraft.getInstance().player; Item item = p.getInventory().getSelected().getItem(); Block b = Block.byItem(item); Minecraft.getInstance().getItemRenderer().getModel(item.getDefaultInstance(), p.getLevel(), p, 1).getQuads(b.defaultBlockState(), Direction.NORTH, new Random()).get(0).getSprite() But what are the 4th argument in getModel(...) and 3rd argument in getQuads(...)? Am I using all of this in any supposed way? (I just don't know what to put in the arguments) Anyway, this (somehow) gives me the TextureAtlasSprite, but how can I save it to png file? Edited June 29, 2022 by Greenem Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.