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

Parrots dismount shoulders even if damage was blocked

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • Minecraft 1.12, Minecraft 1.12.2, Minecraft 17w50a, Minecraft 1.13, Minecraft 1.13.1-pre1, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w45a, Minecraft 18w46a, 1.15.2, 20w12a, 1.16 Pre-release 3, 20w46a, 21w03a, 21w06a, 1.19.3, 23w05a
    • Confirmed
    • Mob behaviour
    • Low

      The bug

      Based on this comment parrots are supposed to dismount as soon as the player takes damage. However, currently parrots dismounts even if the damage was blocked or prevented, for example when the player is standing in fire with fire resistance.

      How to reproduce

      1. Summon a parrot and tame it
      2. Have the parrot sit on your shoulder
      3. Give yourself fire resistance
        /effect give @s fire_resistance 120 0 true
        
      4. Place fire
      5. Switch to Survival or Adventure mode and walk into the fire

      Code analysis

      Based on 1.12 decompiled using MCP 9.40 PRE 1

      Currently the method net.minecraft.entity.player.EntityPlayer.attackEntityFrom(DamageSource, float) dismounts the parrot without testing if the parent methods successfully attacked the player. However, an attack blocked with a shield still counts as successful, therefore the method net.minecraft.entity.EntityLivingBase.damageEntity(DamageSource, float) could probably be used for dismounting the parrot.

            Unassigned Unassigned
            marcono1234 [Mod] Marcono1234
            Votes:
            11 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: