mojira.dev
MC-277487

The game softlocks when attempting to create a new world if the saves folder is not writable

If the game is unable to write inside the saves folder in the game's installation folder, the game gets stuck in the “Preparing for world creation…” screen when clicking "Create New World," or "Singleplayer" if there are no worlds.

How to reproduce:

It would probably be a good idea to test these steps in a newly created installation folder.

  1. Edit the permissions for the game's saves folder so that the current user can't write inside it.

  2. Launch the game.

  3. Click on "Singleplayer."
    → ❌ If you don't have any worlds in this installation, the game opens the “Preparing for world creation…” screen and gets stuck there, with no way to get out of it other than to close the game.

  4. If you do have some worlds, click on "Create New World."
    → ❌ The game opens the “Preparing for world creation…” screen and gets stuck there, with no way to get out of it other than to close the game.

Expected result:

Some sort of error screen would appear, much like the "out of memory" screen or the "unable to load worlds" screen.

Observed result:

The game logs an exception and remains in the “Preparing for world creation…” screen until the game is forcibly closed.

Stack trace:

net.minecraft.ReportedException: mouseClicked event handler
	at net.minecraft.client.MouseHandler.onButton(MouseHandler.java:133)
	at net.minecraft.client.MouseHandler.lambda$setup$4(MouseHandler.java:244)
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:169)
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23)
	at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:111)
	at net.minecraft.client.MouseHandler.lambda$setup$5(MouseHandler.java:244)
	at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43)
	at org.lwjgl.system.JNI.invokeV(Native Method)
	at org.lwjgl.glfw.GLFW.glfwWaitEventsTimeout(GLFW.java:3509)
	at com.mojang.blaze3d.systems.RenderSystem.limitDisplayFPS(RenderSystem.java:154)
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1414)
	at net.minecraft.client.Minecraft.run(Minecraft.java:966)
	at net.minecraft.client.main.Main.main(Main.java:248)
Caused by: java.lang.RuntimeException: Could not create save folder
	at net.minecraft.client.gui.screens.worldselection.WorldCreationUiState.findResultFolder(WorldCreationUiState.java:103)
	at net.minecraft.client.gui.screens.worldselection.WorldCreationUiState.<init>(WorldCreationUiState.java:60)
	at net.minecraft.client.gui.screens.worldselection.CreateWorldScreen.<init>(CreateWorldScreen.java:406)
	at net.minecraft.client.gui.screens.worldselection.CreateWorldScreen.openCreateWorldScreen(CreateWorldScreen.java:377)
	at net.minecraft.client.gui.screens.worldselection.CreateWorldScreen.openFresh(CreateWorldScreen.java:318)
	at net.minecraft.client.gui.screens.worldselection.CreateWorldScreen.openFresh(CreateWorldScreen.java:305)
	at net.minecraft.client.gui.screens.worldselection.WorldSelectionList.handleNewLevels(WorldSelectionList.java:173)
	at net.minecraft.client.gui.screens.worldselection.WorldSelectionList.<init>(WorldSelectionList.java:126)
	at net.minecraft.client.gui.screens.worldselection.WorldSelectionList$Builder.build(WorldSelectionList.java:742)
	at net.minecraft.client.gui.screens.worldselection.SelectWorldScreen.init(SelectWorldScreen.java:75)
	at net.minecraft.client.gui.screens.Screen.init(Screen.java:326)
	at net.minecraft.client.Minecraft.setScreen(Minecraft.java:1237)
	at net.minecraft.client.gui.screens.TitleScreen.lambda$createNormalMenuOptions$8(TitleScreen.java:148)
	at net.minecraft.client.gui.components.Button.onPress(Button.java:109)
	at net.minecraft.client.gui.components.AbstractButton.onClick(AbstractButton.java:53)
	at net.minecraft.client.gui.components.AbstractWidget.mouseClicked(AbstractWidget.java:122)
	at net.minecraft.client.gui.components.events.ContainerEventHandler.mouseClicked(ContainerEventHandler.java:46)
	at net.minecraft.client.gui.screens.TitleScreen.mouseClicked(TitleScreen.java:277)
	at net.minecraft.client.MouseHandler.onButton(MouseHandler.java:122)
	... 12 more
Caused by: java.nio.file.AccessDeniedException: \AppData\Roaming\.minecraft\saves\World
	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.createDirectory(WindowsFileSystemProvider.java:527)
	at java.base/java.nio.file.Files.createDirectory(Files.java:700)
	at net.minecraft.util.FileUtil.findAvailableName(FileUtil.java:71)
	at net.minecraft.client.gui.screens.worldselection.WorldCreationUiState.findResultFolder(WorldCreationUiState.java:101)
	... 30 more

Note:

The game used to crash with this exception in the past, but it doesn’t seem to do that anymore in 1.21.11.

Attachments

Comments 5

Can confirm in 1.21.2 Pre-Release 2.

On Windows, this can be reproduced by doing the following:

  1. Right-click on the saves folder, then go to Properties and the Security tab.

  2. Click the Edit button, and then Users in the "Group or user names" box.

  3. In the "Permissions for Users" box, scroll down and check the Write checkbox under the Deny heading.

  4. Click OK, and then OK on the Properties window.

[media]

I have this same, but error code is -1073740791
My launcher version is b.3.2.21-2.0.16
I wanted to play minecraft 1.21.1, but i got crash after created world.

@unknown, your issue is tracked at MC-265594.

I can confirm, the error also happen for me when modifying permissions, it would be a good idea to say this./

 

"Unable to create a new world! (Protected directory.)

Please check the directory permissions of the saves directory and make sure you are allowed to edit it.

[LEARN MORE]     [OPEN SAVES]"

With "learn more" redirecting to an article talking about files protection and how to modify that, and "open saves" opening the saves directory.

 

Basically, the game should check at startup directories and files permissions and warn the user (for example in the top right corner with a yellow box sliding away after 7 seconds) about wrong permissions settings in the game's files.

@unknown, the report is already confirmed. Please check the 'Confirmation Status' field at the top of the report before leaving confirmation comments. The confirmations will either be set to 'Community Consensus', or 'Confirmed'.

[Mod] ManosSef

(Unassigned)

Community Consensus

Platform

Normal

Crash

1.21.1, 1.21.2 Pre-Release 1, 1.21.3, 1.21.4, 1.21.11

Retrieved