Mojira Archive
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

Fixed

Ellivers

[Mojang] Gegy

2024-04-12, 03:16 PM

2024-05-06, 01:38 PM

2024-05-06, 01:38 PM

1

2

Confirmed

Normal

Platform

Commands

1.20.5 Pre-Release 1, 1.20.6, 24w18a

24w19a