1

I have a large 3D model and it looks too bulky in the inventory GUI. So I need the 3D model to be rendered only in the item frame, and in all other interfaces it has a 2D texture. And the question is how to do it? I tried to do it by using “display” in the .json of the model. But for some reason the 3D model is still rendered everywhere, but the 2D texture is like never before. Ah yes I forgot to mention that all this should work on version 1.16.5.

Here is the “display” code for the 3D model:

    "display": {
        "fixed": {
            "rotation": [-90, 0, 0],
            "translation": [-10, 0, -16],
            "scale": [2, 2, 2]
        }

but I lost the “display” code for the 2D texture.

5
  • By "2D texture" you mean an icon of or for the model, and not the model itself, I imagine? Most textures are 2D, and most models are covered in 2D textures, making 'in those cases "it has a 2D texture"' seem redundant, hence my request for clarification.
    – Joachim
    Commented Jun 6 at 9:57
  • By “2D texture” I mean an icon for a 3d model
    – tidal wave
    Commented Jun 6 at 10:08
  • @Joachim I'm sorry to bother you, but can you help me with this?
    – tidal wave
    Commented Jun 6 at 11:38
  • I'm sorry, I'm not that familiar with Minecraft. Does this or this help?
    – Joachim
    Commented Jun 6 at 13:12
  • 1
    Unfortunately neither worked, I did everything the same as in the first link. And on the second link they offer Java code, but I need to make it work on vanilla texturepack using OptiFine CIT. Thanks for trying to help anyway.
    – tidal wave
    Commented Jun 6 at 14:27

2 Answers 2

0

Yo try this one:

Step 1: Create the 2D texture

First make sure you have your 2D texture file ready, for example my_item_2d.png.

Step 2: Create the 3D model json

Here’s an example JSON file for the 3D model:

{
"parent": "item/generated",
"textures": {
    "layer0": "yourmodid:item/my_item_2d"
},
"display": {
    "thirdperson_righthand": {
        "rotation": [0, 90, -35],
        "translation": [0, 1.25, -3.5],
        "scale": [0.85, 0.85, 0.85]
    },
    "thirdperson_lefthand": {
        "rotation": [0, 90, -35],
        "translation": [0, 1.25, -3.5],
        "scale": [0.85, 0.85, 0.85]
    },
    "firstperson_righthand": {
        "rotation": [0, -135, 25],
        "translation": [0, 4, 2],
        "scale": [1.7, 1.7, 1.7]
    },
    "firstperson_lefthand": {
        "rotation": [0, -135, 25],
        "translation": [0, 4, 2],
        "scale": [1.7, 1.7, 1.7]
    },
    "fixed": {
        "rotation": [-90, 0, 0],
        "translation": [-10, 0, -16],
        "scale": [2, 2, 2]
    },
    "gui": {
        "rotation": [30, 225, 0],
        "translation": [0, 0, 0],
        "scale": [0.625, 0.625, 0.625]
    },
    "ground": {
        "rotation": [0, 0, 0],
        "translation": [0, 3, 0],
        "scale": [0.25, 0.25, 0.25]
    },
    "head": {
        "rotation": [0, 0, 0],
        "translation": [0, 0, 0],
        "scale": [1, 1, 1]
    }
},
"overrides": [
    {
        "predicate": {
            "custom_model_data": 1234567
        },
        "model": "yourmodid:item/my_item_3d"
    }
]

}

Step 3: Separate the 2D and 3D models

2D Model File (my_item_2d.json):

{
"parent": "item/generated",
"textures": {
    "layer0": "yourmodid:item/my_item_2d"
}

}

3D Model File (my_item_3d.json):

{
"parent": "item/generated",
"textures": {
    "layer0": "yourmodid:item/my_item_3d"
},
"elements": [
    {
        "from": [0, 0, 0],
        "to": [16, 16, 16],
        "faces": {
            "north": { "texture": "#layer0", "uv": [0, 0, 16, 16] },
            "east": { "texture": "#layer0", "uv": [0, 0, 16, 16] },
            "south": { "texture": "#layer0", "uv": [0, 0, 16, 16] },
            "west": { "texture": "#layer0", "uv": [0, 0, 16, 16] },
            "up": { "texture": "#layer0", "uv": [0, 0, 16, 16] },
            "down": { "texture": "#layer0", "uv": [0, 0, 16, 16] }
        }
    }
]

}

Step 4: Make sure your resource pack structure is as follows:

enter image description here

Replace yourmodid with your actual mod ID, and ensure the filenames match exactly.

Let me know how it works yo...

3
  • Wait, will it work if I just use OptiFine CIT instead of the mod? I mean if you put this .json in a texture pack and not in a mod.
    – tidal wave
    Commented Jun 6 at 14:52
  • Yeah it will work using OptiFine's CIT without a mod with few changes in the above solution. Let me do this in this way
    – Miles G.
    Commented Jun 6 at 15:31
  • Yo don't forget to use the "}" in the step 3 and step 4 (because this is written outside the coding box). As said there is a bug here to place the code correctly.
    – Miles G.
    Commented Jun 6 at 15:46
0

Here’s how you can do it using OptiFine's CIT:

Step 1: Make sure you have the following files ready:

A 2D texture (my_item_2d.png) A 3D model JSON file (my_item_3d.json) A texture for the 3D model (my_item_3d.png)

Step 2: Create the folder structure for your resource pack:

enter image description here

Step 3: Create a pack.mcmeta file in the root of your resource pack folder:

{
"parent": "item/generated",
"textures": {
    "layer0": "minecraft:item/my_item_2d"
}

}

Step 4: Create JSON Model Files

my_item_2d.json:

{
"parent": "item/generated",
"textures": {
    "layer0": "minecraft:item/my_item_3d"
},
"elements": [
    {
        "from": [0, 0, 0],
        "to": [16, 16, 16],
        "faces": {
            "north": { "texture": "#layer0", "uv": [0, 0, 16, 16] },
            "east": { "texture": "#layer0", "uv": [0, 0, 16, 16] },
            "south": { "texture": "#layer0", "uv": [0, 0, 16, 16] },
            "west": { "texture": "#layer0", "uv": [0, 0, 16, 16] },
            "up": { "texture": "#layer0", "uv": [0, 0, 16, 16] },
            "down": { "texture": "#layer0", "uv": [0, 0, 16, 16] }
        }
    }
]

}

Step 5: Create a .properties file for OptiFine CIT in assets/optifine/cit/. The file name can be anything, for example, my_item.properties:

enter image description here

Step 6: Load your resource pack in Minecraft with OptiFine installed. And rename the item to match the name specified in the .properties file (e.g., My Special Item).

Note: There is a bug in placing the codes, so I have used screenshot.

1
  • Wait again, are you now discussing just how to add a 3d model? But I need the 3D .json model to be displayed only in the item frame, and in all other cases it would be a 2D icon (at least I don't see any code about the item frame). So when I put a 2D icon in the items frame it became a 3D model. Sort of like a trident as it becomes a 3D model in hands, but in all other cases it's just a 2D icon. Note: I made the model in Blockbench and I got 2 textures for the model. I apologize if I am taking up your time.
    – tidal wave
    Commented Jun 6 at 16:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .