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

random_chance_with_looting function base value is for enchantment level 1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.21 Pre-Release 1
    • 24w19b
    • None
    • Community Consensus
    • Enchantments, Loot tables
    • Important
    • Platform

      The previous random_chance_with_looting function had a base chance, and a per_level bonus to that chance.
      The new random_chance_with_enchanted_bonus for some reason has a per_level_above_first bonus instead, which as its name implies is only effective at levels 2 and above. In turn, all uses of it were given updated base chances. As a result, the player now effectively always has looting 1 for rare drops, and only looting 2 and above can increase this.

      Example loot table
      Expected behavior: item never drops without looting, always drops with looting 1 or higher
      Actual behavior: item never drops without looting 2 or higher

      {
         "type": "minecraft:entity",
         "pools": [
            {
               "rolls": 1.0,
               "bonus_rolls": 0.0,
               "entries": [
                  {
                     "type": "minecraft:item",
                     "name": "minecraft:diamond"
                  }
               ],
               "conditions": [
                  {
                     "condition": "minecraft:random_chance_with_enchanted_bonus",
                     "chance": {
                        "type": "minecraft:linear",
                        "base": 0.0,
                        "per_level_above_first": 1.0
                     },
                     "enchantment": "minecraft:looting"
                  }
               ]
            }
         ]
      }
      

            TommyWallberg [Mojang] TommyWallberg
            tryashtar [Mod] tryashtar
            Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: