--- a/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java
+++ b/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java
@@ -20,9 +20,8 @@
 import net.minecraft.world.level.pathfinder.PathType;
 
 public abstract class AbstractPiglin extends Monster {
-    protected static final EntityDataAccessor<Boolean> DATA_IMMUNE_TO_ZOMBIFICATION = SynchedEntityData.defineId(
-        AbstractPiglin.class, EntityDataSerializers.BOOLEAN
-    );
+
+    protected static final EntityDataAccessor<Boolean> DATA_IMMUNE_TO_ZOMBIFICATION = SynchedEntityData.defineId(AbstractPiglin.class, EntityDataSerializers.BOOLEAN);
     protected static final int CONVERSION_TIME = 300;
     public int timeInOverworld;
 
@@ -36,24 +35,25 @@
 
     private void applyOpenDoorsAbility() {
         if (GoalUtils.hasGroundPathNavigation(this)) {
-            ((GroundPathNavigation)this.getNavigation()).setCanOpenDoors(true);
+            ((GroundPathNavigation) this.getNavigation()).setCanOpenDoors(true);
         }
+
     }
 
     protected abstract boolean canHunt();
 
     public void setImmuneToZombification(boolean immuneToZombification) {
-        this.getEntityData().set(DATA_IMMUNE_TO_ZOMBIFICATION, immuneToZombification);
+        this.getEntityData().set(AbstractPiglin.DATA_IMMUNE_TO_ZOMBIFICATION, immuneToZombification);
     }
 
     public boolean isImmuneToZombification() {
-        return this.getEntityData().get(DATA_IMMUNE_TO_ZOMBIFICATION);
+        return (Boolean) this.getEntityData().get(AbstractPiglin.DATA_IMMUNE_TO_ZOMBIFICATION);
     }
 
     @Override
     protected void defineSynchedData(SynchedEntityData.Builder builder) {
         super.defineSynchedData(builder);
-        builder.define(DATA_IMMUNE_TO_ZOMBIFICATION, false);
+        builder.define(AbstractPiglin.DATA_IMMUNE_TO_ZOMBIFICATION, false);
     }
 
     @Override
@@ -77,15 +77,16 @@
     protected void customServerAiStep() {
         super.customServerAiStep();
         if (this.isConverting()) {
-            this.timeInOverworld++;
+            ++this.timeInOverworld;
         } else {
             this.timeInOverworld = 0;
         }
 
         if (this.timeInOverworld > 300) {
             this.playConvertedSound();
-            this.finishConversion((ServerLevel)this.level());
+            this.finishConversion((ServerLevel) this.level());
         }
+
     }
 
     public boolean isConverting() {
@@ -93,10 +94,17 @@
     }
 
     protected void finishConversion(ServerLevel world) {
-        ZombifiedPiglin zombifiedPiglin = this.convertTo(EntityType.ZOMBIFIED_PIGLIN, true);
-        if (zombifiedPiglin != null) {
-            zombifiedPiglin.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0));
+        ZombifiedPiglin entitypigzombie = (ZombifiedPiglin) this.convertTo(EntityType.ZOMBIFIED_PIGLIN, true, org.bukkit.event.entity.EntityTransformEvent.TransformReason.PIGLIN_ZOMBIFIED, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.PIGLIN_ZOMBIFIED); // CraftBukkit - add spawn and transform reasons
+
+        if (entitypigzombie != null) {
+            entitypigzombie.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0));
+        }
+        // Paper start - Fix issues with mob conversion; reset to prevent event spam
+        else {
+            this.timeInOverworld = 0;
         }
+        // Paper end - Fix issues with mob conversion
+
     }
 
     public boolean isAdult() {
@@ -120,6 +128,7 @@
         if (PiglinAi.isIdle(this)) {
             super.playAmbientSound();
         }
+
     }
 
     @Override
