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

Game crashes when attempting to create a new world if the saves folder is not writable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.1, 1.21.2 Pre-Release 1, 1.21.3, 1.21.4
    • None
    • Community Consensus
    • Crash
    • Normal
    • Platform

      If the game is unable to write inside the saves folder in the game's installation folder, the game crashes 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 crashes after ~3 seconds of preparing to create a world.
      4. If you do have some worlds, click on "Create New World."
        The game crashes after ~3 seconds of preparing to create a world.

      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 crashes.

      Stack trace:

      java.lang.RuntimeException: Could not create save folder
      	at net.minecraft.client.gui.screens.worldselection.WorldCreationUiState.java.lang.String findResultFolder(java.lang.String)(WorldCreationUiState.java:105)
      	at net.minecraft.client.gui.screens.worldselection.WorldCreationUiState.void <init>(java.nio.file.Path,net.minecraft.client.gui.screens.worldselection.WorldCreationContext,java.util.Optional,java.util.OptionalLong)(WorldCreationUiState.java:61)
      	at net.minecraft.client.gui.screens.worldselection.CreateWorldScreen.void <init>(net.minecraft.client.Minecraft,net.minecraft.client.gui.screens.Screen,net.minecraft.client.gui.screens.worldselection.WorldCreationContext,java.util.Optional,java.util.OptionalLong,net.minecraft.client.gui.screens.worldselection.CreateWorldCallback)(CreateWorldScreen.java:403)
      	at net.minecraft.client.gui.screens.worldselection.CreateWorldScreen.void openCreateWorldScreen(net.minecraft.client.Minecraft,net.minecraft.client.gui.screens.Screen,java.util.function.Function,net.minecraft.client.gui.screens.worldselection.WorldCreationContextMapper,net.minecraft.resources.ResourceKey,net.minecraft.client.gui.screens.worldselection.CreateWorldCallback)(CreateWorldScreen.java:374)
      	at net.minecraft.client.gui.screens.worldselection.CreateWorldScreen.void openFresh(net.minecraft.client.Minecraft,net.minecraft.client.gui.screens.Screen,net.minecraft.client.gui.screens.worldselection.CreateWorldCallback)(CreateWorldScreen.java:322)
      	at net.minecraft.client.gui.screens.worldselection.CreateWorldScreen.void openFresh(net.minecraft.client.Minecraft,net.minecraft.client.gui.screens.Screen)(CreateWorldScreen.java:309)
      	at net.minecraft.client.gui.screens.worldselection.SelectWorldScreen.void lambda$init$2(net.minecraft.client.gui.components.Button)(SelectWorldScreen.java:54)
      	at net.minecraft.client.gui.components.Button.void onPress()(Button.java:96)
      	at net.minecraft.client.gui.components.AbstractButton.void onClick(double,double)(AbstractButton.java:43)
      	at net.minecraft.client.gui.components.AbstractWidget.boolean mouseClicked(double,double,int)(AbstractWidget.java:141)
      	at net.minecraft.client.gui.components.AbstractWidget.void updateWidgetNarration(net.minecraft.client.gui.narration.NarrationElementOutput)(AbstractWidget.java:141)
      	at net.minecraft.client.gui.components.events.ContainerEventHandler.boolean mouseClicked(double,double,int)(ContainerEventHandler.java:38)
      	at net.minecraft.client.gui.components.events.ContainerEventHandler.void setFocused(net.minecraft.client.gui.components.events.GuiEventListener)(ContainerEventHandler.java:38)
      	at net.minecraft.client.MouseHandler.void onPress(long,int,int,int)(MouseHandler.java:114)
      	at net.minecraft.client.MouseHandler.void lambda$setup$2(long,int,int,int)(MouseHandler.java:215)
      	at net.minecraft.util.thread.BlockableEventLoop.void execute(java.lang.Runnable)(BlockableEventLoop.java:110)
      	at net.minecraft.client.MouseHandler.void lambda$setup$3(long,int,int,int)(MouseHandler.java:215)
      	at org.lwjgl.glfw.GLFWMouseButtonCallbackI.null callback(null)(GLFWMouseButtonCallbackI.java:43)
      	at org.lwjgl.system.JNI.null invokeV(null)(JNI.java)
      	at org.lwjgl.glfw.GLFW.null glfwWaitEventsTimeout(null)(GLFW.java:3509)
      	at com.mojang.blaze3d.systems.RenderSystem.void limitDisplayFPS(int)(RenderSystem.java:186)
      	at net.minecraft.client.Minecraft.void runTick(boolean)(Minecraft.java:1374)
      	at net.minecraft.client.Minecraft.void run()(Minecraft.java:934)
      	at net.minecraft.client.main.Main.void main(java.lang.String[])(Main.java:265)
      Caused by: java.nio.file.AccessDeniedException: \AppData\Roaming\.minecraft\installations\temp\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:699)
      	at net.minecraft.FileUtil.java.lang.String findAvailableName(java.nio.file.Path,java.lang.String,java.lang.String)(FileUtil.java:69)
      	at net.minecraft.client.gui.screens.worldselection.WorldCreationUiState.java.lang.String findResultFolder(java.lang.String)(WorldCreationUiState.java:103)
      	... 21 more
      

            Unassigned Unassigned
            ManosSef [Mod] ManosSef
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: