首页 > 解决方案 > Minecraft 的 3D 块模型作为项目工作,但在放置时变为空块(Minecraft Modding 1.16.5)

问题描述

我有一个类似于头骨的 3d 模型块。它将模型呈现为一个项目,但是当我放置它时,它变成了一个空块。

该物品可用作模型并在我的库存中,但似乎不能用作块。

最初它是一件盔甲,但我找不到任何教我如何制作 3D 盔甲的东西。所以现在它是一个可穿戴的块。我还没有实现可穿戴功能。因此,需要任何帮助来制作像头骨一样的积木。

这是我的块模型代码:

{
"credit": "Made with Blockbench",
"parent": "beeutil:block/bee_helmet",
"ambientocclusion": false,
"texture_size": [32, 32],
"textures": {
    "0": "beeutil:block/bee_helmet",
    "particle": "beeutil:block/bee_helmet"
},
"elements": [
    {
        "from": [3, 0, 3],
        "to": [13, 9, 13],
        "faces": {
            "north": {"uv": [5, 0, 10, 4.5], "texture": "#0"},
            "east": {"uv": [5, 4.5, 10, 9], "texture": "#0"},
            "south": {"uv": [5, 9, 10, 13.5], "texture": "#0"},
            "west": {"uv": [0, 10, 5, 14.5], "texture": "#0"},
            "up": {"uv": [5, 5, 0, 0], "texture": "#0"},
            "down": {"uv": [5, 5, 0, 10], "texture": "#0"}
        }
    },
    {
        "from": [3, 9, 5],
        "to": [4, 12, 6],
        "faces": {
            "north": {"uv": [10, 2, 10.5, 3.5], "texture": "#0"},
            "east": {"uv": [10, 3.5, 10.5, 5], "texture": "#0"},
            "south": {"uv": [10, 5, 10.5, 6.5], "texture": "#0"},
            "west": {"uv": [10, 6.5, 10.5, 8], "texture": "#0"},
            "up": {"uv": [11.5, 2.5, 11, 2], "texture": "#0"},
            "down": {"uv": [11.5, 2.5, 11, 3], "texture": "#0"}
        }
    },
    {
        "from": [3, 11, 6],
        "to": [4, 13, 7],
        "faces": {
            "north": {"uv": [10.5, 5, 11, 6], "texture": "#0"},
            "east": {"uv": [10.5, 6, 11, 7], "texture": "#0"},
            "south": {"uv": [10.5, 7, 11, 8], "texture": "#0"},
            "west": {"uv": [10.5, 8, 11, 9], "texture": "#0"},
            "up": {"uv": [11.5, 3.5, 11, 3], "texture": "#0"},
            "down": {"uv": [11.5, 3.5, 11, 4], "texture": "#0"}
        }
    },
    {
        "from": [3, 11, 11],
        "to": [4, 13, 13],
        "faces": {
            "north": {"uv": [10.5, 9, 11, 10], "texture": "#0"},
            "east": {"uv": [10, 0, 11, 1], "texture": "#0"},
            "south": {"uv": [10.5, 10, 11, 11], "texture": "#0"},
            "west": {"uv": [10, 1, 11, 2], "texture": "#0"},
            "up": {"uv": [11.5, 1, 11, 0], "texture": "#0"},
            "down": {"uv": [11.5, 1, 11, 2], "texture": "#0"}
        }
    },
    {
        "from": [3, 9, 10],
        "to": [4, 12, 11],
        "faces": {
            "north": {"uv": [10, 8, 10.5, 9.5], "texture": "#0"},
            "east": {"uv": [10, 9.5, 10.5, 11], "texture": "#0"},
            "south": {"uv": [10.5, 2, 11, 3.5], "texture": "#0"},
            "west": {"uv": [10.5, 3.5, 11, 5], "texture": "#0"},
            "up": {"uv": [11.5, 4.5, 11, 4], "texture": "#0"},
            "down": {"uv": [11.5, 4.5, 11, 5], "texture": "#0"}
        }
    }
],
"display": {
    "thirdperson_righthand": {
        "rotation": [0, -90, -90],
        "scale": [0.5, 0.5, 0.5]
    },
    "thirdperson_lefthand": {
        "rotation": [90, 90, 0],
        "scale": [0.5, 0.5, 0.5]
    },
    "firstperson_righthand": {
        "rotation": [0, -90, 0],
        "translation": [0, 3, 0],
        "scale": [0.8, 0.8, 0.8]
    },
    "firstperson_lefthand": {
        "rotation": [0, 90, 0]
    },
    "ground": {
        "translation": [0, 4.75, 0]
    },
    "gui": {
        "rotation": [0, 90, 0],
        "translation": [0, 2.5, 0]
    },
    "head": {
        "rotation": [0, -90, 0],
        "translation": [-0.25, 5.5, 0],
        "scale": [1.5, 1.5, 1.5]
    },
    "fixed": {
        "rotation": [0, -90, 0],
        "translation": [0, 4, 0]
    }
}

}

这是我的方块状态代码:

  {
    "varients": {
      "": { "model":  "beeutil:block/bee_helmet"}
    }
  }

这是我的模型项目代码:

{
  "parent": "beeutil:block/bee_helmet"
}

标签: javaminecraft-forge

解决方案


推荐阅读