Spawn Egg

A spawn egg is an item used to spawn mobs directly.

Obtaining
Spawn eggs can be obtained only in Creative mode or using commands. In Creative mode, the player can press pick block on an existing mob to obtain their respective egg. Spawn eggs are also available in the Creative inventory. There are 66 eggs in Bedrock Edition and 64 eggs in Java Edition.

Usage
A spawn egg is used by pressing use on any surface (top, bottom, or side) with the egg. When used on a top surface, the egg's mob appears with its feet immediately adjacent to the surface, and its ambient sound is played.

Spawn eggs are not thrown (unlike normal eggs); the player must be within normal range of the block to use the spawn egg. Hostile and neutral mobs (except wolves, polar bears, pandas, dolphins, llamas, bees, vindicators, evokers, shulkers, zoglins, hoglins, piglin brutes‌[Bedrock Edition only], and piglins) spawned while on Peaceful difficulty get created and immediately deleted from the world.

The surfaces of blocks are prioritized for spawning; if none are within reach, mobs can also be spawned in water.

Dispensers
A spawn egg fired from a dispenser spawns the mob directly in front of the dispenser.

Baby mobs
If the player uses a spawn egg on the type of mob it spawns, and that mob has a baby form, the egg will spawn a baby version of the mob. In mobs that can breed, the baby is created by breeding the clicked mob to itself. For instance, using a sheep spawn egg on a sheep will make a baby sheep with the same wool color. ‌[Java Edition only]

Other mobs such as evokers, vindicators, and vexes do not have a baby form, so the egg will still spawn an adult.

Spawners
All spawn eggs can also be used on a spawner to change the mob the spawner spawns. In Bedrock Edition, spawn eggs for any of the fish mobs spawn them only if the spawner is waterlogged.

Renaming
A spawn egg can be renamed on an anvil, and when used it spawns a mob with that name appearing over its head. The name can be seen only by aiming at the mob from four or fewer blocks away. This name also appears in death messages from the mob killing a player. If the player renames a spawn egg by the names described below, the mob appears described below. If the player renames a rabbit spawn egg "Toast", the secret skin of the rabbit appears when the egg is used. Naming a spawn egg "Dinnerbone" or "Grumm" causes the mob to appear upside down and show the given name above it. Renaming a vindicator "Johnny" causes it to act hostile to all mobs except for other illagers. Renaming a Sheep "jeb_" makes the sheep change colors (in a rainbow loop). This doesn't change the color of the wool you get from the sheep. Renaming a spawn egg of a hostile mob with an anvil and then spawning a hostile mob with the renamed spawn egg will not make the hostile mob despawn proof unlike using a name tag.