MCLC (Minecraft Launcher Core) is a NodeJS solution for launching modded and vanilla Minecraft without having to download and format everything yourself.
Basically a core for your Electron or script based launchers.
Getting support
I've created a Discord server for anyone who needs to get in contact with me or get help!
Installing
npm i minecraft-launcher-core
Standard Example
const{ Client, Authenticator }=require('minecraft-launcher-core');constlauncher=newClient();letopts={// For production launchers, I recommend not passing // the getAuth function through the authorization field and instead// handling authentication outside before you initialize// MCLC so you can handle auth based errors and validation!authorization: Authenticator.getAuth("username","password"),root: "./minecraft",version: {number: "1.14",type: "release"},memory: {max: "6G",min: "4G"}}launcher.launch(opts);launcher.on('debug',(e)=>console.log(e));launcher.on('data',(e)=>console.log(e));
Documentation
Client Functions
Function
Type
Description
launch
Promise
Launches the client with the specified options as a parameter. Returns child the process
launch
Parameter
Type
Description
Required
options.clientPackage
String
Path or URL to a zip file, which will be extracted to the root directory. (Not recommended for production use)
False
options.removePackage
Boolean
Option to remove the client package zip file after its finished extracting.
False
options.root
String
Path where you want the launcher to work in. C:/Users/user/AppData/Roaming/.mc
True
options.cache
String
Path where launcher files will be cached in. C:/Users/user/AppData/Roaming/.mc/cache
False
options.os
String
windows, osx or linux. MCLC will auto determine the OS if this field isn't provided.
False
options.customLaunchArgs
Array
Array of custom Minecraft arguments you want to add.
False
options.customArgs
Array
Array of custom Java arguments you want to add.
False
options.features
Array
Array of game argument feature flags. ex: is_demo_user or has_custom_resolution
False
options.version.number
String
Minecraft version that is going to be launched.
True
options.version.type
String
Any string. The actual Minecraft launcher uses release and snapshot.
True
options.version.custom
String
The name of the folder, jar file, and version json in the version folder.
False
options.memory.max
String
Max amount of memory being used by Minecraft.
True
options.memory.min
String
Min amount of memory being used by Minecraft.
True
options.forge
String
Path to Forge Jar. (Versions below 1.12.2 should be the "universal" jar while versions above 1.13 should be the "installer" jar)
False
options.javaPath
String
Path to the JRE executable file, will default to java if not entered.
False
options.quickPlay.type
String
The type of the quickPlay session. singleplayer, multiplayer, realms, legacy
False
options.quickPlay.identifier
String
The folder name, server address, or realm ID, relating to the specified type. legacy follows multiplayer format.
False
options.quickPlay.path
String
The specified path for logging (relative to the run directory)
False
options.proxy.host
String
Host url to the proxy, don't include the port.
False
options.proxy.port
String
Port of the host proxy, will default to 8080 if not entered.
False
options.proxy.username
String
Username for the proxy.
False
options.proxy.password
String
Password for the proxy.
False
options.timeout
Integer
Timeout on download requests.
False
options.window.width
String
Width of the Minecraft Client.
False
options.window.height
String
Height of the Minecraft Client.
False
options.window.fullscreen
Boolean
Fullscreen the Minecraft Client.
False
options.overrides
Object
Json object redefining paths for better customization. Example below.
False
IF YOU'RE NEW TO MCLC, LET IT HANDLE EVERYTHING! DO NOT USE OVERRIDES!
letopts={
otherOps...,overrides: {gameDirectory: '',// where the game process generates folders like saves and resource packs.minecraftJar: '',versionName: '',// replaces the value after the version flag.versionJson: '',directory: '',// where the Minecraft jar and version json are located.natives: '',// native directory path.assetRoot: '',assetIndex: '',libraryRoot: '',cwd: '',// working directory of the java process.detached: true,// whether or not the client is detached from the parent / launcher.classes: [],// all class paths are required if you use this.minArgs: 11,// The amount of launch arguments specified in the version file before it adds the default againmaxSockets: 2,// max sockets for downloadAsync.// The following is for launcher developers located in countries that have the Minecraft and Forge resource servers// blocked for what ever reason. They obviously need to mirror the formatting of the original JSONs / file structures.url: {meta: 'https://launchermeta.mojang.com',// List of versions.resource: 'https://resources.download.minecraft.net',// Minecraft resources.mavenForge: 'http://files.minecraftforge.net/maven/',// Forge resources.defaultRepoForge: 'https://libraries.minecraft.net/',// for Forge only, you need to redefine the library url// in the version json.fallbackMaven: 'https://search.maven.org/remotecontent?filepath='},// The following is options for which version of ForgeWrapper MCLC uses. This allows us to launch modern Forge.fw: {baseUrl: 'https://github.com/ZekerZhayard/ForgeWrapper/releases/download/',version: '1.5.1',sh1: '90104e9aaa8fbedf6c3d1f6d0b90cabce080b5a9',size: 29892,},logj4ConfigurationFile: ''}}
Notes
Custom
If you are loading up a client outside of vanilla Minecraft or Forge (Optifine and for an example), you'll need to download the needed files yourself if you don't provide downloads url downloads like Forge and Fabric. If no version jar is specified, MCLC will default back to the normal MC jar so mods like Fabric work.
Authentication (Deprecated)
MCLC's authenticator module does not support Microsoft authentication. You will need to use a library like MSMC. If you want to create your own solution, the following is the authorization JSON object format.
{access_token: '',client_token: '',uuid: '',name: '',user_properties: '{}',meta: {type: 'mojang'||'msa',demo: true||false,// Demo can also be specified by adding 'is_demo_user' to the options.feature array // properties only exists for specific Minecraft versions.xuid: '',clientId: ''}}
Authenticator Functions
getAuth
Parameter
Type
Description
Required
username
String
Email or username
True
password
String
Password for the Mojang account being used if online mode.
False
client_token
String
Client token that will be used. If one is not specified, one will be generated
False
validate
Parameter
Type
Description
Required
access_token
String
Token being checked if it can be used to login with (online mode).
True
client_token
String
Client token being checked to see if there was a change of client (online mode).
True
refreshAuth
Parameter
Type
Description
Required
access_token
String
Token being checked if it can be used to login with (online mode).
True
client_token
String
Token being checked if it's the same client that the access_token was created from.
True
invalidate
Parameter
Type
Description
Required
access_token
String
Token being checked if it can be used to login with (online mode).
True
client_token
String
Token being checked if it's the same client that the access_token was created from.
True
signOut
Parameter
Type
Description
Required
username
String
Username used to login with
True
password
String
Password used to login with
True
changeApiUrl
Parameter
Type
Description
Required
url
String
New URL that MCLC will make calls to authenticate the login.
True
Events
Event Name
Type
Description
arguments
Object
Emitted when launch arguments are set for the Minecraft Jar.
data
String
Emitted when information is returned from the Minecraft Process
close
Integer
Code number that is returned by the Minecraft Process
package-extract
null
Emitted when clientPackage finishes being extracted
download
String
Emitted when a file successfully downloads
download-status
Object
Emitted when data is received while downloading
debug
String
Emitted when functions occur, made to help debug if errors occur
progress
Object
Emitted when files are being downloaded in order. (Assets, Forge, Natives, Classes)
What should it look like running from console?
The pid is printed in console after the process is launched.
Contributors
These are the people that helped out that aren't listed here!
When running Minecraft Forge, libraries at com/typesafe/akka and com/typesafe/config are both being downloaded with the wrong URL. Instead of a jar being returned a 404 page is being returned:
<html><head><title>404 Not Found</title></head><bodybgcolor="white"><center><h1>404 Not Found</h1></center><hr><center>nginx</center></body></html>
I'd, at least, expect an error to be thrown instead of it silently failing.
I suspect this is due to some bug in the forge library download URL calculation. I'll go ahead and see if I can fix this, but that code looks decently complex so I'm not sure if I'll be able to fix it quickly.
Running Wireshark against a new 1.12.2 install of forge to see what URL it's using (thanks for using HTTP by default forge....)
OK, found out it's checking for a .jar.pack.xz first, if THAT'S not found then it'll fallback to the .jar, but it looks like .jar.pack.xz is the only one that exists for what we want. We probably want to handle that and extract the file.
Update: Turns out .pack.xz is some proprietary java bullshit, so working on figuring out how this will work. I don't really want to spend the next two weeks writing a node.js decompression package for this.
Another Update: unpack200 appears to be provided in the JRE, so verifying that bot linux and windows have this in their PATH, if so, I'll just child_process.spawn it.
Final update for the night: It is provided in the JRE, but for some reason it's not in PATH for windows, so going to figure that one out.
When I re-launch minecraft, forge does not load.
I am using vue-cli-plugin-electron-builder.
If I restart the application the forge is loaded.
MCLC v. 3.16.1
forge v. 14.23.5.2854
OS: Arch Linux (running with AwesomeWM)
CPU: Ryzen 5 2600 (included in the log)
GPU: GTX 1660 (included in the log)
MLC version: 3.16.7 (included in the screenshot)
NodeJS version: 16.8.0
Java version: 16.0.2 (OpenJDK) (included in the log)
Log: hs_err_pid6146.log
Greetings!
A friend and I were joking about some clients until I decided to code my own one. I just changed a few default settings etc for the beginning. Now I wanted to test launching the exported client via MLC. Unfortunately Java prints out a "fatal" error. I didn't find any solution online, so I try to ask here. Do you know if this is a error on my side or in MLC? How can I/we fix it?
Have a great day!
So, there's a new authentication system coming to Minecraft which may break the current login method.
Will investigate when changes are pushed, hoping nothing too major gets changed in the end.
As stated in https://wiki.vg/Authentication calls to the /authenticate endpoint should include a clientToken.
Currently, a clientToken is generated in the Authenticator.getAuth function, but it is not passed to the /authenticate endpoint, as a result you get an accessToken that has no associated clientToken.
Authenticator.validate does not send the clientToken, currently that is correct since the accessToken is generated without one.
Authenticator.refresh however does send the clientToken but it is ignored since the access token is generated without one.
same for Authenticator.invalidate
Hello!
I'm trying to launch minecraft on macos 11.3(Intel chip).
But I got a error:
---- Minecraft Crash Report ----
// Why did you do that?
Time: 2021/5/11 下午9:32
Description: Initializing game
java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.dylib
at org.lwjgl.system.Library.loadSystem(Library.java:147)
at org.lwjgl.system.Library.loadSystem(Library.java:67)
at org.lwjgl.system.Library.<clinit>(Library.java:50)
at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:97)
at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:61)
at cub.a(SourceFile:106)
at com.mojang.blaze3d.platform.GLX.initGlfw(SourceFile:191)
at cvi.av(SourceFile:459)
at cvi.b(SourceFile:395)
at net.minecraft.client.main.Main.main(SourceFile:154)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Client thread
Stacktrace:
at org.lwjgl.system.Library.loadSystem(Library.java:147)
at org.lwjgl.system.Library.loadSystem(Library.java:67)
at org.lwjgl.system.Library.<clinit>(Library.java:50)
at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:97)
at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:61)
at cub.a(SourceFile:106)
at com.mojang.blaze3d.platform.GLX.initGlfw(SourceFile:191)
at cvi.av(SourceFile:459)
-- Initialization --
Details:
Stacktrace:
at cvi.b(SourceFile:395)
at net.minecraft.client.main.Main.main(SourceFile:154)
-- System Details --
Details:
Minecraft Version: 1.14
Operating System: Mac OS X (x86_64) version 10.16
Java Version: 16, Azul Systems, Inc.
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), Azul Systems, Inc.
Memory: 4130782744 bytes (3939 MB) / 4294967296 bytes (4096 MB) up to 6442450944 bytes (6144 MB)
JVM Flags: 4 total; -XX:-UseAdaptiveSizePolicy -XX:-OmitStackTraceInFastThrow -Xmx6G -Xms4G
Launched Version: 1.14
LWJGL: 3.2.1 build 12
OpenGL: ~~ERROR~~ NoClassDefFoundError: Could not initialize class org.lwjgl.system.Library
GL Caps:
Using VBOs: Yes
Is Modded: Probably not. Jar signature remains and client brand is untouched.
Type: Client (map_client.txt)
Resource Packs:
Current Language: ~~ERROR~~ NullPointerException: Cannot invoke "dve.b()" because "this.ax" is null
CPU: <unknown>
I have already seen #35
I add os options in my script:
const{ Client, Authenticator }=require('minecraft-launcher-core');constlauncher=newClient();letopts={clientPackage: null,// For production launchers, I recommend not passing // the getAuth function through the authorization field and instead// handling authentication outside before you initialize// MCLC so you can handle auth based errors and validation!os: "osx",authorization: Authenticator.getAuth("xxx","xxx"),root: "./minecraft",version: {number: "1.14",type: "release"},memory: {max: "6G",min: "2G"}}launcher.launch(opts);launcher.on('debug',(e)=>console.log(e));launcher.on('data',(e)=>console.log(e));
Hello! Is there any way to open a custom client, such as versions/1.7.10-Optifine_HD_U_E7, or just a custom / modified client in general? I tried to open the game, but couldn't manage to find out how to do it the way I want it. I'd really appreciate if you could help me achieve this.
Hi, I have a pretty weird issue, after the my-launcher-core implementation to launch the game, I tried it and everything was working fine.
However, now it throws an error just after extracting client package.
It is the following:
"[8248:1225/203934.854:ERROR:gpu_init.cc(457)] Passthrough is not supported, GL is disabled, ANGLE is"
This is even more weird because I don't have the end of the sentence.
If you have an idea of why this is occuring, please tell me.
Thanks for your help
On first launch on a empty directory as the root dir, the game crashes immediately. On the second launch game crashes when a menu button is pressed (and the game complains about missing pack.mcmeta). Third launch, the game launches fine with no missing assets. After replicating this many times, it happens every time.
Hello! I just tried to use example from this repository and received exception after launch: Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path: [/Users/Tobishua/tests/minecraft/natives/1.12.2] at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2670) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:806) at java.base/java.lang.System.loadLibrary(System.java:1909) at org.lwjgl.Sys$1.run(Sys.java:73) at java.base/java.security.AccessController.doPrivileged(AccessController.java:312) at org.lwjgl.Sys.doLoadLibrary(Sys.java:66) at org.lwjgl.Sys.loadLibrary(Sys.java:95) at org.lwjgl.Sys.<clinit>(Sys.java:112) at bib.I(SourceFile:2825) at net.minecraft.client.main.Main.main(SourceFile:38)
Here is my test script (I've leave example code from this repository):
`const { Client, Authenticator } = require('minecraft-launcher-core');
const launcher = new Client();
let opts = {
clientPackage: null,
// For production launchers, I recommend not passing
// the getAuth function through the authorization field and instead
// handling authentication outside before you initialize
// MCLC so you can handle auth based errors and validation!
authorization: Authenticator.getAuth("---------", "---------"),
root: "./minecraft",
os: "osx",
version: {
number: "1.12.2",
type: "release"
},
memory: {
max: "4000",
min: "1000"
}
}
Using the sample code from NPM on a Mac creates this error when launching the game (1.14 vanilla).
The native files are being downloaded by the launcher into minecraft/natives/1.14
Have tried specifying the path using -Djava.library.path and also tried using chmod to make the files executable.
I have pasted the full error below:
// Why is it breaking :(
Time: 10/07/2021, 22:09
Description: Initializing game
java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.dylib
at org.lwjgl.system.Library.loadSystem(Library.java:147)
at org.lwjgl.system.Library.loadSystem(Library.java:67)
at org.lwjgl.system.Library.<clinit>(Library.java:50)
at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:97)
at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:61)
at cub.a(SourceFile:106)
at com.mojang.blaze3d.platform.GLX.initGlfw(SourceFile:191)
at cvi.av(SourceFile:459)
at cvi.b(SourceFile:395)
at net.minecraft.client.main.Main.main(SourceFile:154)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Client thread
Stacktrace:
at org.lwjgl.system.Library.loadSystem(Library.java:147)
at rg.lwjgl.system.Library.loadSystem(Library.java:67)
at org.lwjgl.system.Library.<clinit>(Library.java:50)
at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:97)
at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:61)
at cub.a(SourceFile:106)
at com.mojang.blaze3d.platform.GLX.initGlfw(SourceFile:191)
at cvi.av(SourceFile:459)
-- Initialization --
Details:
Stacktrace:
at cvi.b(SourceFile:395)
at net.minecraft.client.main.Main.main(SourceFile:154)
-- System Details --
Details:
Minecraft Version: 1.14
Operating System: Mac OS X (aarch64) version 11.4
Java Version: 16.0.1, Azul Systems, Inc.
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Azul Systems, Inc.
Memory: 3925952392 bytes (3744 MB) / 4294967296 bytes (4096 MB) up to 6442450944 bytes (6144 MB)
JVM Flags: 4 total; -XX:-UseAdaptiveSizePolicy -XX:-OmitStackTraceInFastThrow -Xmx6G -Xms4G
Launched Version: 1.14
LWJGL: 3.2.1 build 12
OpenGL: ~~ERROR~~ NoClassDefFoundError: Could not initialize class org.lwjgl.system.Library
GL Caps:
Using VBOs: Yes
Is Modded: Probably not. Jar signature remains and client brand is untouched.
Type: Client (map_client.txt)
Resource Packs:
Current Language: ~~ERROR~~ NullPointerException: Cannot invoke "dve.b()" because "this.ax" is null
CPU: <unknown>
#@!@# Game crashed! Crash report saved to: #@!@# /Users/tomaz/Haven/cablepost-test/minecraft/crash-reports/crash-2021-07-10_22.09.09-client.txt
My client tries to start, but the problem is that it starts minimized: https://www.vagina.guru/ti26RD . Also, when it starts, the client is completely black... :c can someone help me?
Even though we're at 2.7.0, we're still missing some things that would be really helpful!
Features I'm probably going to add are:
Checksum
This is needed, as there's no check to see if the files properly downloaded.
Better logging
Yep! As if now, there isn't a lot of logging and debugging events in the formatting functions. If a launcher wanted to log everything to a file, they should be able to do it!
Reformat debug messages
Make everything more clear.
This list will continue to grow as I see fit, please add any requests below if you have a cool idea!
Hello when i start my launcher, i have this probleme
[MCLC]: Detected Forge in options, getting dependencies
[MCLC]: Detected Forge installer, will treat as custom with ForgeWrapper
[MCLC]: ForgeWrapper did not produce a version file, using Vanilla
With the 3.11 update, I forgot to change a variable name when moving code around so if the check java function errors itll break. My apologies, will fix when I get home (12 hours).
Hi, I'm having problems installing the fabric in my customized launcher folder.
Opts:
Folder:
Error:
Error in text:
`21:28:35.389 [main] ERROR FabricLoader - Could not find valid game provider!
Exception in thread "main" java.lang.RuntimeException: Could not find valid game provider!
at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:96)
at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:28)
What ever changed, 1.6.4 seems to have broke on launch. Works fine on MCLC version 2.8.0, so I'm assuming the rewrite was the reason why it broke in the first place. Will look into when I can :)
Not sure why, but it seems 1.14.2 crashes due to missing natives. I'm going to assume I just didnt parse correctly, but I'll look into it when I get the chance
---- Minecraft Crash Report ----
// I just don't know what went wrong :(
Time: 7/23/19 10:20 AM
Description: Initializing game
java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.dylib
at org.lwjgl.system.Library.loadSystem(Library.java:147)
at org.lwjgl.system.Library.loadSystem(Library.java:67)
at org.lwjgl.system.Library.<clinit>(Library.java:50)
at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:97)
at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:61)
at cud.a(SourceFile:106)
at com.mojang.blaze3d.platform.GLX.initGlfw(SourceFile:191)
at cvk.au(SourceFile:459)
at cvk.b(SourceFile:395)
at net.minecraft.client.main.Main.main(SourceFile:154)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Client thread
Stacktrace:
at org.lwjgl.system.Library.loadSystem(Library.java:147)
at org.lwjgl.system.Library.loadSystem(Library.java:67)
at org.lwjgl.system.Library.<clinit>(Library.java:50)
at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:97)
at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:61)
at cud.a(SourceFile:106)
at com.mojang.blaze3d.platform.GLX.initGlfw(SourceFile:191)
at cvk.au(SourceFile:459)
-- Initialization --
Details:
Stacktrace:
at cvk.b(SourceFile:395)
at net.minecraft.client.main.Main.main(SourceFile:154)
-- System Details --
Details:
Minecraft Version: 1.14.2
Operating System: Mac OS X (x86_64) version 10.14.3
Java Version: 1.8.0_222, AdoptOpenJDK
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), AdoptOpenJDK
Memory: 885714168 bytes (844 MB) / 1029177344 bytes (981 MB) up to 6347554816 bytes (6053 MB)
JVM Flags: 4 total; -XX:-UseAdaptiveSizePolicy -XX:-OmitSta...
Specific installers uploaded by the Forge team are broken and ForgeWrapper will break when trying to launch with them. The only solution at the moment is waiting until ForgeWrapper is patched.
I creating a simple minecraft launcher.
And on start MCLC say me [MCLC]: Failed to load json files for ForgeWrapper, using Vanilla instead
Why it? Full logs; Config
Hey !
I cannot run my build because the module doesn't have a declaration file 😢
Plz help me 😭 i not found every where a solution for that
i tryied to install with @types and that's don't worked
i tryied too add a declaration file with (.d.ts) that's don't worked
i don(t found the issue of this problem snif
I made a small launcher for a few modpacks of mine, but when I tried to launch a modpack it got stuck at baking models.
It never gets stuck at the same model, and when it gets stuck the CPU just starts crunching something and I am not sure what.
Task Manager shows CPU usage at 90% or more. There is no crash log, and when I tried launching the modpack through an actual launcher that someone made it worked fine. It's in Electron, if that changes anything and the function is ran in the main.js file.
The version is 1.12.2, forge-1.12.2-14.23.5.2847-universal.jar.
My question is if there is any way of fixing this, because I ran out of ideas when the custom args did not help.
If you need the mod list, or if this is not the right place to ask just tell me.
Hello! I have recently found this project, but whenever I try to launch minecraft using it, I get this error:
[MCLC]: Parsed version from version manifest
[MCLC]: Set native path to C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\minecraft\natives\1.14
[MCLC]: Attempting to download Minecraft version jar
C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\node_modules\minecraft-launcher-core\components\authenticator.js:36
throw new Error("Validation error: " + response.statusMessage);
^
Error: Validation error: Forbidden
at Request._callback (C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\node_modules\minecraft-launcher-core\components\authenticator.js:36:23)
at Request.self.callback (C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\node_modules\request\request.js:185:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\node_modules\request\request.js:1161:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
Hello! Can you please tell me how to launch a client with mods in your minecraft-launcher-core? Tried and failed. I would be very grateful for the help.
Good afternoon again
I am testing a new update 2.0.0 and have discovered that some mods are taking off with full compliance with the versions
For example, when trying to run Forge's version with Optifine in the mods folder, it gives an error:
(It was tested on version 1.8.9 with forge-1.8.9-11.15.1.1722-universal and OptiFine_1.8.9_HD_U_I7)
$ node app
events.js:173
throw err; // Unhandled 'error' event
^
Error [ERR_UNHANDLED_ERROR]: Unhandled error. (Exception in thread "Thread-12" )
at EventEmitter.emit (events.js:171:17)
at Socket.minecraft.stderr.on (D:\Users\Maksimetny\Desktop\ggmc\node_modules\minecraft-launcher-core\components\launcher.js:70:4
9)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
I haven't found any more errors) Thanks for the update
Hi, I'm creating my own launcher and I'm using clientPackage to install from a website and put it in my launcher. The problem is that copy the file in the directory minecraft instead of versions and give me error. I fixed it changing the line 658 of handler.js:
new Zip(options.clientPackage).extractAllTo(options.root + "/versions", true)
I changed the extract route of root to versions and works fine.
As far as I understand, it is not removed to find a way to the directory of libraries
Created folders natives and versions (they contain files), libraries missing
File app.js
const launcher = require('minecraft-launcher-core');
launcher.authenticator.getAuth("Steve").then(auth => {
// Save the auth to a file so it can be used later on!
launcher.core({
authorization: auth,
clientPackage: null,
forge: null,
root: "/mnt/dev/launcher/mc",
os: "linux",
version: {
number: "1.13.2",
type: "release"
},
memory: {
max: "3000",
min: "1000"
}
});
});
Console Log
user@otherPC:/mnt/dev/launcher$ node app
mkdir: no paths given
mkdir: no paths given
mkdir: no paths given
mkdir: no paths given
... 45 times
mkdir: no paths given
internal/streams/legacy.js:59
throw er; // Unhandled stream error in pipe.
^
Error: ENOENT: no such file or directory, open '/mnt/dev/launcher/mc/libraries/com/mojang/patchy/1.1/patchy-1.1.jar'
function launch() {
const { Authenticator, Client} = require("minecraft-launcher-core");
const launcher = new Client();
const user = document.getElementById('username')
const pass = document.getElementById('password')
let opts = {
overrides: {
gameDirectory: "", // where the game process generates folders like saves and resource packs.
minecraftJar: "",
versionJson: "",
directory: "", // where the Minecraft jar and version json are located.
natives: "", // native directory path.
assetRoot: "",
libraryRoot: "",
cwd: "", // working directory of the java process.
detached: true, // whether or not the client is detached from the parent / launcher.
classes: [], // all class paths are required if you use this.
minArgs: 11, // The amount of launch arguments specified in the version file before it adds the default again
maxSockets: 2, // max sockets for downloadAsync.
// The following is for launcher developers located in countries that have the Minecraft and Forge resource servers
// blocked for what ever reason. They obviously need to mirror the formatting of the original JSONs / file structures.
url: {
meta: "https://launchermeta.mojang.com", // List of versions.
resource: "https://resources.download.minecraft.net", // Minecraft resources.
mavenForge: "http://files.minecraftforge.net/maven/", // Forge resources.
defaultRepoForge: "https://libraries.minecraft.net/", // for Forge only, you need to redefine the library url
// in the version json.
fallbackMaven: "https://search.maven.org/remotecontent?filepath="
}
}
}
launcher.launch(opts)
launcher.on('debug', (e) => console.log(e));
launcher.on('data', (e) => console.log(e));
}
This IS My Code
Down Is The Error Code
Uncaught SyntaxError: Unexpected token ...
at createScript (vm.js:74)
at Object.runInThisContext (vm.js:116)
at Module._compile (module.js:533)
at Object.Module._extensions..js (module.js:580)
at Module.load (module.js:503)
at tryModuleLoad (module.js:466)
at Function.Module._load (module.js:458)
at Module.require (module.js:513)
at require (internal/module.js:11)
at Object.<anonymous> (C:\Users\Nishant\Downloads\Electron App\node_modules\minecraft-launcher-core\index.js:2)