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

Unequipping horse armor shows armor equipping subtitle "Horse armor equips"

XMLWordPrintable

    • Confirmed

      The bug

      Removing the armor of a horse plays the entity.horse.armor sound and shows the according subtitle "Horse armor equips", which does not fit.

      The reason

      The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.

      The reason fro this is that the method net.minecraft.entity.passive.EntityHorse.onInventoryChanged(InventoryBasic) plays this sound if the horse had no armor and now wears armor or if the armor it wears now (including NONE) is not the same it wore before. The second condition makes little sense because this condition is already included in the first one. I assume something like following is the intended behaviour:

      /**
       * Called by InventoryBasic.onInventoryChanged() on a array that is never filled.
       */
      public void onInventoryChanged(InventoryBasic invBasic)
      {       
          HorseArmorType horsearmortype = this.getHorseArmorType();
          boolean flag = this.isHorseSaddled();
          this.updateHorseSlots();
      
          if (this.ticksExisted > 20)
          {
              // Replaced this
              //      if (horsearmortype == HorseArmorType.NONE && horsearmortype != this.getHorseArmorType())
              //    {
              //        this.playSound(SoundEvents.ENTITY_HORSE_ARMOR, 0.5F, 1.0F);
              //    }
              //        else if (horsearmortype != this.getHorseArmorType())
              //    {
              //        this.playSound(SoundEvents.ENTITY_HORSE_ARMOR, 0.5F, 1.0F);
              //    }
              if (horsearmortype != this.getHorseArmorType() && this.getHorseArmorType() != HorseArmorType.NONE)
              {
                  this.playSound(SoundEvents.ENTITY_HORSE_ARMOR, 0.5F, 1.0F);
              }
      
              if (!flag && this.isHorseSaddled())
              {
                  this.playSound(SoundEvents.ENTITY_HORSE_SADDLE, 0.5F, 1.0F);
              }
          }
      }
      

      Note: Changing the armor to a different armor item of the same type does not play the sound which could be seen as a bug.

            FruBasilicum [Mojang] Agnes Larsson
            marcono1234 Marcono1234
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: