Because it's a roll, and for three nights the roll can't win. In Minecraft, Java Edition, the game tries to spawn phantoms every minute or two. The sky has to be dark (night, or a thunderstorm), you have to be out under the open sky at sea level or higher, and a roll on your world's difficulty has to pass. Then the game picks a random number below your "Time Since Last Rest", the ticks since you last lay in a bed. Only 72,000 or more brings them: three in-game days.
So for nights one to three the count is too short to ever get there. On night four about one roll in five lands past it, by night six about one in two, and it keeps climbing. Then one to three of them (on Normal) appear 20 to 34 blocks above you. Lie down in a bed, even for a moment, and the count drops to zero. Dying resets it too.
Players voted the phantom in at MINECON Earth 2017, pitched by Mojang's Jens Bergensten as a monster "attracted to insomnia". In 2018 he said: "We wanted it so you can protect yourself either by being in the day or in a cave or by sleeping."
The rule is Java Edition 26.3's code. The odds by night, which tries pass, the hill, the base and the flyers are our own simplified version, drawn in code, and the nights are sped up.
So tonight: bed, or cave?
Sources: Minecraft Java Edition, the game's code in Mojang's release 26.3 (the phantom spawner, the rest statistic, local difficulty, the day timeline); minecraft.net, "Minecraft Snapshot 18w07c" (2018) and "Meet the Phantom" (2018).
Not an official Minecraft video. Not approved by or associated with Mojang or Microsoft.
Sounds and music: our own, made in code.
