This is a question, not yet the answer, although I'm hopeful the unequivocal answer will be available here soon.
I believe there are several environmental factors that must be correct in order for a spawner to be successfully converted with a spawn egg, and that some of them vary depending on the egg type. My best guess on the environmental contitions are:
- air or water surround the spawner depending on if the egg is a land or sea animal.
- the spawn area should be dark, or light depending on the type of animal.
- the ground under the spawner must sometimes be appropriate to the animal such as mycelium for a mooshroom and grass for sheep.
- the ground level can sometimes allow open air below the spawner and other times must be directly under the spawner.
- the egg must be placed at the right time, guessing after it does a spawn poof, not right at the same time the spawner is poofing.
These are my guesses as a starting point for discussion.
Does anyone know once the spawner has been set can a change in environment cause it to revert?