I accidentally clicked on the door of a blacksmith house with the villager spawn egg in hand, and then it spawned a villager somewhere inside the roof of the house. At first I could not even see it, as it was stuck inside the walls, and therefore I thought my egg had just vanished uselessly.
When using the egg, maybe it's possible to check if there is free space to spawn the villager (i.e. 2 blocks of air). If there's no space, don't spawn the villager.
I accidentally clicked on the door of a blacksmith house with the villager spawn egg in hand, and then it spawned a villager somewhere inside the roof of the house. At first I could not even see it, as it was stuck inside the walls, and therefore I thought my egg had just vanished uselessly.
When using the egg, maybe it's possible to check if there is free space to spawn the villager (i.e. 2 blocks of air). If there's no space, don't spawn the villager.