English 简体中文
A Easy Minecraft Launcher Core
- Offline Launcher
- Auto Completion
- Microsoft Oauth Launcher
- Authlib-injector Launcher
- Download Game
- Cross platform support
- Forge,Fabric Installer
go get -u github.com/mcoo/mlcgo@latest
import "github.com/mcoo/mlcgo"
mlcgo.NewCore().
OfflineLogin("enjoy").
SetJavaPath(`C:\Program Files\Java\jdk-17.0.2\bin\java.exe`).
SetMinecraftPath(`C:\Users\enjoy\AppData\Roaming\.minecraft`).
SetRAM(2048).
SetVersion("1.18").
Launch(context.Background())
Get launch status
ch := make(chan model.Step)
go func() {
for {
v := <-ch
switch v {
case model.StopStep:
log.Println("启动线程停止")
case model.StartLaunchStep:
log.Println("开始启动")
case model.AuthAccountStep:
log.Println("验证账号")
case model.GenerateCmdStep:
log.Println("生成启动命令")
case model.CompleteFilesStep:
log.Println("补全游戏文件")
case model.ExecCmdStep:
log.Println("执行启动命令")
}
}
}()
windows only
utils.FindJavaPath()
utils.GetLocalVersions()
versions, err := utils.GetAllMinecraftVersion()
if err != nil {
log.Errorln(err)
}
var c = NewCore().
SetJavaPath(`C:\Program Files\Java\jdk-17.0.2\bin\java.exe`).
SetMinecraftPath(`F:\mctest\.minecraft`).
SetRAM(2048).
OfflineLogin("enjoy").
Debug()
log.Println(c.DownloadGame(context.Background(), versions.Versions[4]))
c.Launch(context.Background())
You should keep the 8809 port free.
AuthlibLogin(url,email,password)
you must mark the link of this repository in your software.
- Use this project
- Modify this project
Thanks
教程/编写启动器 [WIKI]
gomclauncher [MIT]