--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -74,7 +74,7 @@
 
     @Override
     public BehaviorController<Tadpole> getBrain() {
-        return super.getBrain();
+        return (BehaviorController<Tadpole>) super.getBrain(); // CraftBukkit - decompile error
     }
 
     @Override
@@ -225,12 +225,17 @@
         World world = this.level();
 
         if (world instanceof WorldServer worldserver) {
-            this.convertTo(EntityTypes.FROG, ConversionParams.single(this, false, false), (frog) -> {
+            Frog converted = this.convertTo(EntityTypes.FROG, ConversionParams.single(this, false, false), (frog) -> { // CraftBukkit
                 frog.finalizeSpawn(worldserver, this.level().getCurrentDifficultyAt(frog.blockPosition()), EntitySpawnReason.CONVERSION, (GroupDataEntity) null);
                 frog.setPersistenceRequired();
                 frog.fudgePositionAfterSizeChange(this.getDimensions(this.getPose()));
                 this.playSound(SoundEffects.TADPOLE_GROW_UP, 0.15F, 1.0F);
-            });
+            // CraftBukkit start
+            }, org.bukkit.event.entity.EntityTransformEvent.TransformReason.METAMORPHOSIS, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.METAMORPHOSIS);
+            if (converted == null) {
+                this.setAge(0); // Sets the age to 0 for avoid a loop if the event is canceled
+            }
+            // CraftBukkit end
         }
 
     }
