Editing Items - goncalomb/NBTEditor GitHub Wiki
All items can be edited using the /nbtitem (/nbti) command.
Similarly to editing entities and tiles, items have variables that can be changed using the /nbti var <variable> ... command. E.g. while holding an item, running the command /nbti var Name My Precious will rename the item.
To see information about an item use the /nbti info command.
To clear a variable use the /nbti clearvar <variable> command.
It's also possible to edit attribute modifiers using the /nbti mod command. Check the command list for all the commands and the Minecraft Wiki for more information on Attribute Modifiers.
Any item can be enchanted using the /nbtenchant (/nbte) command. More information on the commands page.
Potions can be edited using the /nbtpotion (/nbtp) command. More information on the commands page.
Running /nbti tocommand while holding any item and looking at a Command Block will convert the item to a vanilla /give command.