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?