Sleeping
Sleeping in Matcha Flavoured uses the pack's own system instead of the vanilla night skip. Players can sleep at any time of day. Instead of jumping to morning, time speeds up while players are in bed, faster the larger the share of players asleep, until the sleepers wake: in the morning if they went to bed at night, or 12 hours later if they went to bed by day.
Mechanics
Going to bed
Beds in the Overworld can be used at any time, not only at night or during thunderstorms. Since 1.12.7-beta so can straw beds; as in vanilla, a straw bed never sets the player's spawn point and breaks when the player leaves it.[1] The vanilla skip is disabled by setting the players_sleeping_percentage game rule to 200, which can never be reached.[2]
The pack's system starts when a player uses a bed or a straw bed (a block of Minecraft 26.3).[3] When a player lies down, the pack works out how long they will sleep:[4]
- If the time of day is between 36,000 and 69,000 (night, on the pack's 72,000-tick day), the player sleeps until the time reaches 72,000, the start of the next day.
- At any other time, the player sleeps for 36,000 ticks, half a day ("12 hours").
The vanilla "No amount of rest can pass this night" message is cleared, and every sleeping player sees how many players are asleep in the action bar, for example "1/2 players sleeping", using the game's own translated message.[5][6]
Passing time
While at least one player is asleep, the time is advanced every tick by:[7]
- ticks skipped per tick = 300 × (players sleeping ÷ players in the Overworld)²
The result is rounded down. Each sleeping player's remaining sleep goes down by the same amount; when it runs out, they are woken up and the weather is set to clear.[8] The rate is recalculated whenever someone gets into or out of bed.[9]
| Players asleep | Ticks skipped per tick | Real time to sleep 12 hours (36,000 ticks) |
|---|---|---|
| All | 300 | 6 seconds |
| 3 of 4 | 168 | about 11 seconds |
| 1 of 2 | 75 | 24 seconds |
| 1 of 3 | 33 | about 55 seconds |
| 1 of 4 | 18 | 100 seconds |
A single player alone in the Overworld always sleeps at the full rate. In multiplayer, time still passes while only some players sleep, just more slowly, and players in Hell or the End count as neither sleeping nor awake. A player who gets into bed while someone else is already asleep is counted from the next tick on; the pack marks them as just gone to bed so that it does not read them as awake before the game has given them their sleep timer.[10][11]
Weather
Waking up at the end of a full sleep sets the weather to clear. Leaving the bed early does not.
History
| 1.10 | Beds work on first load-in. Sleeping for any amount of time sets the weather to clear. |
|---|---|
| 1.12.2 | Dynamic multiplayer sleep: sleeping at night wakes the player in the morning, while sleeping in the day still skips 12 hours. |
| 1.12.4 | Fixed multiplayer sleep speed: a player who went to bed while another player was already asleep was immediately treated as awake and not counted, so time passed as if only the first player were sleeping.[12][13] |
| 1.12.6-alpha | Straw beds work with the pack's sleeping system: it now starts when a bed or straw bed is used, instead of when the game reports that the player slept in a bed. The players-sleeping message uses the game's translated text.[14][15] |
| 1.12.7-beta | Straw beds can be slept in at any time of day, like beds; before, they could only be used when it was dark.[16][17] |
Trivia
- The dynamic multiplayer sleep system was contributed by milo256.[18]
- The code notes that all of its numbers were multiplied by 3 to match the pack's longer day.[4]
See also
References
- ↑
dimension type/overworld.json - ↑
setup/gamerules.mcfunction - ↑
mechanics/slept in bed.json - ↑ 4.0 4.1
sleeping/calculate sleep duration.mcfunction - ↑
sleeping/on player sleep.mcfunction - ↑
sleeping/notify sleeping players.mcfunction - ↑
sleeping/calculate sleep rate.mcfunction - ↑
sleeping/wake sleeping player.mcfunction - ↑
sleeping/tick sleeping player.mcfunction - ↑
sleeping/on player sleep.mcfunction - ↑
sleeping/tick sleeping player.mcfunction - ↑ Matcha Flavoured 1.12.4 release notes: "Multiplayer Sleep speed"
- ↑
sleeping/tick sleeping player.mcfunction - ↑
mechanics/slept in bed.json - ↑ Matcha Flavoured 1.12.6-alpha release notes: "Straw Beds now work"
- ↑
dimension type/overworld.json - ↑ Matcha Flavoured 1.12.7-beta release notes: "Straw beds can now be slept in during day"
- ↑ Matcha Flavoured 1.12.2 release notes: "Sleeping at night will wake you up in morning, but sleeping in the day still skips 12 hours"
| Health | |
|---|---|
| World |
|
| Items | |
| Undead |
|
| Other hostile mobs |
|
| Bosses | |