mojira.dev
MC-270684

set_attributes loot function doesn't accept an empty list

Unlike all other loot functions that feature a list, set_attributes does not accept an empty modifiers list.

This makes it more difficult to remove all attribute modifiers, as you can't simply use an empty list with replace enabled.

How to reproduce:

  1. Hold an item

  2. Run the following command in chat

    /item modify entity @s weapon {function:set_attributes,modifiers:[],replace:1b}
  3. Notice the error message:

    Failed to parse structure: Not a list: {function:"set_attributes",modifiers:[],replace:1b}; List must have contents
    ...eplace:1b}<--[HERE]
  4. Try the same thing but with set_lore, or any other item function. In this case, mode is used since that is what set_lore uses.

    /item modify entity @s weapon {function:set_lore,lore:[],mode:replace_all}
  5. The command succeeds

Comments 3

Thank you for your report!
We do not have enough information to find the cause of this issue.

Please provide detailed steps of reproduction to this report.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Please provide repro steps with correct syntax. The set_attributes function doesn't have a mode field.

My bad. Should be correct now.

Ellivers

gegy

Confirmed

Platform

Normal

Commands

1.20.5 Pre-Release 1, 1.20.6, 24w18a

24w19a

Retrieved