Skip to content

自定义釉面陶瓦

格式要求 & 最低引擎版本 1.20.40

本教程需要基础的方块制作知识,建议先阅读方块制作指南

前言

釉面陶瓦拥有独特的旋转机制,允许玩家通过不同朝向组合出适用于墙面、地面和天花板的精美图案。本教程将指导您创建类似釉面陶瓦的自定义方块。

自定义釉面陶瓦配置

以下配置可实现类原版釉面陶瓦的旋转效果。

json
{
    "format_version": "1.20.40",
    "minecraft:block": {
        "description": {
            "identifier": "wiki:glazed_terracotta_template",
            "menu_category": {
                "category": "construction",
                "group": "itemGroup.name.glazedTerracotta"
            },
            "traits": {
                "minecraft:placement_direction": {
                    "enabled_states": [
                        "minecraft:cardinal_direction"
                    ]
                }
            }
        },
        "permutations": [
            {
                "condition": "q.block_state('minecraft:cardinal_direction') == 'north'",
                "components": {
                    "minecraft:transformation": { "rotation": [0, 0, 0] },
                    "minecraft:geometry": {
                        "identifier": "geometry.glazed_terracotta",
                        "bone_visibility": {
                            "bottom_1": false,
                            "bottom_2": false,
                            "bottom_3": false,
                            "bottom_4": true
                        }
                    }
                }
            },
            // 其他三个方向的配置结构类似
            // 此处省略西/南/东方向的配置节以保持简洁
        ],
        "components": {
            "minecraft:geometry": {
                "identifier": "geometry.glazed_terracotta"
            },
            "minecraft:material_instances": {
                "*": {
                    "texture": "purple_glazed_terracotta",
                    "render_method": "opaque"
                }
            }
        }
    }
}

几何结构配置

原版釉面陶瓦通过特殊数值实现方块面的旋转效果。使用以下几何结构配置可复现该特性。