6

As far as I know, sleeping in a bed is equivalent to a /time set command, sometimes a /weather clear, plus the spawn point change (as long as the bed is not destroyed).

Given this, would a Command Block with /time set 0; /weather clear be an equivalent substitute? Say for an Adventure map where it is not desirable to allow the player to change the spawn point, yet still necessary to provide a way to skip the night.

Are there any hidden features beyond the time skip, possible weather clearing and spawn change?

2
  • I believe the only difference is that the weather tends to reset to clear after sleeping. (This doesn't always happen though.) Your Command Block solution should be fine.
    – Schism
    Jul 19, 2013 at 16:46
  • @Schism Make that an answer? It's correct and I'd vote it up. Jul 19, 2013 at 17:02

3 Answers 3

9

I have a suggestion for your design problem, rather than the question you asked:

Place a bed surrounded by slabs or other (partially) solid blocks. If you block off all 10 spaces around the bed in this way, then it will function normally for skipping the night, but for respawning the player will spawn at their original spawn point (“Your home bed was missing or obstructed”). Neither slabs nor beds can be broken in adventure mode, so this setup cannot be altered by the player.

(However, it wouldn't be all that surprising if beds were later changed to permit spawning under these conditions, so your proposed command block scheme is possibly more robust against future versions.)

This pictured bed is surrounded by one slab at the foot and stairs elsewhere.

1
  • No blocks can be broken in Adventure mode anyway. Jul 30, 2015 at 20:38
8

The only difference you'll find is that the weather tends to reset back to clear conditions after sleeping. (This doesn't always happen though.) Your Command Block solution should be fine.

5
  • The Minecraft wiki says "If it is already raining or snowing, the weather will stop upon waking.".
    – l0b0
    Jul 19, 2013 at 18:40
  • 2
    @l0b0 It says that, but there's still controversy over it. I've slept through thunderstorms and had it keep on raining for days. Jul 19, 2013 at 18:44
  • @SevenSidedDie My original comment was that I'd never seen rain subside after sleeping, but I thought that had changed in 1.6 (which I haven't played much) after reading the wiki. My bad.
    – l0b0
    Jul 19, 2013 at 19:49
  • Correct me if I'm wrong but don't hostile mobs despawn when you sleep in beds?
    – LTPro
    Jul 23, 2013 at 2:20
  • @LTPro, Numerous times I have waken up and seen hostile mobs. It seems that if you sleep soon enough it prevents spawning, but it never seems to despawn them. Jul 23, 2013 at 14:36
1

Notable events that happen upon waking include:

  • Time change.
  • Weather clear.
  • When you wake up, you'll be placed in front of your bed, not where you were when you right-clicked the bed.
5
  • 5
    You can no longer be woken up by monsters. That was replaced by the restriction that you cannot sleep with monsters nearby.
    – Kevin Reid
    Jul 19, 2013 at 22:11
  • 1
    I can personally attest to the fact that nightmares are gone. My preferred method of exploring is the following: run/ride, note the sun is setting, look around, drop a bed right in the middle of a plain/on top of a hill, lie down right when center of the sun passes the horizon... run more.
    – Orc JMR
    Jul 20, 2013 at 4:26
  • @KevinReid Oh yeah, never noticed that... I just always put a torch above my bed.
    – Caelum19
    Jul 21, 2013 at 17:05
  • Actually,you can be mobs can wake you up. If there is any hostile mob within 8 blocks,you can't sleep. But let's say there is a skeleton at a range of 9 blocks. It comes closer and shoots an arrow while the player camera is getting darker. The player will is hit and he wakes up. Creepers can also be a trouble too. Once I slept in the mine and a creeper came and blasted just when I got out of the bed. @KevinReid
    – John
    Jul 28, 2015 at 11:15
  • If the front of the bed is obstructed,you will wake up on a different side. Also,when all the side are obstructed (including front,rear,and perhaps,up and down) the player will wake up into the wall and suffocate. Happened to me short time ago (yesterday or the day before,I think,in the moment of writing) but fortunately,I mined that wall. So be careful where you put your bed.
    – John
    Jul 28, 2015 at 11:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .