Hype Splash Feed

Repeat-worthy fame stories with social momentum.

How can I give myself an item with a custom name, and how can I search for a player holding an item with a certain name.

This is what I tried:

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

It only gave me a regular acacia button.

0

1 Answer

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"}'}}}}]
1