#Set lore component from data storage

1 messages · Page 1 of 1 (latest)

frigid whale
#

I want to set the minecraft:lore component of an item (in the players inventory so no data modify) from a data storage.
Previously i would have done this using and item modifier and the copy nbt function, but that no longer exists since we got components.
Is there a more efficient way of doing this other than copying the item into a container and then doing data modify from there?

stray pewterBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1749638481:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

edgy grotto
#

set_lore item modifier

frigid whale
#

i tried that, but as far as i'm aware you can't specify a source to copy the lore from there, can you?

#

maybe i'm just missing something

#

oh nvm i see

#

thank youu :)

stray pewterBOT
#
Question Closed

Your question, #1382301167203258389 (Set lore component from data storage), was resolved!

Original Message

#1382301167203258389 message

Duration open

10m

frigid whale
#

Coming back to this, i tried using this item modifier:

[
  {
    "function": "minecraft:set_lore",
    "entity": "this",
    "lore": [
      {
        "entity": "@s",
        "nbt": "Inventory[{Slot:-106b}].components.\"minecraft:lore\"[]",
        "interpret": true
      }
    ],
    "mode": "replace_all",
    "conditions": []
  }
]

but it gets rid of all the linebreaks for some reaon, any way i can fix this? :(

frigid whale
#

How do i unreslove this lol

hard vapor
#

The reason why your lore is all in one line is because each entry of the lore list (of the Item Modifier) is a line and you're setting the first entry equals to the whole lore component (from your item). To fix this, I would reccommend to use an inline item modifier and a macro