Mojira Archive
MC-212795

Item drops from fish entities aren't affected by the looting enchantment

The Bug:

Item drops from fish entities aren't affected by the looting enchantment.

Just for clarification reasons, the affected entities are cod, salmon, tropical fish, and pufferfish.

Steps to Reproduce:

  1. Give yourself a sword with a high level of looting by using the command provided below.
    /give @s minecraft:diamond_sword{Enchantments:[{id:"minecraft:looting",lvl:100}]}
  2. Summon a cod, salmon, tropical fish, or pufferfish.
  3. Kill it using the sword enchanted with looting and observe the loot that it drops upon death.
  4. Take note as to whether or not item drops from fish entities are affected by the looting enchantment.

Observed Behavior:

Item drops aren't affected by the looting enchantment.

Expected Behavior:

Item drops would be affected by the looting enchantment.

Code Analysis:

Code analysis by [Mod] Avoma can be found below.

In the affected mob's json files (cod.json, salmon.json, tropical_fish.json, and pufferfish.json), we can see that the "minecraft:looting_enchant" function (the function that's responsible for modifying the count of how many items are returned when an entity is killed by an item with the looting enchantment) isn't present anywhere within the affected mob's loot table, therefore resulting in the drops of cod, salmon, tropical fish, and pufferfish not being affected by the looting enchantment.

Unresolved

Lexi Smith

2021-01-24, 09:15 PM

2024-08-26, 07:05 PM

7

5

Confirmed

Loot tables

cod, looting, pufferfish, salmon, tropical_fish

1.16.5 - 24w34a1.16.5, 1.17, 1.17.1, 1.18.1, 1.18.2, 1.19 Pre-release 1, 1.19, 1.19.2, 1.19.4, 23w14a, 24w34a

-