mojira.dev
MCL-13020

Error game crashed

Howdy Mojang team!

After I reset my PC and then reinstalled Minecraft: Java Edition. And then I clicked on "Play" green button. I see "Preparing" green loading bar... then bam! Pop up saying: Error game crashed. An unexpected issue occurred and the game has crashed. We're sorry for the inconvenience. 

Yes, it was fine before reset my PC for other reasons.

My PC: 

Windows 10 Home 64-bit

AMD Radeon HD 6540

Java version: 8 Update 241 (build 1.8.0_241-b07)

I hope this is enough information you need?

Kindly how to solve this issue please?

Thanks,

MightyBeowulf

Linked issues

Attachments

Comments

migrated

Your PC username has '!' character. Java applications cannot run correctly under this directory. Either change game directory to a folder that does not contain '!', or create new user. (You cannot just rename the user, name of the folder will remain the same). And of course do not rename user directory manually.

violine1101

See MCL-774.

migrated

I have made a code snippet that tries to fix this issue:

import java.io.UncheckedIOException;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

public final class FixedClassLoader extends URLClassLoader {
    private static final String ENCODED_SEP;

    public FixedClassLoader(URL[] urls, ClassLoader parent) {
        super(rewriteUrls(urls), parent);
    }

    @Override
    protected void addURL(URL url) {
        super.addURL(rewriteUrl(url));
    }

    private static URL[] rewriteUrls(URL[] urls) {
        for (int i = 0, j = urls.length; i < j; i++) {
            urls[i] = rewriteUrl(urls[i]);
        }
        return urls;
    }

    private static URL rewriteUrl(URL url) {
        String protocol = url.getProtocol();
        if ("jar".equals(protocol) || "file".equals(protocol)) {
            try {
                return new URL(protocol, url.getHost(), url.getPort(), url.getFile().replace("!", ENCODED_SEP));
            } catch (MalformedURLException ex) {
                throw new UncheckedIOException(ex);
            }
        }
        return url;
    }

    static {
        try {
            ENCODED_SEP = URLEncoder.encode("!", StandardCharsets.UTF_8.name());
        } catch (UnsupportedEncodingException ex) {
            throw new ExceptionInInitializerError(ex);
        }
    }
}

Probably more cases shuold be handled, but this might be a fix.

migrated

(Unassigned)

Unconfirmed

Crashed, game

Retrieved