Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-164582

Loot table conditions don't work inside of functions

XMLWordPrintable

    • Confirmed
    • Windows
    • 938344

      The bug

      Loot table functions are supposed to be able to have conditions inside them. However, this doesn't work, all conditions are ignored.

      How to reproduce

      1. Download and open the attached world. It makes creepers drop diamond swords on death, which should be enchanted when killed by a player
      2. Summon a creeper 30 blocks in the air

      Expected results
      It should drop a normal diamond sword

      Observed results
      It drops an enchanted diamond sword, even though it wasn't killed by a player.

      Relevant loot table

      {
         "pools": [
            {
               "rolls": 1,
               "entries": [
                  {
                     "type": "item",
                     "name": "minecraft:diamond_sword",
                     "weight": 1,
                     "functions": [
                        {
                           "function": "enchant_randomly",
                           "conditions": [
                              {
                                 "condition": "killed_by_player"
                              }
                           ]
                        }
                     ]
                  }
               ]
            }
         ]
      }
      

            tryashtar [Mod] tryashtar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: