--- a/net/minecraft/world/entity/decoration/EntityArmorStand.java
+++ b/net/minecraft/world/entity/decoration/EntityArmorStand.java
@@ -44,6 +44,15 @@
 import net.minecraft.world.phys.AxisAlignedBB;
 import net.minecraft.world.phys.Vec3D;
 
+// CraftBukkit start
+import org.bukkit.inventory.EquipmentSlot;
+import org.bukkit.craftbukkit.CraftEquipmentSlot;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.entity.ArmorStand;
+import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
+// CraftBukkit end
+
 public class EntityArmorStand extends EntityLiving {
 
     public static final int WOBBLE_TIME = 5;
@@ -106,6 +115,13 @@
         this.setPos(d0, d1, d2);
     }
 
+    // CraftBukkit start - SPIGOT-3607, SPIGOT-3637
+    @Override
+    public float getBukkitYaw() {
+        return this.getYRot();
+    }
+    // CraftBukkit end
+
     @Override
     public void refreshDimensions() {
         double d0 = this.getX();
@@ -161,13 +177,20 @@
 
     @Override
     public void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
+        // CraftBukkit start
+        this.setItemSlot(enumitemslot, itemstack, false);
+    }
+
+    @Override
+    public void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack, boolean silent) {
+        // CraftBukkit end
         this.verifyEquippedItem(itemstack);
         switch (enumitemslot.getType()) {
             case HAND:
-                this.onEquipItem(enumitemslot, (ItemStack) this.handItems.set(enumitemslot.getIndex(), itemstack), itemstack);
+                this.onEquipItem(enumitemslot, (ItemStack) this.handItems.set(enumitemslot.getIndex(), itemstack), itemstack, silent); // CraftBukkit
                 break;
             case ARMOR:
-                this.onEquipItem(enumitemslot, (ItemStack) this.armorItems.set(enumitemslot.getIndex(), itemstack), itemstack);
+                this.onEquipItem(enumitemslot, (ItemStack) this.armorItems.set(enumitemslot.getIndex(), itemstack), itemstack, silent); // CraftBukkit
         }
 
     }
@@ -402,7 +425,25 @@
             return false;
         } else if (itemstack1.isEmpty() && (this.disabledSlots & 1 << enumitemslot.getFilterFlag() + 16) != 0) {
             return false;
-        } else if (entityhuman.getAbilities().instabuild && itemstack1.isEmpty() && !itemstack.isEmpty()) {
+            // CraftBukkit start
+        } else {
+            org.bukkit.inventory.ItemStack armorStandItem = CraftItemStack.asCraftMirror(itemstack1);
+            org.bukkit.inventory.ItemStack playerHeldItem = CraftItemStack.asCraftMirror(itemstack);
+
+            Player player = (Player) entityhuman.getBukkitEntity();
+            ArmorStand self = (ArmorStand) this.getBukkitEntity();
+
+            EquipmentSlot slot = CraftEquipmentSlot.getSlot(enumitemslot);
+            EquipmentSlot hand = CraftEquipmentSlot.getHand(enumhand);
+            PlayerArmorStandManipulateEvent armorStandManipulateEvent = new PlayerArmorStandManipulateEvent(player, self, playerHeldItem, armorStandItem, slot, hand);
+            this.level().getCraftServer().getPluginManager().callEvent(armorStandManipulateEvent);
+
+            if (armorStandManipulateEvent.isCancelled()) {
+                return true;
+            }
+
+        if (entityhuman.getAbilities().instabuild && itemstack1.isEmpty() && !itemstack.isEmpty()) {
+            // CraftBukkit end
             this.setItemSlot(enumitemslot, itemstack.copyWithCount(1));
             return true;
         } else if (!itemstack.isEmpty() && itemstack.getCount() > 1) {
@@ -417,15 +458,26 @@
             entityhuman.setItemInHand(enumhand, itemstack1);
             return true;
         }
+        } // CraftBukkit
     }
 
     @Override
     public boolean hurt(DamageSource damagesource, float f) {
         if (!this.level().isClientSide && !this.isRemoved()) {
             if (damagesource.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) {
+                // CraftBukkit start
+                if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) {
+                    return false;
+                }
+                // CraftBukkit end
                 this.kill();
                 return false;
-            } else if (!this.isInvulnerableTo(damagesource) && !this.invisible && !this.isMarker()) {
+            } else if (!this.isInvulnerableTo(damagesource) && (true || !this.invisible) && !this.isMarker()) { // CraftBukkit
+                // CraftBukkit start
+                if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f, true, this.invisible)) {
+                    return false;
+                }
+                // CraftBukkit end
                 if (damagesource.is(DamageTypeTags.IS_EXPLOSION)) {
                     this.brokenByAnything(damagesource);
                     this.kill();
@@ -473,7 +525,7 @@
                             } else {
                                 this.brokenByPlayer(damagesource);
                                 this.showBreakingParticles();
-                                this.kill();
+                                this.discard(); // CraftBukkit - SPIGOT-4890: remain as this.discard() since above damagesource method will call death event
                             }
 
                             return true;
@@ -541,13 +593,13 @@
             itemstack.setHoverName(this.getCustomName());
         }
 
-        Block.popResource(this.level(), this.blockPosition(), itemstack);
+        drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops
         this.brokenByAnything(damagesource);
     }
 
     private void brokenByAnything(DamageSource damagesource) {
         this.playBrokenSound();
-        this.dropAllDeathLoot(damagesource);
+        // this.dropAllDeathLoot(damagesource); // CraftBukkit - moved down
 
         ItemStack itemstack;
         int i;
@@ -555,7 +607,7 @@
         for (i = 0; i < this.handItems.size(); ++i) {
             itemstack = (ItemStack) this.handItems.get(i);
             if (!itemstack.isEmpty()) {
-                Block.popResource(this.level(), this.blockPosition().above(), itemstack);
+                drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops
                 this.handItems.set(i, ItemStack.EMPTY);
             }
         }
@@ -563,10 +615,11 @@
         for (i = 0; i < this.armorItems.size(); ++i) {
             itemstack = (ItemStack) this.armorItems.get(i);
             if (!itemstack.isEmpty()) {
-                Block.popResource(this.level(), this.blockPosition().above(), itemstack);
+                drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops
                 this.armorItems.set(i, ItemStack.EMPTY);
             }
         }
+        this.dropAllDeathLoot(damagesource); // CraftBukkit - moved from above
 
     }
 
@@ -662,8 +715,16 @@
         return this.isSmall();
     }
 
+    // CraftBukkit start
+    @Override
+    public boolean shouldDropExperience() {
+        return true; // MC-157395, SPIGOT-5193 even baby (small) armor stands should drop
+    }
+    // CraftBukkit end
+
     @Override
     public void kill() {
+        org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, drops); // CraftBukkit - call event
         this.remove(Entity.RemovalReason.KILLED);
         this.gameEvent(GameEvent.ENTITY_DIE);
     }
