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

Blast Protection does not reduce explosion knockback except at very high levels

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 1.16.2, 1.16.3, 1.16.4, 20w48a, 21w03a
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Confirmed
    • Category:
      Entities

      Description

      The bug

      Blast Protection does not reduce knockback from explosions, unless the enchantment level is very high (much higher than can be attained through Survival) and the wearer is close to the source of the explosion.

      To reproduce

      • Change to survival or adventure mode, and give yourself a high amount of Resistance (e.g. effect give @s minecraft:resistance 1000000 4 true) to avoid dying from explosions
      • Enchant at least one piece of diamond (or other non-Netherite) armor with Blast Protection IV
        • Note that only the highest level of Blast Protection across all armor pieces affects knockback
      • Spawn a creeper or ignite TNT, and compare the explosion knockback while wearing the armor to without
      • Give yourself armor with Blast Protection 9:
        give @s diamond_chestplate{Enchantments:[{id:"minecraft:blast_protection",lvl:9s}]} 1
        
      • Stand next to the exploding creeper/TNT and notice that you take minimal knockback. Stand a few blocks away, and you will experience much greater knockback.

      This can also be reproduced on mobs wearing Blast Protection armor, such as in the attached testing world.

      Code analysis

      In net.minecraft.world.item.enchantment.ProtectionEnchantment.getExplosionKnockbackAfterDampener(), the amount of knockback reduction is original knockback * enchantment level * 0.15, rounded down to the nearest integer. The amount of knockback from an explosion seems to be at most 1 (and is usually less as entities are usually not directly next to the explosion). As a result, the rounding always reduces the amount of reduction to 0, unless the blast protection level is high enough to produce a reduction greater than 1 (which is only achieved from level 7+).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              Sonicwave [Mod] Sonicwave
              Votes:
              9 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                CHK: