Updated:

One player is enough

VersionCommand
Java 1.21.11 and later/gamerule minecraft:players_sleeping_percentage 0
Java 1.17 – 1.21.10/gamerule playersSleepingPercentage 0
Bedrock Edition/gamerule playerssleepingpercentage 0

The value is the percentage of players who must be in bed. 0 means a single sleeping player skips the night, 50 means half of the players, and the default 100 means everyone.

Good values

ValueEffect
0Any one player can skip the night
50Half of the online players must sleep
100Everyone must sleep (default)
Over 100Sleeping never skips the night

How the percentage is counted

The game rounds up, and at least one player always has to sleep. With 5 players online and the rule at 50, 2.5 rounds up to 3 sleepers. Players in spectator mode are not counted, and players in the Nether or the End are not counted either, so they do not block the night from passing.

Players onlineRule valueSleepers needed
401
4251
5503
10303

Stop phantoms as well

When one player sleeps for everyone, the others never rest and phantoms start to appear for them after three nights. Turn phantoms off if that bothers your group:

VersionCommand
Java 1.21.11 and later/gamerule minecraft:spawn_phantoms false
Java 1.21.10 and earlier/gamerule doInsomnia false
Bedrock/gamerule doinsomnia false

Skip the night with a command

/time set day

Anyone with command access can skip to morning without a bed. See the time command guide for how Java 26.1 changed what this does to the day count.

Common problems

Other renamed rules are listed in the gamerule list.

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.