#2D texture in gui but 3D in hand (like a trident)

22 messages · Page 1 of 1 (latest)

primal pewter
#

Hello! I made a frog hat in my ressource pack that use cit to transform the carved pumpkin into the hat when renamed "Cold Frog". When you put it like a normal block it's a carved pumpkin but if you place it on your head the model stay and that's what I want BUT i want also the hat to have a 2D texture in my inventory and not the 3D one. I know that this is possible since 1.21.4 with the display context thing but I have no clue on how to do it... Thanks 🐸

mint etherBOT
#
Welcome to the help forum!

Please make sure to read #1029373817119838218 as it may answer your question!

Once your question has been resolved, please mark the post as closed by using the </close:1163944441741049897> command.

slim goblet
#

!faq gui model

mint etherBOT
# slim goblet !faq gui model
FAQ
Java: Java Gui Model

Disclaimer: This will only work for 1.21.4 and newer. For older versions you will need to use mods or shader workarounds to do this.

To have a different model in the gui than in the hand (or other displays) you do the following

  1. Create a new .json file in assets/minecraft/items (not to be confused with models/item!)
  2. Make a .json file in there that looks something like this:
  {   
    "model": {
     "type": "minecraft:select",
     "property": "minecraft:display_context",
     "cases": [
       {
         "when": [
           "gui",
           "ground",
           "fixed"
         ],
         "model": {
           "type": "minecraft:model",
           "model": "minecraft:item/2d"
         }
       }
     ],
     "fallback": {
       "type": "minecraft:model",
       "model": "item/3d"
     }
   }
 }```
3. Name the .json the same as the id of the item you want to do this for (unless you are using this in combination with the item_model= component). 
4. Replace `item/2d` and `item/3d` with the repsective model references to the 3D and 2D model. Your "2D model" can be just something like this 
```json
{
   "parent": "item/generated",
   "textures": {
     "layer0": "item/feather"
   }
}``` (replace item/feather with your actual texture)

_Note: The bot example basically works the same as a trident. If you want the 2D model to appear in more/less displays adjust the  values in the "when" array accordingly._
slim goblet
#

In 1.21.5+ you can make the renaming work in vanilla without the use of Optifine CIT

#

in 1.21.4 I'm not sure how it would work

primal pewter
#

so i want to let the cit for the hat

#

and just slightly modify for 1.21.4+

slim goblet
#

yeah I think if you use the Optifine CIT method then that won't be compatible with the vanilla method for the GUI model
at least I can't imagine how that could work

#

so in 1.21.4 it will probably have to be just CIT but in 1.21.5+ you can implement the vanilla method

primal pewter
slim goblet
#

If you put both methods in your pack and use pack overlays then you can probably make it work in all game versions
with older ones requiring Optifine/CITResewn

primal pewter
#

what's a pack overlay?

slim goblet
#

It's like a part of the pack that is only used in certain game versions

#

If you want to do that then I can show you how that all works

primal pewter
#

yeah that would be pretty nice

#

because i found nothing on internet about that

slim goblet
#

yeah it's a newer feature

#

maybe we can wait tho because I'm a bit busy right now sorry