Set night
Switch to nighttime: perfect for farming mobs and looking for phantoms.
Commands
/time set night Sets night (13,000 ticks)
/time set midnight Sets midnight (18,000 ticks)
/time set 13000 Sets night with a precise value (13,000 ticks)
/time add 12000 Moves time forward by half a day (turns day into night)
How it works
Night in Minecraft is when hostile mobs come out: zombies, skeletons, creepers, spiders and endermen. The /time set night command sets the time to 13,000 ticks, the start of the night. A value of 18,000 is midnight, the darkest point of the night.Night is key for many mob farms: more darkness means more spawns. Phantoms only appear after 3 days without sleep (72,000 ticks), so setting night again and again without sleeping in a bed brings them out sooner. At night, hostile mobs spawn on surface blocks with a light level of 0 (Java Edition 1.18+). On multiplayer servers, night can be a problem, since not everyone wants to fight mobs. That's why /gamerule playersSleepingPercentage 1 is a popular command: it lets one player sleep through the night for everyone.
Practical tips
Night lasts from 13,000 to 23,000 ticks.
Hostile mobs start spawning at light level 0.
/time add 12000 skips ahead half a day, which is handy for switching quickly between day and night.
Phantoms appear after 72,000 ticks (3 days) without sleep.