A phantom is a flying undead monster that appears in the Overworld around players who have gone without sleep. It circles above its target and swoops down to attack. Its entity ID is minecraft:phantom.
Phantoms can begin appearing after roughly three in-game days without rest, equivalent to about an hour at the normal game speed. This makes a player eligible for spawn attempts. It does not guarantee an immediate spawn. Sleeping resets the rest timer.
In Java Edition, the Overworld spawner checks the player at or above sea level with a clear view of the sky when it is dark enough, as at night or during a thunderstorm. It samples an open spawn position 20–34 blocks above the player. Bedrock Edition uses surface monster spawning rules. Its vanilla spawn definition permits Easy through Hard and uses a brightness filter of 0–7 adjusted for weather.
A phantom circles before diving toward a player to strike at close range. It catches fire in daylight. A nearby cat can interrupt a dive, and Bedrock Edition phantoms also avoid ocelots.
A phantom can drop 0–1 Phantom Membrane before Looting bonuses if the kill is credited to a player. Each Looting level can increase the count by up to one, and the loot roll is separate from the 5 experience points available on an eligible kill. Phantom Membranes repair elytra in an anvil or are used to brew Potions of Slow Falling.
To disable insomnia-based spawning, use /gamerule spawn_phantoms false in Java Edition or /gamerule doinsomnia false in Bedrock Edition. Java Edition checks for nearby cats as part of the swoop. Bedrock Edition uses an avoidance behavior for cats and ocelots that does not require the phantom to see them.