#model usage cases

11 messages · Page 1 of 1 (latest)

mellow pebble
#

is there anywhere i can find all the item model cases (fixed, gui, ground, etc)

queen ibexBOT
#
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.

drifting bane
# mellow pebble is there anywhere i can find all the item model cases (fixed, gui, ground, etc)
Minecraft Wiki

Items models are processor files used by the game to define and select which model to use for rendering items, depending of various criteria such as components, item interactions, their position in the inventory, or numerous other in-game values.
Items models are stored as JSON files in a resource pack in the assets/<namespace>/items folder.
Whi...

mellow pebble
#

i figured out how do use 2 models but i don't know how to do 3

drifting bane
#

!faq gui-model

queen ibexBOT
# drifting bane !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._
drifting bane
# queen ibex

You just put another object entry inside the "cases" array

#
"cases": [
   {
      "when": [...],
      "model": {...}
   },
   {
      "when": [...],
      "model": {...}
   }
]```
#

@mellow pebble

mellow pebble
#

thanks