In Minecraft, the player cannot sleep if a hostile mob is near. The display message reads: "You may not rest now, there are monsters nearby."