自定义物品 NBT

向物品添加自定义 NBT 属性

你可以指定自定义 NBT 属性以合并到自定义物品中。

从文件中注入 NBT 属性

这是 ItemsAdder 4.0.8 的新功能

my_item_file.yml
info:
  namespace: test
items:
  test_inject_nbt_from_file:
    display_name: "Test inject NBT from file"
    components_nbt_file: "test_inject_nbt_from_file.json"
    resource:
      material: IRON_CHESTPLATE
      generate: false
      model_path: minecraft:item/diamond

旧方法,从 NBT 字符串注入

注意

示例自定义属性

例如,我想将这些标签合并到我的物品中: nbt: '{my-custom-nbt-tag:"hello this is a custom tag", another-tag:"useless"}'

示例 NBT 与物品名称组件

nbt: "{components:{"minecraft:custom_name":'{"text":"TEST", "font": "alt", "italic":false}', "minecraft:custom_data": {"bro":'asd'}}}"

1.20.4 组件 - 请勿使用

nbt: "{display:{Name:'{"text":"TEST", "font": "alt", "italic":false}'}}"

Last updated

Was this helpful?