How do I put a lore AND an enchantment on an item in Minecraft?

I am someone who likes minecraft and all commands in it. except what I'm having trouble with is how to put a lore AND an enchantment on an item in minecraft.
Best Answer
This is an example of giving yourself an item with lore:
/give @p diamond_sword{display:{Lore:["text here"]}}
Just replace "text here" with the desired text.
This is an example of giving yourself an item with an enchantment (sharpness in this case):
/give @p diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:1}]}
"lvl" is the level of the enchantment. I made it 1, but you could make it 2 3 4 or as high as you want.
This is an example of giving yourself a diamond sword with the lore of "shiny!" and with a knockback 3 enchantment:
/give @p diamond_sword{display:{Lore:["shiny!"]},Enchantments:[{id:"minecraft:knockback",lvl:3}]}
To find a full list of possible enchantments to use, go to: https://minecraft.gamepedia.com/Enchanting#Data_values
Pictures about "How do I put a lore AND an enchantment on an item in Minecraft?"



How do you add lore and enchantments to an item in Minecraft?
You cannot transfer an enchantment from a tool onto a book in vanilla survival without cheats. You can however combine two books (or any two items of the same type) and merge the enchantments with an anvil.Can you take an enchantment off something and put it on something else?
To use an enchanted book, the player must place an item in the first slot in an anvil, and a book in the next. In order to complete the enchantment, the player must have the required amount of experience. Note that using an enchanted book gets significant discounts at the anvil.Minecraft - How To Add Custom Lore To Your Items! (Java/Bedrock)
More answers regarding how do I put a lore AND an enchantment on an item in Minecraft?
Answer 2
Moderator Note: This answer appears to be outdated in newer versions of Minecraft. Please reference one of the newer answers if you're playing the latest version.
/give @p 'custom_item' 1 0 {display{Name:"Custom Name"},Lore:["Custom lore"]},ench:[{id:'enchantmentid',lvl:'enchantmentlvl}]}
Here is an example given: giving sword called "Bertha
" with a lore "she's beautiful
" with sharpness I.
/give @p wooden_sword 1 0 {display{Name:"Bertha"},Lore:["She's beautiful"]},ench:[{id:16,lvl:1}]}
You need to tell what item you're giving, followed by the amount. (for swords and tools more than one will stack) the second number is the damage amount. This means how much damage the item will have when it is given to you.
So, if you want a really OP bow, that has only 10 usage left, you can do /give @p bow 1 374
`
Answer 3
With 1.13.x the command syntax has changed.
It is now:
/give @selector item_name{Enchantments:[{id:"enchantment_name",lvl:number}],display:{Lore:["lore_text"]}} item_amount
For example:
/give @p minecraft:diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:5}],display:{Lore:["Excalibur!"]}} 1
/give @selector amount meta item_name-or-id
has changed to/give @selector item_name amount
- numeric IDs no longer work, so the enchantment (and any other IDs) must be written out
- the item data is now tied directly to the item:
item_name{data, some_data{more_data},etc}
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Anete Lusina, cottonbro, Andrea Piacquadio, Anete Lusina