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

Scoreboard type "minecraft.custom:minecraft.damage_resisted" ignores armor protection enchantments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 20w13b, 1.16.2 Pre-release 2, 1.16.2, 1.20.2, 23w40a, 23w46a, 1.20.3, 1.20.4 Release Candidate 1, 1.20.4, 24w09a
    • None
    • Confirmed
    • Commands
    • Low
    • Platform

      When a player with the resistance effect applied gets damaged, they will be awarded the proper value for the "minecraft.custom:minecraft.damage_resisted" statistic if they have armor or do not, but wil not be given the right value if they are wearing armor that is enchanted.

      Steps to Reproduce (Survival Mode):

      To make these steps to reproduce less drawn out, I have put commands in the "Notes" section to speed up this process.

      1. Run the following commands to properly track the players damage_resisted value
        /scoreboard objectives add resisted minecraft.custom:minecraft.damage_resisted {text:"Damage Resisted"}
        
        /scoreboard objectives setdisplay sidebar damage_resisted
        
      2. Give the player resistance 1
        /effect give @p minecraft:resistance infinite 1 true
        
      3. Get a full set of leather armor, and wear it
      4. Run this command to damage the player
        damage @p 20 minecraft:player_attack
        
      5. Note down the value displayed on the sidebar
      6. Clear the value to run the test again
        /scoreboard players set @p damage_resisted 0
        
      7. Wear a full set of enchanted leather armor (See Note 1)
      8. Repeat step 4 (See Note 2)

      Observed Results:

      After finishing step 8, you will notice that the value will be equal to the number observed in step 4, despite the fact that the player has resisted more damage the second time.

      Expected Results:

      The number would properly equate to how much damage the player has resisted.

      Screenshots/Videos:

      2023-10-08_19-45-48.mp4

      Notes:

      1. Convenient command to enchant the player's armor
        /enchant @p minecraft:protection 4
        
      2. After completing step 4, the player's health will be very low. I recommend running this command to heal:
         /effect give @p minecraft:regeneration 2 255 true 

            Unassigned Unassigned
            Jingy Jiingy
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: