mojira.dev
MCPE-42881

Infinite Death Loop With Beds

This is a fairly big issue to explain, with a lot of aspects so here goesπŸ™‚

Normally when you sleep thru the night in a bed, it will always kick you to the north west corner of the pillow, if it can. That north west corner is now your respawn spot, and you will always respawn right there. Once you die and then respawn on that north west corner, the game thinks that area is safe for spawning.

What you can do from this point is build a pillar to sky limit on that north west block, and the next time you die, you will spawn on top of that sky pillar. At Y255 if you made it that tall.

You can also remove all the blocks on the north west corner going down to bedrock, and when you respawn at your bed you will instantly fall to your death.

So basically after you respawn at your bed once, it stops making sure where you spawn is actually safe. Leading to extremely easy ways to troll players, and get into infinite death loops.

Footage of this bug and how to reproduce. Skip to 3:37
https://www.youtube.com/watch?v=9AgSEVfJicE

Linked issues

Comments 6

This issue should be fixed along with MCPE-39261 in the latest beta - are you able to reproduce the problem in 1.11.0.3+?

Oh i have no idea, i don't have a device i am willing to sacrifice in order to play in the beta's πŸ˜… I guess i can see if anyone in know is playing that beta, and maybe have them run some tests.

If it is removed in the beta, may i suggest leaving this report open until full release? Things do get through the filters and into the full releases: )

There isn't actually any connection between where the game places you when you wake up and your respawn point. Your wakeup point is determined by searching 12 blocks around and in the bed in a particular order looking for a solid block below the bed level with two blocks of air (or a bed and one block of air) above it. There is a bug here that is still in 1.11.0.3, namely that it can place you inside a solid block 2 above the bed, or 3 above if all of the positions are ineligible.

In contrast, your respawn point is set to the block you're standing on when you "use" (right-click for keyboard/mouse) the bed. It could be the same block, but just by coincidence. Once set, you can't use the same bed to set it again even if you break and re-place it; you either have to break it and die to reset it, or set a respawn point using a bed in a different position to change it. If you break the bed and re-place it with the head in the same place, your respawn point is still remembered, even if you place the bed in a different orientation.

When you die, the game tests your last bed's coordinates to see if there's the head of a bed there. (It doesn't care if it was broken in the between time, only that there's one there when you die.) If not, it respawns you at the world spawn coordinates. It uses the X and Z coordinates and searches downwards from Y=32767, and spawns you at the first non-air block.

If there's a bed and you've set a respawn point, it first checks whether there's air below it. If not, it searches upwards for a 2-block gap and spawns you there. The gap can have non-full-size blocks in it, like a rail or crafting table. If the block below your respawn point is air, it checks the blocks to the north, west, and northwest for a spawnable block with a 2-block gap immediately above it and spawns you there if it finds one. As a last resort, it spawns you above the air and lets you fall.

Wherever you spawn, if there's a partial block there, a collision will be detected after you're spawned and you'll be nudged toward the edge. I haven't seen it happen that you get pushed out of the block entirely and possibly fall, but I haven't ruled it out either.

Updated to include 1.10

I was asked by Mega_Spud to provide reproduction steps for this issue.

First I re-tested the game mechanics I described above in my 5 March comment. I described two game mechanics:

  • Choosing the location where the player is placed when they wake up (or when they leave the bed). I will call this the wakeup mechanic. I found that this mechanic still works exactly the way I described it.

  • Choosing the location where to respawn a player after death. I will call this the respawn mechanic. This mechanic appears to have changed since release 1.9 or 1.10.

The original report was based on a conflated understanding of these mechanics, and it's therefore very difficult to follow in light of the actual game logic. However, the motivation for the report was that these mechanics could be used to troll a player, or could place a player in an infinite death loop (either accidentally or as a troll). That remains possible, though it's no longer as easy as it used to be. I will describe two scenarios, one for each of the mechanics, and give reproduction steps for creating these undesirable consequences separately for each.

Consequences of the Wakeup Mechanic

The weakness in this logic is that if the game can't find a valid place for the player in the 12 blocks surrounding (and including) the bed, it has a fallback default of placing the player on the head half of the bed. The game doesn't check for an obstruction when it employs this fallback, so it's possible for the player to be placed with their head inside a solid block, leading to suffocation.

Steps to reproduce:

  1. Place a bed somewhere the ground is level for at two blocks on every side of it. The ground must consist of solid blocks.

  2. Place 10 solid blocks adjacent to the bed, 2 solid blocks above the head of the bed, and 1 solid block above the foot of the bed.

  3. Dig a short tunnel below ground to get access to the underside of the bed.

  4. Enter the bed.

Results:
Player is placed on the head of the bed, with their head inside the solid blocks above the bed. In survival mode, player suffocates.

Note that it would be almost impossible for this scenario to occur by accident, because it requires the bed be completely encased in solid blocks. The player would then not be able to enter the bed easily.

Consequences of the Respawn Mechanic

When a player respawns at world spawn, the mechanic seems to have been changed so that instead of dropping the player down a hole or searching for an air gap above an obstructed world spawn block, the game now searches the vicinity for a safe surface on which to spawn the player. This might be exploitable for trolling by filling the entire vicinity with tall stacks of blocks, but it's not likely the troll would be able to do this without being discovered or that they would want to put in the amount of work and resources it would take to do it, especially considering that the respawned player could get safely down by breaking the blocks by hand (unless they starve to death before reaching the bottom).

Likewise, when a player respawns at their respawn point, the mechanic has been changed so that instead of dropping the player down a hole, the game does the same search for a spawnable block in the vicinity. However, unlike with world spawn, the vicinity search is not done if the respawn point is obstructed. Instead, the game continues to use the earlier logic of searching upward for two air blocks and placing the player there. This would be easier for a troll to exploit because only a single tall column of blocks would need to be built. It could also happen by accident if the player were to build on top of their respawn point without realizing it. Nevertheless, as for spawning at world spawn, the severity of the problem is limited by the player's ability to mine themselves down by hand.

Note: I have not studied how the vicinity search logic works. I expect it's influenced by the new Respawn Distance world setting, but I have no idea how it might search vertically for a spawnable block. There might therefore be additional vulnerabilities in its logic which could be exploited by a troll.

Steps to reproduce:

  1. Place a bed in a level area and stand next to it.

  2. Set the time to noon.

  3. Set your respawn point by using the bed.

  4. Mark the block you're standing on as your respawn point. For example, replace it with a gold block.

  5. Stack an arbitrary number of solid blocks on top of your respawn point.

  6. Stand on the ground and get into survival mode.

  7. Commit suicide.

Results:
When you respawn, you are placed in the first 2-block high air gap in the column of blocks, or on the top block.

Resolving issues that were marked as fixed in the 1.15 and 1.16 Betas, now that 1.16.0 is being released.

silentwisperer

(Unassigned)

189226, 291892, 351198

Confirmed

Windows

window 10

1.14.2.50 Beta, 1.13.1, 1.14.1 Hotfix, 1.9.0, 1.11.0.8 Beta, 1.10.0, 1.11.4, 1.14.1.2 Beta, 1.14.0

1.16.0.63 Beta, 1.16.0

Retrieved