How do I flip the held item texture but not the inventory one?

Started by CtrlFnAlt on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I flip the held item texture but not the inventory one?

I created a texture for this custom sword with the top and bottom being different, but when I went to try it out, the inventory texture was fine but its held item texture was upside down, does anyone know how to fix this?

Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can anyone help me pls?  
Thu, 03/20/2025 - 17:10

Can anyone help me pls?

 

Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you send an image of the…
Thu, 03/20/2025 - 17:31

Can you send an image of the texture? This sounds odd.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You will need to edit the …
Thu, 03/20/2025 - 17:32

You will need to edit the .json display code of the item and replace it with the following:

{
  "parent": "item/handheld",
  "textures": {
    "layer0": "modid:item/item_texture"
  },
  "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": [ 90, -90, 130 ],
          "translation": [ 0, 0, 0 ],
          "scale": [ 1, 1, 1 ]
      },
      "thirdperson_lefthand": {
          "rotation": [ 90, 90, -130 ],
          "translation": [ 0, 0, 0 ],
          "scale": [ 1, 1, 1 ]
      },
      "firstperson_righthand": {
          "rotation": [ 90, -90, 130 ],
          "translation": [ 0, 0, 0 ],
          "scale": [ 1, 1, 1 ]
      },
      "firstperson_lefthand": {
          "rotation": [ 90, 90, -130 ],
          "translation": [ 0, 0, 0 ],
          "scale": [ 1, 1, 1 ]
      }
  }
}

You will then need to replace modid with your mod's id, and item_texture with the internal name of your item's texture file.

Lastly, you will need to edit the rotation values, and possibly the middle translation values, of thirdperson_righthand, thirdperson_lefthand, firstperson_righthand, and firstperson_lefthand.

I'm not sure what exact values you will need, but you should be able to experiment with the provided code to figure it out.

Lastly, be sure to save and lock your code.

Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Which number rotated in…
Thu, 03/20/2025 - 19:38

Which number rotated in which direction?

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know that they correspond…
Thu, 03/20/2025 - 20:47

I know that they correspond to X, Y, Z rotations, but I can't remember exactly where each axis is located in terms of built-in item model rotations. As I mentioned in my previous comment, I would just recommend experimenting, maybe create three copies of the item and have each copy rotated 90 degrees on a different axis to find out what axis does what.