How to set up model display and fix model display issues.

Started by NorthWestTrees on

Topic category: User side tutorials

How to set up model display and fix model display issues.
Tue, 08/06/2019 - 18:41 (edited)

If you are working with Cubik Studio then you may have had an issue where the .json file does not contain the "display" settings in the exported model for blocks or items. This tutorial will show you how to set up your .json model file to add the display settings. You can find the files with the display settings in the following paths.

 

Paths
\assets\minecraft\models\block\block.json
\assets\minecraft\models\item\generated.json

 

Default block display settings:


{
"display": {
    "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 ]
    },
    "fixed": {
        "rotation": [ 0, 0, 0 ],
        "translation": [ 0, 0, 0],
        "scale":[ 0.5, 0.5, 0.5 ]
    },
    "thirdperson_righthand": {
        "rotation": [ 75, 45, 0 ],
        "translation": [ 0, 2.5, 0],
        "scale": [ 0.375, 0.375, 0.375 ]
    },
    "firstperson_righthand": {
        "rotation": [ 0, 45, 0 ],
        "translation": [ 0, 0, 0 ],
        "scale": [ 0.40, 0.40, 0.40 ]
    },
    "firstperson_lefthand": {
        "rotation": [ 0, 225, 0 ],
        "translation": [ 0, 0, 0 ],
        "scale": [ 0.40, 0.40, 0.40 ]
    }
}
}

 

Default item display settings:


{
"display": {
    "ground": {
        "rotation": [ 0, 0, 0 ],
        "translation": [ 0, 2, 0],
        "scale":[ 0.5, 0.5, 0.5 ]
    },
    "head": {
        "rotation": [ 0, 180, 0 ],
        "translation": [ 0, 13, 7],
        "scale":[ 1, 1, 1]
    },
    "thirdperson_righthand": {
        "rotation": [ 0, 0, 0 ],
        "translation": [ 0, 3, 1 ],
        "scale": [ 0.55, 0.55, 0.55 ]
    },
    "firstperson_righthand": {
        "rotation": [ 0, -90, 25 ],
        "translation": [ 1.13, 3.2, 1.13],
        "scale": [ 0.68, 0.68, 0.68 ]
    },
    "fixed": {
        "rotation": [ 0, 180, 0 ],
        "scale": [ 1, 1, 1 ]
    }
}
}

You can open your .json file with a program designed for coding like notepad++ which is free software widely used for quick editing for code. If your file looks similar to below then you may need to add the display settings to your item or block.

 

Example of a Cubik Studio .json file.


{
"textures": {
        "particle": "blocks/particle",
        "planks": "blocks/woodpile/woodpile_acacia_planks",
        "log": "blocks/woodpile/woodpile_acacia_log"
},
"elements": [{
    "__comment": "frame1",
    "from": [ 0, 0, 1 ],
    "to": [ 1, 16, 3 ],
    "faces": {
        "down": { "uv": [ 15, 2, 16, 0 ], "texture": "#planks", "cullface": "down" },
        "up": { "uv": [ 0, 0, 1, 2 ], "texture": "#planks", "cullface": "up" },
        "north": { "uv": [ 0, 0, 16, 1 ], "texture": "#planks", "rotation": 90 },
        "south": { "uv": [ 0, 1, 16, 2 ], "texture": "#planks", "rotation": 90 },
        "west": { "uv": [ 0, 2, 16, 0 ], "texture": "#planks", "cullface": "west",
        "rotation": 90 },
        "east": { "uv": [ 0, 0, 16, 2 ], "texture": "#planks", "rotation": 90 }
    }
},
{
    "__comment": "frame2",
    "from": [ 15, 0, 1 ],
    "to": [ 16, 16, 3 ],
    "faces": {
        "down": { "uv": [ 15, 2, 16, 0 ], "texture": "#planks", "cullface": "down" },
        "up": { "uv": [ 0, 0, 1, 2 ], "texture": "#planks", "cullface": "up" },
        "north": { "uv": [ 0, 0, 16, 1 ], "texture": "#planks", "rotation": 90 },
        "south": { "uv": [ 0, 1, 16, 2 ], "texture": "#planks", "rotation": 90 },
        "west": { "uv": [ 0, 2, 16, 0 ], "texture": "#planks", "rotation": 90 },
        "east": { "uv": [ 0, 0, 16, 2 ], "texture": "#planks", "cullface": "east",
        "rotation": 90 }
    }
},
{
    "__comment": "frame3",
    "from": [ 0, 0, 13 ],
    "to": [ 1, 16, 15 ],
    "faces": {
        "down": { "uv": [ 15, 2, 16, 0 ], "texture": "#planks", "cullface": "down",
        "rotation": 180 },
        "up": { "uv": [ 0, 0, 1, 2 ], "texture": "#planks", "cullface": "up",
        "rotation": 180 },
        "north": { "uv": [ 0, 1, 16, 2 ], "texture": "#planks", "rotation": 90 },
        "south": { "uv": [ 0, 0, 16, 1 ], "texture": "#planks", "rotation": 90 },
        "west": { "uv": [ 0, 0, 16, 2 ], "texture": "#planks", "cullface": "west",
        "rotation": 90 },
        "east": { "uv": [ 0, 2, 16, 0 ], "texture": "#planks", "rotation": 90 }
    }
}]
}

Adding the display settings can be done in notepad by adding the display at the top of the document just under the first bracket. Make sure to add a comma after the end of the display bracket or you will get an error.

 

Example of a comma at the ending bracket of display: },

 

Example of a Cubik Studio .json file with the display added for blocks.


{
"display": {
    "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 ]
    },
    "fixed": {
        "rotation": [ 0, 0, 0 ],
        "translation": [ 0, 0, 0],
        "scale":[ 0.5, 0.5, 0.5 ]
    },
    "thirdperson_righthand": {
        "rotation": [ 75, 45, 0 ],
        "translation": [ 0, 2.5, 0],
        "scale": [ 0.375, 0.375, 0.375 ]
    },
    "firstperson_righthand": {
        "rotation": [ 0, 45, 0 ],
        "translation": [ 0, 0, 0 ],
        "scale": [ 0.40, 0.40, 0.40 ]
    },
    "firstperson_lefthand": {
        "rotation": [ 0, 225, 0 ],
        "translation": [ 0, 0, 0 ],
        "scale": [ 0.40, 0.40, 0.40 ]
},
"textures": {
    "particle": "blocks/particle",
    "planks": "blocks/woodpile/woodpile_acacia_planks",
    "log": "blocks/woodpile/woodpile_acacia_log"
},
"elements": [      
    {
    "__comment": "frame1",
    "from": [ 0, 0, 1 ],
    "to": [ 1, 16, 3 ],
    "faces": {
        "down": { "uv": [ 15, 2, 16, 0 ], "texture": "#planks", "cullface": "down" },
        "up": { "uv": [ 0, 0, 1, 2 ], "texture": "#planks", "cullface": "up" },
        "north": { "uv": [ 0, 0, 16, 1 ], "texture": "#planks", "rotation": 90 },
        "south": { "uv": [ 0, 1, 16, 2 ], "texture": "#planks", "rotation": 90 },
        "west": { "uv": [ 0, 2, 16, 0 ], "texture": "#planks", "cullface": "west",
        "rotation": 90 },
        "east": { "uv": [ 0, 0, 16, 2 ], "texture": "#planks", "rotation": 90 }
    }
},
{
    "__comment": "frame2",
    "from": [ 15, 0, 1 ],
    "to": [ 16, 16, 3 ],
    "faces": {
        "down": { "uv": [ 15, 2, 16, 0 ], "texture": "#planks", "cullface": "down" },
        "up": { "uv": [ 0, 0, 1, 2 ], "texture": "#planks", "cullface": "up" },
        "north": { "uv": [ 0, 0, 16, 1 ], "texture": "#planks", "rotation": 90 },
        "south": { "uv": [ 0, 1, 16, 2 ], "texture": "#planks", "rotation": 90 },
        "west": { "uv": [ 0, 2, 16, 0 ], "texture": "#planks", "rotation": 90 },
        "east": { "uv": [ 0, 0, 16, 2 ], "texture": "#planks", "cullface": "east",
        "rotation": 90              
    }
},
{
    "__comment": "frame3",
    "from": [ 0, 0, 13 ],
    "to": [ 1, 16, 15 ],
    "faces": {
        "down": { "uv": [ 15, 2, 16, 0 ], "texture": "#planks", "cullface": "down",
        "rotation": 180 },
        "up": { "uv": [ 0, 0, 1, 2 ], "texture": "#planks", "cullface": "up",
        "rotation": 180 },
        "north": { "uv": [ 0, 1, 16, 2 ], "texture": "#planks", "rotation": 90 },
        "south": { "uv": [ 0, 0, 16, 1 ], "texture": "#planks", "rotation": 90 },
        "west": { "uv": [ 0, 0, 16, 2 ], "texture": "#planks", "cullface": "west",
        "rotation": 90 },
        "east": { "uv": [ 0, 2, 16, 0 ], "texture": "#planks", "rotation": 90 }
    }
}]
}

 

Example of a Cubik Studio .json file with the display added for items.


{
"display": {
    "ground": {
        "rotation": [ 0, 0, 0 ],
        "translation": [ 0, 2, 0],
        "scale":[ 0.5, 0.5, 0.5 ]
    },
    "head": {
        "rotation": [ 0, 180, 0 ],
        "translation": [ 0, 13, 7],
        "scale":[ 1, 1, 1]
    },
    "thirdperson_righthand": {
        "rotation": [ 0, 0, 0 ],
        "translation": [ 0, 3, 1 ],
        "scale": [ 0.55, 0.55, 0.55 ]
    },
    "firstperson_righthand": {
        "rotation": [ 0, -90, 25 ],
        "translation": [ 1.13, 3.2, 1.13],
        "scale": [ 0.68, 0.68, 0.68 ]
    },
    "fixed": {
        "rotation": [ 0, 180, 0 ],
        "scale": [ 1, 1, 1 ]
    }
},
"textures": {
    "particle": "blocks/particle",
    "planks": "blocks/woodpile/woodpile_acacia_planks",
    "log": "blocks/woodpile/woodpile_acacia_log"
},
"elements": [      
    {
    "__comment": "frame1",
    "from": [ 0, 0, 1 ],
    "to": [ 1, 16, 3 ],
    "faces": {
        "down": { "uv": [ 15, 2, 16, 0 ], "texture": "#planks", "cullface": "down" },
        "up": { "uv": [ 0, 0, 1, 2 ], "texture": "#planks", "cullface": "up" },
        "north": { "uv": [ 0, 0, 16, 1 ], "texture": "#planks", "rotation": 90 },
        "south": { "uv": [ 0, 1, 16, 2 ], "texture": "#planks", "rotation": 90 },
        "west": { "uv": [ 0, 2, 16, 0 ], "texture": "#planks", "cullface": "west",
        "rotation": 90 },
        "east": { "uv": [ 0, 0, 16, 2 ], "texture": "#planks", "rotation": 90 }
    }
},
{
    "__comment": "frame2",
    "from": [ 15, 0, 1 ],
    "to": [ 16, 16, 3 ],
    "faces": {
        "down": { "uv": [ 15, 2, 16, 0 ], "texture": "#planks", "cullface": "down" },
        "up": { "uv": [ 0, 0, 1, 2 ], "texture": "#planks", "cullface": "up" },
        "north": { "uv": [ 0, 0, 16, 1 ], "texture": "#planks", "rotation": 90 },
        "south": { "uv": [ 0, 1, 16, 2 ], "texture": "#planks", "rotation": 90 },
        "west": { "uv": [ 0, 2, 16, 0 ], "texture": "#planks", "rotation": 90 },
        "east": { "uv": [ 0, 0, 16, 2 ], "texture": "#planks", "cullface": "east",
        "rotation": 90              
    }
},
{
    "__comment": "frame3",
    "from": [ 0, 0, 13 ],
    "to": [ 1, 16, 15 ],
    "faces": {
        "down": { "uv": [ 15, 2, 16, 0 ], "texture": "#planks", "cullface": "down",
        "rotation": 180 },
        "up": { "uv": [ 0, 0, 1, 2 ], "texture": "#planks", "cullface": "up",
        "rotation": 180 },
        "north": { "uv": [ 0, 1, 16, 2 ], "texture": "#planks", "rotation": 90 },
        "south": { "uv": [ 0, 0, 16, 1 ], "texture": "#planks", "rotation": 90 },
        "west": { "uv": [ 0, 0, 16, 2 ], "texture": "#planks", "cullface": "west",
        "rotation": 90 },
        "east": { "uv": [ 0, 2, 16, 0 ], "texture": "#planks", "rotation": 90 }
    }
}]
}

Hope this tutorial helps. If you have any question let me know in the comments and I will be glad to help.

 

Edited by NorthWestTrees on Tue, 08/06/2019 - 18:41
Last seen on 14:00, 6. Apr 2020
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nice tutorial!
Sun, 08/18/2019 - 09:32

Nice tutorial!