How to use custom names and lores in minecraft 1.14.2 [duplicate]

Solution 1:

The command has changed in 1.13 and above, so you would now use a command like this to give the nearest player a button with the name "ieat" and lore "ieat":

/give @p minecraft:acacia_button{display:{Name:'{"text":"ieat"}',Lore:['{"text":"ieat"}']}} 1

Or you can use something like this if you want more than one row of lore, when the second one is supposed to be green:

/give @p minecraft:acacia_button{display:{Name:'{"text":"Name"}',Lore:['{"text":"First line"}','{"color":"green","text":"Second line, shown in green"}']}} 1

To look for any player holding an acacia button with the name "ieat" you can use this target selector:

@a[nbt={SelectedItem:{id:"minecraft:acacia_button",tag:{display:{Name:'{"text":"ieat"}'}}}}]