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

Running 'enchant_with_levels' function multiple times on the same item can illegally stack exclusive enchantments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21, 1.21.1, 1.21.2 Pre-Release 3, 1.21.2, 1.21.4, 25w02a, 25w04a
    • None
    • Community Consensus
    • Commands, Enchantments
    • Normal
    • Platform

      Steps to reproduce:

      1. Join a new Creative world.
      2. Get any sword from the menu and hold it.
      3. Run the following command multiple times:

      /item modify entity @s weapon {"function":"minecraft:enchant_with_levels","levels":30,"options":"#minecraft:on_random_loot"}

      In this example, a Sword enchanted with Sharpness, Smite and Bane of Arthropods was obtained, as shown on the image below. This is inconsistent with the 'enchant_randomly' function, which can be specified to only enchant the item with compatible enchantments.

            Unassigned Unassigned
            kohara kohara
            Votes:
            16 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: