mojira.dev
MC-269698

Set lore item modifier is broken

In 24w11a the following set lore item modifier works fine, however it has been broken in the latest snapshot despite no changes to item modifiers being listed, only some bug fixes, perhaps MC-269457 had something to do with it?

 

Edit: Even with the "replace": true remove it still does not work

 

[
  {
    "function": "minecraft:set_lore",
    "entity": "this",
    "lore": [
      {
        "text": "A sword fit for the grandest adventurer!",
        "color": "gray",
        "bold": false,
        "italic": false
      }
    ],
    "replace": true
  }
]

 

The game output returns this error only in 24w12a:
Couldn't parse element item_modifiers:test:set_lore - Input does not contain a key [mode]: MapLike[{"function":"minecraft:set_lore","entity":"this","lore":[{"text":"A sword fit for the grandest adventurer!","color":"gray","bold":false,"italic":false}],"replace":true}]

 

 

How to reproduce

1. Use the attached datapack in 24w11a and while holding an item run:

 

/item modify entity @s weapon.mainhand test:set_lore

 

2. Observe the lore applied to the item

3. Repeat in 24w12a

4. Item modifier is no longer recognized

 

Expected Outcome

Item modifier is applied to weapon and should read in gray:

"A sword fit for the grandest adventurer!"

Attachments

Comments 2

The 24w12a article mentions this change:

SET_LORE FUNCTION
The replace field has been removed
Now has mode like set_fireworks and set_written_book_pages

I might have brain worms. Thanks Misode!
For anyone that ended up here this is now the working code

 

[
  {
    "function": "minecraft:set_lore",
    "entity": "this",
    "lore": [
     
{         "text": "A sword fit for the grandest adventurer!",         "color": "gray",         "bold": false,         "italic": false      }
    ],
    "mode": "replace_all"  }
]

 

phaic

(Unassigned)

Unconfirmed

(Unassigned)

24w12a

Retrieved