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

Loot Table function enchant_randomly can give Non-Stored Enchantments to books if another function enchants it first.

    XMLWordPrintable

    Details

    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      The Bug

      The game has two kinds of enchantments, StoredEnchantments for books and Enchantments for everything else. The loot table function enchant_randomly will give the wrong kind of enchantment to books if another function has already enchanted it.

      {
        "type": "minecraft:chest",
        "pools": [
          {
            "rolls": {
              "min": 4.0,
              "max": 8.0,
              "type": "minecraft:uniform"
            },
            "entries": [
              {
                "type": "minecraft:item",
                "functions": [
      	    {
                    "function": "minecraft:enchant_with_levels",
                    "levels": 30,
                    "treasure": true
                  },
      	    {
                      "function": "enchant_randomly",
                      "enchantments": [
                          "protection",
                          "fire_protection",
                          "feather_falling",
                          "blast_protection",
                          "projectile_protection",
                          "thorns",
                          "depth_strider",
                          "frost_walker",
                          "sharpness",
                          "knockback",
                          "fire_aspect",
                          "looting",
                          "efficiency",
                          "silk_touch",
                          "unbreaking",
                          "fortune",
                          "power",
                          "punch",
                          "flame",
                          "infinity",
                          "mending"
                      ]
                  }
                ],
                "name": "minecraft:book"
              }
            ]
          }
        ]
      }
      

      The same thing happens if the function enchant_randomly is used twice, with the second enchantment being bugged.

      If the function enchant_randomly is used on its own, then it gives a StoredEnchantment as intended.

      If the function enchant_randomly is used, then enchant_with_levels, then enchant_with_levels won't give any enchantments at all.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            paint Paint
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              CHK: