Give @s 0{Unbreakable:true,Enchantments: [{id:“1”,lvl:“2”},{id:“1”,lvl:“2”}…(后面的重复,这一段是附魔指令,可以写入很多种附魔)…],AttributeModifiers:[{AttributeName:X,Name:X,Amount:Y,Operation:0,UUID:[I;0,454256,0,215424],Slot:mainhand},{AttributeName:X,Name:X,Amount:Y,Operation:0,UUID:[I;0,454256,0,215424],Slot:mainhand}…(后面的重复这一段,这一段是属性修改指令,同上,也可以写入很多)….]}
完整的指令例如:
Give @s Minecraft:diamond_sword{Unbreakable:true,Enchantments:[{id:“Sharpness”,lvl:“10”},{id:“smite”,lvl:“20”},AttributeModifiers:[{AttributeName:generic.attack_damage,Name:generic.attack_damage,Amount:100,Operation:0,UUID:[I;0,454256,0,215424],Slot:mainhand},{AttributeName:generic.max_health,Name:generic.max_health,Amount:100,Operation:0,UUID:[I;0,454256,0,215424],Slot:mainhand}]]
这一段写出来的指令,是给与自己一个基础攻击力100,生命值上限增加100,附魔锋利10,亡灵杀手10的钻石剑,且该物品不可破坏