本站文本内容除另有声明外,均在知识共享 署名-非商业性使用-相同方式共享 3.0 协议下提供。(详细信息…

模型

来自Minecraft Wiki
(重定向自方块模型
跳转至: 导航搜索
此页面的(部分)内容需要被翻译。
你可以帮助我们来翻译此页面

方块模型 用作描述游戏里的所有方块,而 物品模型 用作显示物品在玩家手上、头上(头盔和帽子)、地上、物品栏里、物品展示框中和盔甲架上。 因为某些方块有不同的变种, 方块状态 用作连接对应的模型。每个模型和方块状态拥有各自的 .json 格式文件。用在物品栏的图标也在这些文件中定义。

方块状态[编辑 | 编辑源代码]

某些方块拥有不同的变种(例如可以开关的),因此每个方块有各自的方块状态文件来列出所有存在的变种并连接到对应的模型。方块也可以在同一时间由不同叫“multipart”的模型组合。这些模型会根据方块的状态来被使用。 这些文件储存在assets/minecraft/blockstates 中。这些文件会根据名称来直接使用, 因此一个方块的状态文件不会影响另一个方块


  • 根标签

    •  variants:变种列表

      •  apply:决定了模型的应用及其属性。可以拥有单一模型或者模型数组以及它的属性。如果被设置为数组,将通过给出的选项随机选择一个模型,每个选项都被指定了不同的
        标签。

        •  A model: 包含模型的属性,如果不止一个模型用于相同的变种。替代所有在游戏中指定的模型。

          •  model:指定模型文件的路径,默认为assets/minecraft/models/block

          •  x:模型在x轴上的旋转90度的增量。

          •  y:模型在y轴上的旋转90度的增量。

          •  uvlock:可为truefalse(默认)。设置为true将锁定方块贴图的旋转。这样贴图将不会在使用上面的
             x
             y标签下跟着方块旋转。

          •  weight:设置模型被使用在游戏中的几率,默认为1(=100%)。如果多于一个模型被用作同一个变种,每个模型的几率将会为每个模型的weight的总和除以对应模型的weight。

        •  model:指定模型文件的路径,默认为assets/minecraft/models/block

        •  x:模型在x轴上的旋转90度的增量。

        •  y:模型在y轴上的旋转90度的增量。

        •  uvlock:可为truefalse(默认)。设置为true将锁定方块贴图的旋转。这样贴图将不会在使用上面的
           x
           y标签下跟着方块旋转。

    •  multipart:取代了
       variants,基于方块状态属性以来组合模型。

      •  A case确定一种情况,并决定应用在这种情况下的模型。

        •  when:为了使模型被应用而必须满足的情况的列表。当未设置时,模型总是应用的。

          •  OR:如果该标签包含了的情况中的任意一个情况返回true时匹配。不能同时设定其他情况。

            •  A condition当方块必须匹配为返回true时的情况列表。

              •  A case在单一情况下方块匹需配的方块状态。它可以设为一个列表,由|来分隔,以便允许多个值匹配。

          •  A case在单一情况下方块匹需配的方块状态。它可以设为一个列表,由|来分隔,以便允许多个值匹配。不能和
             OR标签同时设定。

        •  apply:决定了模型的应用及其属性。可以拥有单一模型或者模型数组以及它的属性。如果被设置为数组,将通过给出的选项随机选择一个模型,每个选项都被指定了不同的
          标签。

          •  A model:包含模型的属性,如果不止一个模型用于同一个变种。替代所有在游戏中指定的模型。

            •  model:指定模型文件的路径,默认为assets/minecraft/models/block

            •  x:模型在x轴上的旋转90度的增量。

            •  y:模型在y轴上的旋转90度的增量。

            •  uvlock:可为truefalse(默认)。如果设置为true,方块贴图的旋转将被锁定。这样,贴图将不会在使用
               x
               y标签的方块上旋转。

            •  weight:设置模型被使用在游戏中的几率,默认为1(=100%)。如果多于一个模型被用作同一个变种,每个模型被使用的的几率为每个模型的weight的总和除以对应模型的weight。

          •  model:指定模型文件的路径,默认为assets/minecraft/models/block

          •  x:模型在x轴上的旋转90度的增量。

          •  y:模型在y轴上的旋转90度的增量。

          •  uvlock:可为truefalse(默认)。设置为true将锁定方块贴图的旋转。这样贴图将不会在使用上面的
             x
             y标签下跟着方块旋转。
"uvlock": true "uvlock": false
Uvlock true.png Uvlock false.png

示例:火把[编辑 | 编辑源代码]

火把有若干个变种: 它能被插在地上或墙上,而在墙上时火把还能朝向四个不同方向。以下这个示例取自文件 torch.json,你能在assets/minecraft/blockstates路径下找到该文件。

File: torch.json

{
    "variants": {
        "facing=up": { "model": "normal_torch" },
        "facing=east": { "model": "normal_torch_wall" },
        "facing=south": { "model": "normal_torch_wall", "y": 90 },
        "facing=west": { "model": "normal_torch_wall", "y": 180 },
        "facing=north": { "model": "normal_torch_wall", "y": 270 }
    }
}

"facing=up" 指的是火把立在地上的那个变种,该变种连接到与它对应的模型 "normal_torch"。而火把又能被插在方块的四个侧面上,所以自然又需要四个不同的变种,每个侧面都得有一个变种。这四个变种分别叫作"facing=east""facing=west""facing=south" 以及 "facing=north".。四个变种的模型都用的是 "normal_torch_wall" , 但这个模型因 "y" 设置的数值而在y轴方向上旋转了几个90度,这样被插在不同侧面上的火把看起来才都十分协调。

示例:草方块[编辑 | 编辑源代码]

草方块有两个变种,第一个变种有四个不同的模型。以下这个示例取自文件 grass.json,你能在 assets/minecraft/blockstates路径下找到该文件。

File: grass.json

{
    "variants": {
        "snowy=false": [
            { "model": "grass_normal" },
            { "model": "grass_normal", "y": 90 },
            { "model": "grass_normal", "y": 180 },
            { "model": "grass_normal", "y": 270 }
        ],
        "snowy=true":  { "model": "grass_snowed" }
    }
}

不被雪所覆盖的草方块 ("snowy=false") 拥有四个模型, 这四个模型都使用的是同一个方块模型,但模型被旋转了几个90度。因为有四个模型而其中任何一个都没用上 weight标签,所以在你放置一个(无雪的)草方块的时候,每个模型都有25%的几率被使用,也就是说这个草方块朝向东南西北任何一个方向都有可能。

示例:橡木栅栏[编辑 | 编辑源代码]

橡木栅栏使用了 multipart 这个格式.。以下这个示例取自 assets/minecraft/blockstates路径下的文件 fence.json

{
    "multipart": [
        {   "apply": { "model": "oak_fence_post" }},
        {   "when": { "north": "true" },
            "apply": { "model": "oak_fence_side", "uvlock": true }
        },
        {   "when": { "east": "true" },
            "apply": { "model": "oak_fence_side", "y": 90, "uvlock": true }
        },
        {   "when": { "south": "true" },
            "apply": { "model": "oak_fence_side", "y": 180, "uvlock": true }
        },
        {   "when": { "west": "true" },
            "apply": { "model": "oak_fence_side", "y": 270, "uvlock": true }
        }
    ]
}

第一个模型,栅栏桩(the fence post),是一直使用着的,而其他模型只在某些情况下使用。栅栏边( the sides of the fence)只有在其他方块与该栅栏相邻时才出现 。 可栅栏边是有朝向的,于是栅栏边的模型就被旋转了几个90度来用,这样的话所需的模型数量就能减至两个了,一个是栅栏桩,一个是栅栏边。与在1.8中用到的5个模型、16个变种相比,这算是个相当大的改进了。

示例:红石线[编辑 | 编辑源代码]

红石线模型也使用了 multipart这个格式。以下这个示例取自 assets/minecraft/blockstates路径下的文件 redstone_wire.json

{
    "multipart": [
        {   "when": { "OR": [
                {"north": "none", "east": "none", "south": "none", "west": "none"},
                {"north": "side|up", "east": "side|up" },
                {"east": "side|up", "south": "side|up" },
                {"south": "side|up", "west": "side|up"},
                {"west": "side|up", "north": "side|up"}
            ]},
            "apply": { "model": "redstone_dot" }
        },
        {   "when": { "OR": [
                { "north": "side|up" },
                { "north": "none", "east": "none", "south": "side|up", "west": "none" }
            ]},
            "apply": { "model": "redstone_side0" }
        },
        {   "when": { "OR": [
                { "south": "side|up" },
                { "north": "side|up", "east": "none", "south": "none", "west": "none" }
            ]},
            "apply": { "model": "redstone_side_alt0" }
        },
        {   "when": { "OR": [
                { "east": "side|up" },
                { "north": "none", "east": "none", "south": "none", "west": "side|up" }
            ]},
            "apply": { "model": "redstone_side_alt1", "y": 270 }
        },
        {   "when": { "OR": [
                { "west": "side|up" },
                { "north": "none", "east": "side|up", "south": "none", "west": "none" }
            ]},
            "apply": { "model": "redstone_side1", "y": 270 }
        },
        {   "when": { "north": "up" },
            "apply": { "model": "redstone_up" }
        },
        {   "when": { "east": "up" },
            "apply": { "model": "redstone_up", "y": 90 }
        },
        {   "when": { "south": "up" },
            "apply": { "model": "redstone_up", "y": 180 }
        },
        {   "when": { "west": "up" },
            "apply": { "model": "redstone_up", "y": 270 }
        }
    ]
}

This model is dynamically created. With the first condition, it is determining cases where the redstone_dot model should be added, which requires either all of the four sides being set to "none", or any two sides which form a corner both being set either to up or side.

The last case only tests one condition, which asks if "west" is set to "up", and if so it applies the model redstone_up.

方块模型[编辑 | 编辑源代码]

The folder assets/minecraft/models/block holds the model files for all the specified variants. The names of the files can be changed, but must always correspond with the names used in the variant files.


  • The root tag

    •  parent: Loads a different model from the given path, starting in assets/minecraft/models. If both "parent" and "elements" are set, the "elements" tag overrides the "elements" tag from the previous model.
      • Can be set to "builtin/generated" to use a model that is created out of the specified icon. Note that only the first layer is supported, and rotation can only be achieved using block states files.

    •  ambientocclusion: Whether to use ambient occlusion (true - default), or not (false).

    •  display: Holds the different places where item models are displayed.

      •  thirdperson_righthand, thirdperson_lefthand, firstperson_righthand, firstperson_lefthand, gui, head, ground, or fixed: Place where an item model is displayed. Holds its rotation, translation and scale for the specified situation. fixed refers to item frames, while the rest are as their name states. Note that translations are applied to the model before rotations.

        •  rotation: Specifies the rotation of the model according to the scheme [x, y, z].

        •  translation: Specifies the position of the model according to the scheme [x, y, z]. If the value is greater than 80, it is displayed as 80. If the value is less then -80, it is displayed as -80.

        •  scale: Specifies the scale of the model according to the scheme [x, y, z]. If the value is greater than 4, it is displayed as 4.

    •  textures: Holds the textures of the model. Each texture starts in assets/minecraft/textures or can be another texture variable.

      •  particle: What texture to load particles from. This texture is used if you are in a nether portal. Note: All breaking particles from non-model blocks are hard-coded.

      •  A texture variable: Defines a texture variable and assigns a texture.

    •  elements: Contains all the elements of the model. they can only have cubic forms. Cannot be set along side "parent".

      •  An element

        •  from: Start point of a cube according to the scheme [x, y, z]. Values must be between -16 and 32.

        •  to: Stop point of a cube according to the scheme [x, y, z]. Values must be between -16 and 32.

        •  rotation: Defines the rotation of an element.

          •  origin: Sets the center of the rotation according to the scheme [x, y, z], defaults to [8, 8, 8].

          •  axis: Specifies the direction of rotation, can be "x", "y" or "z".

          •  angle: Specifies the angle of rotation. Can be 45 through -45 degrees in 22.5 degree increments. Defaults to 0.

          •  rescale: Specifies whether or not to scale the faces across the whole block. Can be true or false. Defaults to false.

        •  shade: Defines if shadows are rendered (true - default), not (false).

        •  faces: Holds all the faces of the cube. If a face is left out, it will not be rendered.

          •  down, up, north, south, west or east: Contains the properties of the specified face.

            •  uv: Defines the area of the texture to use according to the scheme [x1, y1, x2, y2]. If unset, it defaults to values equal to xyz position of the element. The texture behavior will be inconsistent if UV extends below 0 or above 16. If the numbers of x1 and x2 are swapped (e.g. from 0, 0, 16, 16 to 16, 0, 0, 16), the texture will be flipped. UV is optional, and if not supplied it will automatically generate based on the element's position.

            •  texture: Specifies the texture in form of the texture variable prepended with a #.

            •  cullface: Specifies whether a face does not need to be rendered when there is a block touching it in the specified position. The position can be: down, up, north, south, west, or east. It will also determine which side of the block to use the light level from for lighting the face, and if unset, defaults to the side.

            •  rotation: Rotates the texture by the specified number of degrees. Can be 0, 90, 180, or 270. Defaults to 0. Rotation does not affect which part of the texture is used. Instead, it amounts to permutation of the selected texture vertexes (selected implicitly, or explicitly though uv).

            •  tintindex: Determines whether to tint the texture using a hardcoded tint index. The default is not using the tint, and any number causes it to use tint. Note that only certain blocks have a tint index, all others will be unaffected.

Example: Standing Torch[编辑 | 编辑源代码]

For simplicity, this example only describes the standing torch, which is defined in the files torch.json and normal_torch.json stored in the folder assets/minecraft/models/block.

File: torch.json

{
    "ambientocclusion": false,
    "textures": {
        "particle": "#torch"
    },
    "elements": [
        {   "from": [ 7, 0, 7 ],
            "to": [ 9, 10, 9 ],
            "shade": false,
            "faces": {
                "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#torch" },
                "up":   { "uv": [ 7,  6, 9,  8 ], "texture": "#torch" }
            }
        },
        {   "from": [ 7, 0, 0 ],
            "to": [ 9, 16, 16 ],
            "shade": false,
            "faces": {
                "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" },
                "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }
            }
        },
        {   "from": [ 0, 0, 7 ],
            "to": [ 16, 16, 9 ],
            "shade": false,
            "faces": {
                "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" },
                "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }
            }
        }
    ]
}

This file is used to create the model of the torch, which is used for the normal and the redstone torch. Therefore the "elements" tag is used to create three elements or cubes. Only two faces of each cube are rendered, as only two faces of each one have been specified. "uv" is used to determine the area where the texture is used. The texture variable "#torch" is used for the particles and the cubes and has not yet been defined.

File: normal_torch.json

{
    "parent": "block/torch",
    "textures": {
        "torch": "blocks/torch_on"
    }
}

This file represents the model of the normal standing torch. It loads the model of previously defined standing torch with the help of "parent" and inherits all the properties of the file torch.json. As this file is only used for the normal torch, the texture can now be specified. The texture"torch_on" is now assigned to the texture variable "torch" (without #) and will therefore be used for the previously loaded model and its particles, as specified in the other file.

Example: Any Block[编辑 | 编辑源代码]

This example describes the fundamental structure of most normal blocks in Minecraft. All these blocks use the same basic model and only apply their texture to it, as already described in the example above. This model is defined in the file cube.json which can be found in the folder assets/minecraft/models/block.

File: cube.json

{
    "elements": [
        {   "from": [ 0, 0, 0 ],
            "to": [ 16, 16, 16 ],
            "faces": {
                "down":  { "texture": "#down", "cullface": "down" },
                "up":    { "texture": "#up", "cullface": "up" },
                "north": { "texture": "#north", "cullface": "north" },
                "south": { "texture": "#south", "cullface": "south" },
                "west":  { "texture": "#west", "cullface": "west" },
                "east":  { "texture": "#east", "cullface": "east" }
            }
        }
    ]
}

Features, that have already been described above will not be mentioned again. The use of "cullface": "down" prevents the bottom face of the block from being rendered, if there is another adjacent block underneath it. The same applies to all the other faces of the block.

Example: Sapling[编辑 | 编辑源代码]

This example describes the fundamental structure used by all saplings, without assigning a specific texture. The model is specified in cross.json, the texture would e.g. be assigned in oak_sapling.json. Both files are stored in the folder assets/minecraft/models/block.

File: cross.json

{
    "ambientocclusion": false,
    "textures": {
        "particle": "#cross"
    },
    "elements": [
        {   "from": [ 0.8, 0, 8 ],
            "to": [ 15.2, 16, 8 ],
            "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true },
            "shade": false,
            "faces": {
                "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" },
                "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" }
            }
        },
        {   "from": [ 8, 0, 0.8 ],
            "to": [ 8, 16, 15.2 ],
            "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true },
            "shade": false,
            "faces": {
                "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" },
                "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" }
            }
        }
    ]
}

To create the usual shape of the saplings, both elements are being rotated by 45 degrees. Therefor the origin and the axis of rotation are set to the specified values, the angle is set to 45 degrees and "rescale" is set to true. The latter causes the model to be scaled on the axes it has not been rotated on, so that it takes up the same space as it did before rotating it (see comparison images).

"rescale": true "rescale": false
Block model rescale true.png Block model rescale false.png

物品模型[编辑 | 编辑源代码]

As items do not have different variants, there is no need to specify them. The folder assets/minecraft/models/item contains all the model files. The names of the files are hardcoded and should not be changed.

  • The root tag

    •  parent: Loads a different model from the given path, starting in assets/minecraft/models. If both "parent" and "elements" are set, the "elements" tag overrides the "elements" tag from the previous model.
      • Can be set to "builtin/generated" to use a model that is created out of the specified icon.
      • Can be set to "builtin/entity" to load a model from an entity file. As you can not specify the entity, this does not work for all items (only for chests, ender chests, mob heads and banners).
      • Needs to be set to "builtin/compass" or "builtin/clock" for the compass and the clock.

    •  textures: Holds the textures of the model. Each texture starts in assets/minecraft/textures or can be another texture variable.

      •  layer#: Only used to specify the icon of the item used in the inventory. There can be more than just one layer (e.g. for spawn eggs), but the amount of possible layers is hardcoded for each item. Only works in combination with "builtin/generated".

      •  particle: What texture to load particles from. Used to determine the "crumb" particles generated by food items, as well as to determine the barrier particle (but it always uses items/barrier.png as blockbreaking particle), which otherwise will use "layer0".

      •  A texture variable: Defines a texture variable and assigns it a texture.

    •  elements: Contains all the elements of the model. They can only have cubic forms. Cannot be set along side "parent".

      •  An element

        •  from: Start point of a cube according to the scheme [x, y, z]. Values must be between -16 and 32.

        •  to: Stop point of a cube according to the scheme [x, y, z]. Values must be between -16 and 32.

        •  rotation: Defines the rotation of an element.

          •  origin: Sets the center of the rotation according to the scheme [x, y, z], defaults to [8, 8, 8].

          •  axis: Specifies the direction of rotation, can be "x", "y" or "z".

          •  angle: Specifies the angle of rotation. Can be 45 through -45 degrees in 22.5 degree increments. Defaults to 0.

        •  faces: Holds all the faces of the cube. If a face is left out, it will not be rendered.

          •  down, up, north, south, west or east: Contains the properties of the specified face.

            •  uv: Defines the area of the texture to use according to the scheme [x1, y1, x2, y2]. If unset, it defaults to values equal to xyz position of the element. The texture behavior will be inconsistent if UV extends below 0 or above 16. If the x or y number are swapped, the texture will be flipped in that direction. UV is optional, and if not supplied it will automatically generate based on the element's position.

            •  texture: Specifies the texture in form of the texture variable prepended with a #.

            •  cullface: Specifies whether a face does not need to be rendered when there is a block touching it in the specified position. The position can be: down, up, north, south, west, or east. It will also determine which side of the block to use the light level from for lighting the face, and if unset, defaults to the side.

            •  rotation: Rotates the texture in increments of 90 degrees.

            •  tintindex: Determines whether to tint the texture using a hardcoded tint index. The default is not using the tint, and any number causes it to use tint (except for spawn eggs, where 0 causes it to use the first color, and 1 causes it to use the second color). Note that only certain items or certain layers of items (e.g. potions) have a tint index, all others will be unaffected.

    •  display: Holds the different places where item models are displayed.

      •  thirdperson_righthand, thirdperson_lefthand, firstperson_righthand, firstperson_lefthand, gui, head, ground, or fixed: Place where an item model is displayed. Holds its rotation, translation and scale for the specified situation. fixed refers to item frames, while the rest are as their name states.

        •  rotation: Specifies the rotation of the model according to the scheme [x, y, z].

        •  translation: Specifies the position of the model according to the scheme [x, y, z]. If the value is greater than 80, it is displayed as 80. If the value is less then -80, it is displayed as -80.

        •  scale: Specifies the scale of the model according to the scheme [x, y, z]. If the value is greater than 4, it is displayed as 4.

    •  overrides: Determines cases which a different model should be used based on item tags.

      •  a case A single case.

        •  predicate: Holds the cases.

          •  a case A single case tag. See item tags for a full list of available tags.

        •  model: The path to the model to use if the case is met, starting in assets/minecraft/models/

物品标签[编辑 | 编辑源代码]

Some items support additional tags for model overrides. Below is a full list of available tags.

  • "angle": Used on compasses to determine the current angle, expressed in a decimal value of less than one.
  • "blocking": Used on shields to determine if currently blocking. If 1, the player is blocking.
  • "broken": Used on Elytra to determine if broken. If 1, the Elytra is broken.
  • "cast": Used on fishing rods to determine if the fishing rod has been cast. If 1, the fishing rod has been cast.
  • "cooldown": Used on ender pearls and chorus fruit to determine the remaining cooldown, expressed in a decimal value between 0 and 1.
  • "damage": Used on items with durability to determine the amount of damage, expressed in a decimal value between 0 and 1.
  • "damaged": Used on items with durability to determine if it is damaged. If 1, the item is damaged. Note that if an item has the unbreakable tag, this may be 0 while the item has a non-zero "damage" tag.
  • "lefthanded": Determines the model used by left handed players. It will affect the item they see in inventories, along with the item players see them holding or wearing.
  • "pull": Determines the amount a bow has been pulled, expressed in a decimal value of less than one.
  • "pulling": Used on bows to determine if the bow is being pulled. If 1, the bow is currently being pulled.
  • "time": Used on clocks to determine the current time, expressed in a decimal value of less than one.

