--- a/net/minecraft/world/item/ArmorItem.java
+++ b/net/minecraft/world/item/ArmorItem.java
@@ -1,12 +1,14 @@
 package net.minecraft.world.item;
 
 import com.google.common.collect.ImmutableMultimap;
+import com.google.common.collect.ImmutableMultimap.Builder;
 import com.google.common.collect.Multimap;
 import java.util.EnumMap;
 import java.util.List;
 import java.util.UUID;
 import net.minecraft.Util;
 import net.minecraft.core.BlockPos;
+import net.minecraft.core.Direction;
 import net.minecraft.core.dispenser.BlockSource;
 import net.minecraft.core.dispenser.DefaultDispenseItemBehavior;
 import net.minecraft.core.dispenser.DispenseItemBehavior;
@@ -24,13 +26,19 @@
 import net.minecraft.world.level.Level;
 import net.minecraft.world.level.block.DispenserBlock;
 import net.minecraft.world.phys.AABB;
+// CraftBukkit start
+import org.bukkit.craftbukkit.v1_20_R2.block.CraftBlock;
+import org.bukkit.craftbukkit.v1_20_R2.inventory.CraftItemStack;
+import org.bukkit.event.block.BlockDispenseArmorEvent;
+// CraftBukkit end
 
 public class ArmorItem extends Item implements Equipable {
-    private static final EnumMap<ArmorItem.Type, UUID> ARMOR_MODIFIER_UUID_PER_TYPE = Util.make(new EnumMap<>(ArmorItem.Type.class), (uuidMap) -> {
-        uuidMap.put(ArmorItem.Type.BOOTS, UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"));
-        uuidMap.put(ArmorItem.Type.LEGGINGS, UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"));
-        uuidMap.put(ArmorItem.Type.CHESTPLATE, UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"));
-        uuidMap.put(ArmorItem.Type.HELMET, UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150"));
+
+    private static final EnumMap<ArmorItem.Type, UUID> ARMOR_MODIFIER_UUID_PER_TYPE = (EnumMap) Util.make(new EnumMap(ArmorItem.Type.class), (enummap) -> {
+        enummap.put(ArmorItem.Type.BOOTS, UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"));
+        enummap.put(ArmorItem.Type.LEGGINGS, UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"));
+        enummap.put(ArmorItem.Type.CHESTPLATE, UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"));
+        enummap.put(ArmorItem.Type.HELMET, UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150"));
     });
     public static final DispenseItemBehavior DISPENSE_ITEM_BEHAVIOR = new DefaultDispenseItemBehavior() {
         @Override
@@ -46,20 +54,50 @@
     private final Multimap<Attribute, AttributeModifier> defaultModifiers;
 
     public static boolean dispenseArmor(BlockSource pointer, ItemStack armor) {
-        BlockPos blockPos = pointer.pos().relative(pointer.state().getValue(DispenserBlock.FACING));
-        List<LivingEntity> list = pointer.level().getEntitiesOfClass(LivingEntity.class, new AABB(blockPos), EntitySelector.NO_SPECTATORS.and(new EntitySelector.MobCanWearArmorEntitySelector(armor)));
+        BlockPos blockposition = pointer.pos().relative((Direction) pointer.state().getValue(DispenserBlock.FACING));
+        List<LivingEntity> list = pointer.level().getEntitiesOfClass(LivingEntity.class, new AABB(blockposition), EntitySelector.NO_SPECTATORS.and(new EntitySelector.MobCanWearArmorEntitySelector(armor)));
+
         if (list.isEmpty()) {
             return false;
         } else {
-            LivingEntity livingEntity = list.get(0);
-            EquipmentSlot equipmentSlot = Mob.getEquipmentSlotForItem(armor);
-            ItemStack itemStack = armor.split(1);
-            livingEntity.setItemSlot(equipmentSlot, itemStack);
-            if (livingEntity instanceof Mob) {
-                ((Mob)livingEntity).setDropChance(equipmentSlot, 2.0F);
-                ((Mob)livingEntity).setPersistenceRequired();
+            LivingEntity entityliving = (LivingEntity) list.get(0);
+            EquipmentSlot enumitemslot = Mob.getEquipmentSlotForItem(armor);
+            ItemStack itemstack1 = armor.copyWithCount(1); // Paper - shrink below and single item in event
+            // CraftBukkit start
+            Level world = pointer.level();
+            org.bukkit.block.Block block = CraftBlock.at(world, pointer.pos());
+            CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
+
+            BlockDispenseArmorEvent event = new BlockDispenseArmorEvent(block, craftItem.clone(), (org.bukkit.craftbukkit.v1_20_R2.entity.CraftLivingEntity) entityliving.getBukkitEntity());
+            if (!DispenserBlock.eventFired) {
+                world.getCraftServer().getPluginManager().callEvent(event);
+            }
+
+            if (event.isCancelled()) {
+                // armor.grow(1); // Paper - shrink below
+                return false;
             }
 
+            boolean shrink = true; // Paper
+            if (!event.getItem().equals(craftItem)) {
+                shrink = false; // Paper - shrink below
+                // Chain to handler for new item
+                ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
+                DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
+                if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != ArmorItem.DISPENSE_ITEM_BEHAVIOR) {
+                    idispensebehavior.dispense(pointer, eventStack);
+                    return true;
+                }
+            }
+
+            entityliving.setItemSlot(enumitemslot, CraftItemStack.asNMSCopy(event.getItem()));
+            // CraftBukkit end
+            if (entityliving instanceof Mob) {
+                ((Mob) entityliving).setDropChance(enumitemslot, 2.0F);
+                ((Mob) entityliving).setPersistenceRequired();
+            }
+
+            if (shrink) armor.shrink(1); // Paper
             return true;
         }
     }
@@ -71,13 +109,14 @@
         this.defense = material.getDefenseForType(type);
         this.toughness = material.getToughness();
         this.knockbackResistance = material.getKnockbackResistance();
-        DispenserBlock.registerBehavior(this, DISPENSE_ITEM_BEHAVIOR);
-        ImmutableMultimap.Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder();
-        UUID uUID = ARMOR_MODIFIER_UUID_PER_TYPE.get(type);
-        builder.put(Attributes.ARMOR, new AttributeModifier(uUID, "Armor modifier", (double)this.defense, AttributeModifier.Operation.ADDITION));
-        builder.put(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(uUID, "Armor toughness", (double)this.toughness, AttributeModifier.Operation.ADDITION));
+        DispenserBlock.registerBehavior(this, ArmorItem.DISPENSE_ITEM_BEHAVIOR);
+        Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder();
+        UUID uuid = (UUID) ArmorItem.ARMOR_MODIFIER_UUID_PER_TYPE.get(type);
+
+        builder.put(Attributes.ARMOR, new AttributeModifier(uuid, "Armor modifier", (double) this.defense, AttributeModifier.Operation.ADDITION));
+        builder.put(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(uuid, "Armor toughness", (double) this.toughness, AttributeModifier.Operation.ADDITION));
         if (material == ArmorMaterials.NETHERITE) {
-            builder.put(Attributes.KNOCKBACK_RESISTANCE, new AttributeModifier(uUID, "Armor knockback resistance", (double)this.knockbackResistance, AttributeModifier.Operation.ADDITION));
+            builder.put(Attributes.KNOCKBACK_RESISTANCE, new AttributeModifier(uuid, "Armor knockback resistance", (double) this.knockbackResistance, AttributeModifier.Operation.ADDITION));
         }
 
         this.defaultModifiers = builder.build();
@@ -130,17 +169,15 @@
     }
 
     public static enum Type {
-        HELMET(EquipmentSlot.HEAD, "helmet"),
-        CHESTPLATE(EquipmentSlot.CHEST, "chestplate"),
-        LEGGINGS(EquipmentSlot.LEGS, "leggings"),
-        BOOTS(EquipmentSlot.FEET, "boots");
+
+        HELMET(EquipmentSlot.HEAD, "helmet"), CHESTPLATE(EquipmentSlot.CHEST, "chestplate"), LEGGINGS(EquipmentSlot.LEGS, "leggings"), BOOTS(EquipmentSlot.FEET, "boots");
 
         private final EquipmentSlot slot;
         private final String name;
 
-        private Type(EquipmentSlot equipmentSlot, String name) {
-            this.slot = equipmentSlot;
-            this.name = name;
+        private Type(EquipmentSlot enumitemslot, String s) {
+            this.slot = enumitemslot;
+            this.name = s;
         }
 
         public EquipmentSlot getSlot() {
