Skip to content
Sigmund Granaas Sandring edited this page Sep 24, 2024 · 1 revision

Applying custom display overrides

Model transformations can be applied just like they can in normal mc model files. Here is an example of applying custom model transformations on a pickaxe head.

    {
      "name": "pickaxe_head",
      "template": "pickaxe_head.png",
      "type": "GENERATE",
      "palette": "TOOL_MATERIAL",
      "order": 20,
      "display_overrides": {
        "thirdperson_righthand": {
          "rotation": [ 0, 90, -135],
          "translation": [ 0, -4, 2 ],
          "scale": [ 1, 1, 1 ]
        },
        "thirdperson_lefthand": {
          "rotation": [ 0, 90, -135],
          "translation": [ 0, -4, 2 ],
          "scale": [ 1, 1, 1 ]
        },
        "firstperson_righthand": {
          "rotation": [ 0, 90, -135],
          "translation": [ 0, -4, 2 ],
          "scale": [ 1, 1, 1 ]
        },
        "firstperson_lefthand": {
          "rotation": [ 0, 90, -135],
          "translation": [ 0, -4, 2 ],
          "scale": [ 1, 1, 1 ]
        }
      }
    },

This can also be used to apply model transformation given certain predicates. In this case we are creating a model variant which will be used when the predicate is true. In this case, whenever the player is using the item, we will apply model transformation.

 {
      "name": "pickaxe_head",
      "template": "pickaxe_head.png",
      "type": "GENERATE",
      "palette": "TOOL_MATERIAL",
      "order": 20,
      "variants": [
        {
          "target":[
            {
              "type": "minecraft:entity",
              "flag": {
                "is_using": true
              }
            }
          ],
          "display_overrides": {
            "thirdperson_righthand": {
              "rotation": [ 0, 90, -135],
              "translation": [ 0, -4, 2 ],
              "scale": [ 1, 1, 1 ]
            },
            "thirdperson_lefthand": {
              "rotation": [ 0, 90, -135],
              "translation": [ 0, -4, 2 ],
              "scale": [ 1, 1, 1 ]
            },
            "firstperson_righthand": {
              "rotation": [ 0, 90, -135],
              "translation": [ 0, -4, 2 ],
              "scale": [ 1, 1, 1 ]
            },
            "firstperson_lefthand": {
              "rotation": [ 0, 90, -135],
              "translation": [ 0, -4, 2 ],
              "scale": [ 1, 1, 1 ]
            }
          }
        }
      ]
    },

This is the result when adding a throwable handler to the pickaxe head and using the item: image

Clone this wiki locally