Example: Torch[编辑 | 编辑源代码]

This example describes the torch as an item. The model can be found in the torch.json, which is stored in the folder assets/minecraft/models/item.

File: torch.json

{
    "parent": "builtin/generated",
    "textures": {
        "layer0": "blocks/torch_on"
    },
    "display": {
        "thirdperson": {
            "rotation": [ -90, 0, 0 ],
            "translation": [ 0, 1, -3 ],
            "scale": [ 0.55, 0.55, 0.55 ]
        },
        "firstperson": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }
}

The "parent"-tag uses "builtin/generated", so that game uses the standard model of the torch, which has been generated out of the 2D graphic used for the item icon. The icon is specified with the "layer0"-tag and the texture, that has already been used for the block model, is used for the icon as well. As there is just one layer hard coded for the torch, there cannot be any more layers added. Furthermore, the display properties for the torch are specified, so that it will be displayed correctly in every possible situation. The torch cannot be placed on a players head and uses the specified icon in the inventory, so there is no need to adjust the model for these situations. To line the model up with the players hand in first and third person view, the model needs to be rotated, moved and scaled, which is done for each of the two situation separately.

例子:钓鱼杆[编辑 | 编辑源代码]

此处以1.9钓鱼竿为例。 The model can be found in the fishing_rod.json, which is stored in the folder assets/minecraft/models/item.

{
    "parent": "item/handheld_rod",
    "textures": {
        "layer0": "items/fishing_rod_uncast"
    },
    "overrides": [
        {
            "predicate": {
                "cast": 1
            },
            "model": "item/fishing_rod_cast"
        }
    ]
}

In this model, the normal model is overridden if the fishing rod is cast, causing it to instead display the model "item/fishing_rod_cast"

History[编辑 | 编辑源代码]

正式版本
1.7.2 13w36a Flowers are now discentered like tall grass.
1.8 14w06a Added custom block models.
14w07a Rewrote the model format. Instead of having just "planes", it now has "planes" and "cubes". The rotation of objects was also limited to one directional rotation per object in increments of 22.5 degrees.
14w11a Lighting on solid block no longer makes inner sections completely black.
14w11b Generic blocks now load models instead of pre-defined shapes.
April 12, 2014 TheMogMiner posts about upcoming changes to the model format.
14w17a Converted most of the remaining static blocks to the model format.
Added "rotateVariantTextures" to preserve uv details through rotation.
14w25a Removed the directional attribute from the uv definition and replaced it with explicit texture references. "textureFacing" was replaced with "texture" parameter which is prepended with the hash symbol (#).
"useAmbientOcclusion" renamed to "ambientocclusion"
"rotateVariantTextures" renamed to "UV lock"
"cull" renamed to "cullface", specifies the opposite of which neighboring face causes culling to occur
Rotation made more verbose, it is now more clear that it can only occur on a single axis. Example, the rotation for one of the two faces of the "cross" model is now: "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true },
The folder models/blocks/meshes was removed and model files are now stored in models/block.
The folder blockstates was added and stores the model selection files previously found in models/block.
The model format now supports custom item models.
14w27a Replaced block state names with data which better reflects the internal data. Does not yet reflect all data for some blocks. Will switch to using the actual stored data in a future version when numerical data values are completely dropped in favor of block states.
14w27b The block state files now support an array of models allowing for random models.
14w30a Added the item model "builtin/entity".
1.8.2 pre5 The tag "translation" is now limited to the range of -24 to 24.
The tag "scale" is now limited to 4 or less.
1.9 15w31a UV is now optional, and if not supplied it will automatically generate based on the element's position.
Different models/textures for different damage values, item states, and whether the player is left handed. This works on compasses, clocks, and anything that can have a durability bar. It also contains additional tags for bows and fishing rods.
Models can be put together based on block state attributes, such as fences. As a result, the vanilla set of block models was reduced by almost 300 models.
Block model JSON is now strict, comments and quoteless identifiers are not allowed.
"display" tag defaults have changed, and the "thirdperson" and "firstperson" tags were replaced with "thirdperson_righthand", "thirdperson_lefthand", "firstperson_righthand", and "firstperson_lefthand".
"parent" and "elements" tags can coexist now, though the top level elements tag overwrites all former ones.
Removed the option to disable alternate block models.