I've got an axe via this command (via command blocks)
/give @p golden_axe 1 0 {display:{Name:"Thor's Axe",Lore:["The godliest","of the godliest."]},AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:40,Operation:0,UUIDMost:69160,UUIDLeast:521589},{AttributeName:"generic.followRange",Name:"generic.followRange",Amount:32,Operation:0,UUIDMost:99396,UUIDLeast:851924},{AttributeName:"generic.knockbackResistance",Name:"generic.knockbackResistance",Amount:500,Operation:0,UUIDMost:76900,UUIDLeast:463228},{AttributeName:"generic.movementSpeed",Name:"generic.movementSpeed",Amount:0.5,Operation:0,UUIDMost:34152,UUIDLeast:644098},{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:5,Operation:0,UUIDMost:85956,UUIDLeast:818955}],Unbreakable:1}
However, my intentions were to put it into a summoned chest command. So I tried this:
/setblock ~1 ~ ~ chest 0 replace {Items:[{golden_axe 0 1 {display:{Name:"Thor's Axe",Lore:["The godliest","of the godliest."]},AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:40,Operation:0,UUIDMost:69160,UUIDLeast:521589},{AttributeName:"generic.followRange",Name:"generic.followRange",Amount:32,Operation:0,UUIDMost:99396,UUIDLeast:851924},{AttributeName:"generic.knockbackResistance",Name:"generic.knockbackResistance",Amount:500,Operation:0,UUIDMost:76900,UUIDLeast:463228},{AttributeName:"generic.movementSpeed",Name:"generic.movementSpeed",Amount:0.5,Operation:0,UUIDMost:34152,UUIDLeast:644098},{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:5,Operation:0,UUIDMost:85956,UUIDLeast:818955}],Unbreakable:1}}]}
However then I get a JSON error about seperators:
[00:04:05] Data tag parsing failed: Unable to locate name/value separator for string: golden_axe {display:{Name:"Thor's Axe",Lore:["The godliest","of the godliest."]},AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:40,Operation:0,UUIDMost:69160,UUIDLeast:521589},{AttributeName:"generic.followRange",Name:"generic.followRange",Amount:32,Operation:0,UUIDMost:99396,UUIDLeast:851924},{AttributeName:"generic.knockbackResistance",Name:"generic.knockbackResistance",Amount:500,Operation:0,UUIDMost:76900,UUIDLeast:463228},{AttributeName:"generic.movementSpeed",Name:"generic.movementSpeed",Amount:0.5,Operation:0,UUIDMost:34152,UUIDLeast:644098},{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:5,Operation:0,UUIDMost:85956,UUIDLeast:818955}],Unbreakable:1}
Now I'm stumped. I found something like the one above; but it worked – but WITHOUT the custome attributes.
Is there anyway to put the axe :
"{golden_axe {display:{Name:"Thor's Axe",Lore:["The godliest","of the godliest."]},AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:40,Operation:0,UUIDMost:69160,UUIDLeast:521589},{AttributeName:"generic.followRange",Name:"generic.followRange",Amount:32,Operation:0,UUIDMost:99396,UUIDLeast:851924},{AttributeName:"generic.knockbackResistance",Name:"generic.knockbackResistance",Amount:500,Operation:0,UUIDMost:76900,UUIDLeast:463228},{AttributeName:"generic.movementSpeed",Name:"generic.movementSpeed",Amount:0.5,Operation:0,UUIDMost:34152,UUIDLeast:644098},{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:5,Operation:0,UUIDMost:85956,UUIDLeast:818955}],Unbreakable:1}}]"
Into the chest? (summon command or setblock)
Best Answer
You are trying to insert a command into NBT data. You need to follow the correct format for NBT; the wiki lists data for the item format here.
In particular, you need to specify an
id
string,Damage
short,Count
byte,Slot
byte, andtag
compound. The/give
syntax reflects all exceptSlot
:Therefore, with the following
/give
command:The data becomes:
Your command will follow the same format, including the
Slot
tag as theItems
list uses that tag to determine which slot in the inventory the item is in. Fixed command: