Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-15125

Cannot wake up safely from bed despite seemingly enough space to do so.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • None
    • Minecraft 1.5.2, Snapshot 13w18c, Minecraft 1.7.9
    • Multiple.
    • Confirmed

      tl;dr:
      A bed placed in a 1x2x2 space with a chest in the floor at the foot end of the bed spawns the player with it's head in the ceiling.
      ---------------------------------------------------------------

      This bug relates to MC-9529, however we see that no half-slab need to be involved here, and that there IS enough available air block space that SHOULD allow waking up safely.

      BUG EFFECT: When waking up from sleeping in a bed, EVEN if there is an available air block beside the bed, if that air block is not over a solid block then it won't be considered a valid "bed exit" block, making the player wake up on the bed itself. Now, when the roof is 3 high that isn't a problem. However, when the roof is only 2 high, this causes suffocation and if the player can't break the block his head is stuck inside in time, then he dies.

      See images below:

      1st image: Setup, bed with an air block at it's feet, however that air block is over a transparent block, here a chest.

      2nd image: The view from sleeping in the bed.

      3rd image: View upon waking up. Instead of waking up safely at the feet of the bed, we wake up with our head in the roof. Here I chose to make the roof out of glowstone because for some reason Steve doesn't seem to suffocate when his head is stuck inside it.

      4th image: Same position, looking downward a bit.

      5th image: Same position, after breaking the glowstone.

      > Block attributes I use am using here:

      'Pass-through' block: if a block type allows movement in all directions, then it has that flag set. Includes all blocks that don't have hitboxes. Examples: Air, most small vegetation like roses, saplings and crops, vines, paintings, item frames, etc.

      'Half-block': Any block type that will block movement only in either it's upper half or lower half will have this flag set plus a way to know which half of the block is filled. This attribute is often prefixed with "lower or upper" to indicate which half is filled.

      > Suggested fix:

      When checking for places to let the player out of a bed, the condition should not be:

      "Both feet and head in an air block, and feet over a solid block."

      but should be instead

      "Both feet and head in an air block, and feet NOT over a 'pass-through' block"

      A more "detailed" condition could be:

      IF
      head in a pass-through block, and feet in a pass-through block, and feet not over a pass-through block
      THEN
      This is a valid 'primary importance' exit spot.
      OTHERWISE IF
      head in a upper-half-block, and feet in a pass-through block, and feet over a lower-half-block
      THEN
      This is a valid 'secondary importance' exit spot.

      (in short the game should checks all potential exist spots in order of ideal preference, and stops going through the list when it finds a good spot).

      And in all cases, upon waking up, if the block below is a half-block, then the player appears in the block below already at the 'half-block' elevation (instead of dropping by one half block)

      Also, spots to be checked should be all those around the bed (ortogonally) PLUS ALSO all those around the bed but at a +1 elevation (total of 12 potential exit spots). If all that fails, then the 2 spots rght above the bed are checked.

      Also, all exit spots should also be checked when trying to GO TO SLEEP, and if no valid spot is found then the "switch player position to bed's position" should actually be completely prevented with this chat message:

      "Cannot rest when there is no place to wake up from the bed."

      > Conclusion:

      This would allow players to be able to place "recessed" beds (aka "japanese style" beds) (ok, that part is more like a feature request not a bug per se) and would also fix most of these suffocation problems (this really adresses the "this is a feature not a bug" part).

        1. 2013-05-03_16.42.36.png
          2013-05-03_16.42.36.png
          173 kB
        2. 2013-05-03_16.42.53.png
          2013-05-03_16.42.53.png
          136 kB
        3. 2013-05-03_16.43.22.png
          2013-05-03_16.43.22.png
          74 kB
        4. 2013-05-03_16.43.30.png
          2013-05-03_16.43.30.png
          247 kB
        5. 2013-05-03_16.43.41.png
          2013-05-03_16.43.41.png
          119 kB

            Unassigned Unassigned
            ouatcheur Patrick Rannou
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: