Corrected version
/give @p netherite_sword{Enchantments:[{id:sharpness,lvl:5},{id:knockback,lvl:2},{id:fire_aspect,lvl:2},{id:looting,lvl:2},{id:sweeping,lvl:3},{id:unbreaking,lvl:3},{id:mending,lvl:1}],display:{Name:'[{"text":"Wool's Deity Sword"}]'}} 1
Like it has already been commented, always say what error you are getting, as your problem might not even be an error problem, but a "wrong" answer instead (for example, it gives you the item but no custom name).
Looking from the command, it looks like it has been parsed wrongfuly, meaning the amount of and/or order of {
's and [
's are wrong, let us expand the command and take a look:
///
By expaning, like @Fredy31 has mentioned in the comments, open this line of command in any text editor and:
Every time you find an opening {
or [
you create a new line with enter
and ident it with blank spaces with tab
. Every time you have to tab, make sure to tab further than the last one.
If you find ,
's, simply create a new line with same ident space as the last line.
Every time you find a closing }
or ]
, also create a new line but, this time, reduce the identation by one.
////
/give @p netherite_sword{ <-- Initial { as of every nbt.
Enchantments:[ <-- 1 [ and 1 {
{id:sharpness,lvl:5},
{id:knockback,lvl:2},
{id:fire_aspect,lvl:2},
{id:looting,lvl:2},
{id:sweeping,lvl:3},
{id:unbreaking,lvl:3},
{id:mending,lvl:1}
] <-- 0 [ and 1 {
} <-- 0 [ and 0 {
## Here, the game expects the next command token, that is, amount of the /give command.
## Notice how, instead, another { is opened.
{
display:{
Name:'[
{"text":"Wool's Deity Sword"}
]'
}
}
1
How to check if a nbt is right?
The idea begind these structures (Called json), is:
{ } Are dictionaries, meaning they expect a group of key:value
where value can be another a data (integer, string...), dictionary or a list. Each item (key:values
) is separated by ,
's. They start with a {
and end with }
[ ] are lists. They recive only a value
separated by ,
's. Value, again, can be any data, dictionaries or other lists.
So what does exactly the game expect? Let's ignore what is inside Enchantments
and display
:
/give @p netherite_sword{
Enchantments:[], <-- 'key' is Enchantments and values is '[]'
display:{} <-- 'key' is display and value is '{}'
}
1
Now, filling what is inside display
and Enchantments
:
/give @p netherite_sword{
Enchantments:[
{id:sharpness,lvl:5},
{id:knockback,lvl:2},
{id:fire_aspect,lvl:2},
{id:looting,lvl:2},
{id:sweeping,lvl:3},
{id:unbreaking,lvl:3},
{id:mending,lvl:1}
],
display:{
Name:'[
{"text":"Wool's Deity Sword"}
]'
}
}
1
Ps.: Even if your json is well structured, you stil have to respect the nbt tree format. Here, Name
must be inside display
. Both Enchantments
and display
stay close to the root.
{
Enchantments:[],
display:{Name:[]}
}