Why doesn't this Minecraft "/give" command work? [duplicate]
/give x_xstolasx_x diamond_sword 1 0 {display:{Name:"Hellbringer"},Lore:["Guilty."],ench:{[id:"20",lvl:"2"],[id:"16",lvl:"10"],[id:"19",lvl:"2"]}}
This is the command I typed in to the command block. In the "Previous Output" section, it is saying
[19:32:06] Data tag parsing failed: Unbalanced curly brackets {}: {display:Name:"Hellbringer"},Lore:["Guilty."]},ench:{[id:"20",lvl:"2"],[id:"16",lvl:"10"],[id:"19",lvl:"2"]}
Please help me, I need this sword for something I am doing.
Best Answer
A compound tag surrounds its data in curly brackets, while a list tag surrounds its data in square brackets. All tags except for those directly within a list must have a name.
The ench tag is a list, yet you have declared it as a compound because it's opened using curly brackets:
ench:{[],[],[]}
And within those curly brackets you have unnamed lists, which breaks syntax. The ench tag is instead a list of compounds:
ench:[{},{},{}]
You have also declared the id and lvl tags as strings by using quotation marks, when they are supposed to be numerical (specifically a short; a number between -32,768 and 32,767).
The game will not auto-correct any tag-types within item data, so by declaring it as an integer (number between -2,147,483,648 and 2,147,483,647) it will remain an integer and not the standard short. The game will still recognize that it's a numerical value even in that case. To declare a short, you append a numerical value with an "s". To declare an integer, you simply use a numerical value.
The Lore list must be placed within the display compound.
Fixed command, using the correct tag-types for enchantments:
/give x_xstolasx_x diamond_sword 1 0 {display:{Name:"Hellbringer",Lore:["Guilty."]},ench:[{id:20s,lvl:2s},{id:16s,lvl:10s},{id:19s,lvl:2s}]}
Alternative, using integers to show that the game will accept it:
/give x_xstolasx_x diamond_sword 1 0 {display:{Name:"Hellbringer",Lore:["Guilty."]},ench:[{id:20,lvl:2},{id:16,lvl:10},{id:19,lvl:2}]}
It is recommended to declare correct tag-types for the sake of consistency, since enchantments applied through normal means will be shorts.
Pictures about "Why doesn't this Minecraft "/give" command work? [duplicate]"
![Why doesn't this Minecraft "/give" command work? [duplicate] - Cheerful crop African American female owner giving treat to Labrador Retriever while teaching commands in park Why doesn't this Minecraft "/give" command work? [duplicate] - Cheerful crop African American female owner giving treat to Labrador Retriever while teaching commands in park](/assets/images/why_doesn39t_this_minecraft_quotgivequot_command_work_duplicate_1.jpeg)
![Why doesn't this Minecraft "/give" command work? [duplicate] - Free stock photo of alphabet, be a self starter, blur Why doesn't this Minecraft "/give" command work? [duplicate] - Free stock photo of alphabet, be a self starter, blur](/assets/images/why_doesn39t_this_minecraft_quotgivequot_command_work_duplicate_2.jpeg)
![Why doesn't this Minecraft "/give" command work? [duplicate] - Dog giving paw to anonymous person Why doesn't this Minecraft "/give" command work? [duplicate] - Dog giving paw to anonymous person](/assets/images/why_doesn39t_this_minecraft_quotgivequot_command_work_duplicate_3.jpeg)
Why Doesn’t Yeat Say Nigga
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Pixabay, Samson Katt, Brett Jordan, Leon Natan
