手册:制作附加包/物品组件

From Minecraft基岩版开发Wiki
物品组件
系列教程
所属系列
难度
初级
前置知识
适用版本
国际版
实践设备
常用
Windows 10IOSAndroid
推荐
Windows 10
建议软件
Visual Studio Code icon.svg
相关阅读

物品组件用于定义该物品所具备的功能和特性。

语法结构[edit]

组件列表[edit]

示例[edit]

食物[edit]

药水[edit]

武器[edit]

远程武器[edit]

近战武器[edit]

盔甲[edit]

{
  "format_version": "1.16.100",
  "minecraft:item": {
    "description": {
      "category": "equipment",
      "identifier": "example:helmet"
    },
    "components": {
    "tag:minecraft:is_helmet": {},
			"minecraft:display_name": {},
			"minecraft:weapon": {},
    "minecraft:creative_category": {
				"parent": "itemGroup.name.helmet"
			},
			"minecraft:icon": {
				"texture": "example:helmet"
			},
      "minecraft:max_stack_size": 1,
      "minecraft:enchantable": {
        "value": 15,
        "slot": "armor_head"
      },
      "minecraft:damageable": {
        "max_damage": 1000,
        "damage_chance": {
          "min": 60,
          "max": 100
        }
      },
      "minecraft:mining_speed": 9,
      "minecraft:damage": 4,
      "minecraft:armor": {
        "protection": 3
      },
      "minecraft:wearable": {
        "slot": "slot.armor.head"
      },
      "minecraft:knockback_resistance": {
        "protection": 0.1
      }
    }
  }
}

弹射物[edit]

{
  "format_version": "1.16.100",
  "minecraft:item": {
    "description": {
      "category": "equipment",
      "identifier": "example:projectile"
    },
    "components": {
      "minecraft:display_name": {},
      "minecraft:creative_category": {
        "parent": "itemGroup.name.arrow"
      },
      "minecraft:icon": {
        "texture": "example:projectile"
      },
      "minecraft:max_stack_size": 16,
      "minecraft:projectile": {
        "projectile_entity": "example:projectile_entity"
      }
    }
  }
}

< 物品 | 方块 >