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

Certain mobs that can melee can't use the Knockback enchantment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.6, 24w19b, 1.21.1, 24w34a
    • None
    • Community Consensus
    • Enchantments
    • Low
    • Gameplay

      Summary:
      Note that the minecraft:generic.attack_knockback attribute has nothing to do with the knockback enchantment as it isn't used by it. Some mobs are unable to use the knockback enchantment.

      This applies to the following mobs (list may be incomplete):

      • Slime
      • Magma cube
      • Bee
      • Hoglin
      • Zoglin
      • Goat
      • Iron golem

      Steps to reproduce:

      1. Be in survival mode.
      2. /summon minecraft:slime ~ ~ ~ {HandItems:[{id:"minecraft:wooden_sword",count:1,components:{"minecraft:enchantments":{levels:{"minecraft:knockback":5}}}},{}],Size:1}
      3. Kill the slime after it attacked you and you noticed that the knockback enchantment didn't work.
      4. /summon minecraft:magma_cube ~ ~ ~ {HandItems:[{id:"minecraft:wooden_sword",count:1,components:{"minecraft:enchantments":{levels:{"minecraft:knockback":5}}}},{}],Size:1}
      5. Kill the magma cube after it attacked you and you noticed that the knockback enchantment didn't work.
      6. /summon minecraft:bee ~ ~ ~ {HandItems:[{id:"minecraft:wooden_sword",count:1,components:{"minecraft:enchantments":{levels:{"minecraft:knockback":5}}}},{}]}
      7. Attack the bee.
      8. /summon minecraft:hoglin ~ ~ ~ {HandItems:[{id:"minecraft:wooden_sword",count:1,components:{"minecraft:enchantments":{levels:{"minecraft:knockback":5}}}},{}],IsImmuneToZombification:1b}
      9. Kill the hoglin after it attacked you and you noticed that the enchantment didn't work.
      10. /summon goat ~ ~ ~ {HandItems:[{id:"minecraft:wooden_sword",count:1,components:{"minecraft:enchantments":{levels:{"minecraft:knockback":5}}}},{}],Brain:{memories:{"minecraft:ram_cooldown_ticks":{value:0}}}}
      11. You might have to run the command multiple times if you goat doesn't ram you.
      12. /summon minecraft:iron_golem ~ ~ ~ {HandItems:[{id:"minecraft:wooden_sword",count:1,components:{"minecraft:enchantments":{levels:{"minecraft:knockback":5}}}},{}]}
      13. Attack the iron golem.

      Observed results:
      The knockback enchantment didn't work for these mobs.

      Expected results:
      The knockback enchantment should work for these mobs.

            Unassigned Unassigned
            EVGENSYPERPRO [Mod] EVGENSYPERPRO
            Votes:
            6 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: