Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-269482

The set_attributes function in loot tables no longer replaces default attribute modifiers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w14a
    • 24w11a
    • None
    • Confirmed
    • Data Packs, Loot tables
    • Important
    • Platform

      When creating a loot table in a data pack that uses the function minecraft:set_attributes, the custom attributes are added to the item in addition to the default vanilla attributes. This is different to how it functioned before in 1.20.4 where the custom attributes would replace the default ones.

       

      Reproduction steps:
      Load the provided data pack with the loot table in a new world.

      /datapack enable "file/set_attribute_bug_demo"

      Then run the command.
      /loot give @s loot minecraft:diamond_sword

       

      What should happen:
      You get a sword with only +14 attack damage.
      What actually happens:
      You get a sword with +14 attack damage with the default modifiers still present.

            gegy1000 [Mojang] Gegy
            18jfisher1 Javitar
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: