You can specify custom NBT attributes to be merged into the custom item.
This feature supports legacy NBT and the new 1.20.5+ modern NBT too!
It will automatically convert the legacy NBT if needed.
More info on the 1.20.5+ changes here (scroll down).
Make sure to provide a valid NBT (json) or it won't work!
Inject NBT properties from file
This is a new feature of ItemsAdder 4.0.8
my_item_file.yml
info:namespace:testitems:test_inject_nbt_from_file:display_name:"Test inject NBT from file"components_nbt_file:"test_inject_nbt_from_file.json"resource:material:IRON_CHESTPLATEgenerate:falsemodel_path:minecraft:item/diamond
Make sure to escape the " character using \.
Use my Escape/Unescape tool to escape the string before using it in the YML.
Example custom attribute
For example I want to merge these tags into my item:
nbt: '{my-custom-nbt-tag:"hello this is a custom tag", another-tag:"useless"}'
items:
custom_nbt_item_data:
display_name: "Injected nbt data into this item"
lore:
- 'test item: custom_nbt_item_data'
- 'test line from IA config 1'
- 'test line from IA config 2'
- 'test line from IA config 3'
permission: examples.test
nbt: '{my-custom-nbt-tag:"hello this is a custom tag", another-tag:"useless"}'
resource:
material: DIAMOND_SWORD
generate: false
model_path: "minecraft:item/diamond"
durability:
durability: 650
max_durability: 1324
attribute_modifiers:
mainhand:
attackDamage: 30
attackSpeed: 25