Minecraft wiki entry for Anvil, associated text: Any name changes to items are applied to the data tag {Item:{tag:{display:{Name:"{\"text\":\"<name>\"}"}}}}. Similarly, this data tag can be accessed by the nbt argument using target selectors.