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

Placing items on armor stand from off-hand impossible

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 15w31a, Minecraft 15w44b, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w36a, Minecraft 16w38a, Minecraft 16w39a, Minecraft 16w39b, Minecraft 16w39c, Minecraft 16w40a, Minecraft 16w41a, Minecraft 16w42a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w13b, Minecraft 17w14a, Minecraft 17w15a, Minecraft 1.12 Pre-Release 6, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 17w50a, Minecraft 18w02a, Minecraft 18w05a, Minecraft 18w11a, Minecraft 18w22a, Minecraft 18w22c, Minecraft 1.13-pre1, Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre4, Minecraft 1.13-pre5, Minecraft 1.13-pre6, Minecraft 1.13-pre7, Minecraft 1.13-pre8, Minecraft 1.13-pre9, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 18w32a, Minecraft 1.13.1-pre1, Minecraft 1.13.1-pre2, Minecraft 1.13.1, Minecraft 1.13.2-pre1, Minecraft 1.13.2-pre2, Minecraft 1.13.2, Minecraft 18w43a, Minecraft 18w43b, Minecraft 18w43c, Minecraft 18w44a, Minecraft 18w45a, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03a, Minecraft 19w03c, Minecraft 19w04b, Minecraft 19w12b, Minecraft 19w13b, Minecraft 19w14a, Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 3, Minecraft 1.14.3, Minecraft 1.14.4 Pre-Release 5, 1.14.4, 19w39a, 19w40a, 19w46b, 1.15.2, 20w11a, 20w17a, 20w20b, 20w21a, 20w22a, 1.16 Pre-release 2, 1.16, 1.16.4 Pre-release 2, 1.16.4, 20w46a, 20w51a, 21w03a, 1.16.5, 21w05b, 21w06a, 21w07a, 21w08b, 21w11a, 21w17a, 1.17, 1.17.1, 1.18.1, 1.18.2, 1.19, 1.19.1 Pre-release 2, 1.19.2, 1.19.3, 1.20.1, 1.20.3 Release Candidate 1, 1.20.4, 24w44a, 1.21.3
    • Confirmed
    • Entities, Player
    • Normal
    • Platform

      The bug

      If you try to put an item on an armor stand with the off-hand, nothing happens.

      Fix

      EntityArmorStand.java
      public EnumActionResult applyPlayerInteraction(EntityPlayer player, Vec3d vec, EnumHand stack)
          {
              ItemStack itemstack = player.getHeldItem(stack);
      		
              if (!this.hasMarker() && itemstack.getItem() != Items.NAME_TAG)
              {
      //          if (!this.world.isRemote && !player.isSpectator())
      ++          if (!player.isSpectator())
                  {
                      EntityEquipmentSlot entityequipmentslot = EntityLiving.getSlotForItemStack(itemstack);
      
                      if (itemstack.isEmpty())
                      {
                          EntityEquipmentSlot entityequipmentslot1 = this.getClickedSlot(vec);
                          EntityEquipmentSlot entityequipmentslot2 = this.isDisabled(entityequipmentslot1) ? entityequipmentslot : entityequipmentslot1;
      
                          if (this.hasItemInSlot(entityequipmentslot2))
                          {
                              this.swapItem(player, entityequipmentslot2, itemstack, stack);
      ++                      return EnumActionResult.SUCCESS;
                          }
                          
      ++                  return EnumActionResult.FAIL;
                      }
                      else
                      {
                          if (this.isDisabled(entityequipmentslot))
                          {
                              return EnumActionResult.FAIL;
                          }
      
                          if (entityequipmentslot.getSlotType() == EntityEquipmentSlot.Type.HAND && !this.getShowArms())
                          {
                              return EnumActionResult.FAIL;
                          }
      
                          this.swapItem(player, entityequipmentslot, itemstack, stack);
                      }
      
                      return EnumActionResult.SUCCESS;
                  }
                  else
                  {
      //              return EnumActionResult.SUCCESS;
      ++              return EnumActionResult.PASS;
                  }
              }
              else
              {
                  return EnumActionResult.PASS;
              }
          }
      

      Fixing this also fixes MC-112995.

            Unassigned Unassigned
            Lord_Quadrato [Helper] Lord_Quadrato
            Votes:
            27 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              CHK: