--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
@@ -1233,7 +1233,7 @@
                 if (this.level() instanceof ServerLevel) {
                     SpawnEggItem spawneggitem = (SpawnEggItem)itemstack.getItem();
                     Optional<Mob> optional = spawneggitem.spawnOffspringFromSpawnEgg(
-                        p_21500_, this, this.getType(), (ServerLevel)this.level(), this.position(), itemstack
+                        p_21500_, this, (EntityType<? extends Mob>)this.getType(), (ServerLevel)this.level(), this.position(), itemstack
                     );
                     optional.ifPresent(p_21476_ -> this.onOffspringSpawnedFromEgg(p_21500_, p_21476_));
                     return optional.isPresent() ? InteractionResult.SUCCESS : InteractionResult.PASS;
