Mojira Archive
MCPE-164582

Loot table conditions don't work inside of functions

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"
                        }
                     ]
                  }
               ]
            }
         ]
      }
   ]
}

Fixed

[Mod] tryashtar

2022-11-26, 02:39 AM

2023-03-14, 07:07 PM

2023-03-14, 07:07 PM

0

0

Confirmed

938344

1.19.41

1.19.70.22 Preview, 1.19.70