Help with item scaling via .json

Started by Churro on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with item scaling via .json
Wed, 05/07/2025 - 07:41 (edited)

(1.21.4)
I am trying to make some swords that are larger than the 16x16 grid. I have done this before, but I can't get it to work on the latest version.

In a previous mod, I used this in the .json:

{
  "parent": "item/handheld",
  "textures": {
    "layer0": "scythes:item/stonescythetex"
  },
    "display": {
        "ground": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 0, 3, 0],
            "scale":[ 1, 1, 1 ]
        },
        "fixed": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 0, 0, 0],
            "scale":[ 1, 1, 1 ]
        },
        "thirdperson_righthand": {
            "rotation": [ 0, 90, 40 ],
            "translation": [ 0, 9, 2 ],
            "scale": [ 1.5, 1.5, 1.5 ]
        },
        "thirdperson_lefthand": {
            "rotation": [ 0, -90, -40 ],
            "translation": [ 0, 9, 2 ],
            "scale": [ 1.5, 1.5, 1.5 ]
        },
        "firstperson_righthand": {
            "rotation": [ 0, 90, 40 ],
            "translation": [ 0, 9, 2 ],
            "scale": [ 1.5, 1.5, 1.5 ]
        },
        "firstperson_lefthand": {
            "rotation": [ 0, -90, -40 ],
            "translation": [ 0, 9, 2 ],
            "scale": [ 1.5, 1.5, 1.5 ]
        }
    }
}

Which worked perfectly fine, so I moved this over into my new mod and changed the necessary details:

{
  "parent": "item/handheld",
  "textures": {
    "layer0": "ruined_world:item/ruinsgreatsword"
  },
    "display": {
        "ground": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 0, 0, 0],
            "scale":[ 1, 1, 1 ]
        },
        "fixed": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 0, 0, 0],
            "scale":[ 1, 1, 1 ]
        },
        "thirdperson_righthand": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 0, 5, 0 ],
            "scale": [ 2, 2, 2 ]
        },
        "thirdperson_lefthand": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 0, 5, 0 ],
            "scale": [ 2, 2, 2 ]
        },
        "firstperson_righthand": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 0, 5, 0 ],
            "scale": [ 2, 2, 2 ]
        },
        "firstperson_lefthand": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 0, 5, 0 ],
            "scale": [ 2, 2, 2 ]
        }
    }
}

This ends up with a black and pink missing texture.
However, if i use:

  "model": {
    "type": "minecraft:model",
    "model": "ruined_world:item/ruinsgreatsword"

Instead of:

  "parent": "item/handheld",
  "textures": {
    "layer0": "ruined_world:item/ruinsgreatsword"

The correct texture applies, but the rotation/translation/scale changes do not work.
Another thing to add is that "ruined_world:item/ruinsgreatsword" is the item itself, whereas "scythes:item/stonescythetex" is the texture of the item, but if i use the texture name instead of the item name for my new mod, it still ends up with a missing texture.
I am aware that another way to do this is Blockbench, but I haven't been able to install it properly and would prefer to do it this way. Any help?

Edited by Churro on Wed, 05/07/2025 - 07:41
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I ran into this really…
Wed, 05/07/2025 - 12:50

I ran into this really recently with a mod that I was making. There are two itemname.json files, one of them handles the item texture side of the model, and the other handles the core part of the model. When you go to edit the code, there seems to be no consistency about which one is on top. I found that the one that handles the item texture starts as {
  "parent": "item/handheld",
  "textures": {
    "layer0": "modid:item/texture_id"
  }
}

And the one that handles the model core starts as {
  "model": {
    "type": "minecraft:model",
    "model": "modif:item/texture_id"
  }
}

From what I can tell, you are trying to replace the wrong one, which results in the purple and black cube. Try replacing the other .json file for the item, that should work.

Also, you will want to use the texture name, rather than the item name, just make sure that you are editing the correct .json file. But from what I can tell, what you have written should work, so long as it is put in the correct file.

Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thankyou! this worked…
Wed, 05/07/2025 - 15:32

thankyou! this worked perfectly

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm glad I was able to help
Wed, 05/07/2025 - 16:01

I'm glad I was able to help