CmlLib.Core 2.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package CmlLib.Core --version 2.0.2                
NuGet\Install-Package CmlLib.Core -Version 2.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CmlLib.Core" Version="2.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CmlLib.Core --version 2.0.2                
#r "nuget: CmlLib.Core, 2.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CmlLib.Core as a Cake Addin
#addin nuget:?package=CmlLib.Core&version=2.0.2

// Install CmlLib.Core as a Cake Tool
#tool nuget:?package=CmlLib.Core&version=2.0.2                

CmlLib.Core

Minecraft Launcher Library

This library is minecraft launcher library for .NET Core and .NET Framework
Support all version, with Forge

한국어 README
한국어 문서는 업데이트가 느립니다.

What is different between CmlLib.Core and CmlLib?

CmlLib.Core is developed using .NET Core and support crossplatform. but CmlLib doesn't support it and will be deprecated.

Contacts

Email : ksi123456ab@naver.com
Discord : ksi123456ab#3719

License

MIT License
LICENSE

Crossplatform

.NET Core version support crossplatform. It is tested in Windows10, Ubuntu 18.04, macOS Catalina

Dependency

Newtonsoft.Json 12.0.3
SharpZipLib 1.2.0
LZMA-SDK 19.0.0

Functions

  • Online / Offline Login
  • Download game files in mojang file server
  • Launch All Versions (tested up to 1.15.2)
  • Launch Forge, Optifine or custom versions
  • Download minecraft java runtime in mojang file server
  • Launch with options (direct server connecting, screen resolution)
  • Support cross-platform

How To Use

If you want to learn more features of this library, go to wiki

Sample Code

Install

Install Nuget Package 'CmlLib.Core'
or download dll files in Releases and add reference to your project.

write this on the top of your source code:

 using CmlLib;
 using CmlLib.Core;

Sample

Login

 var login = new MLogin();
 var session = login.TryAutoLogin(); // 'session' is used in LaunchOption

 if (session.Result != MLoginResult.Success) // failed to auto login
 {
     var email = Console.ReadLine();
     var pw = Console.ReadLine();
     session = login.Authenticate(email, pw);

     if (session.Result != MLoginResult.Success)
          throw new Exception(session.Result.ToString()) // failed to login
 }

Offline Login

 var session = MSession.GetOfflineSession("USERNAME"); // 'session' is used in LaunchOption

Launch

 //var path = new Minecraft("your minecraft directory);
 var path = Minecraft.GetOSDefaultPath(); // mc directory

 var launcher = new CmlLib.CMLauncher(path);
 launcher.ProgressChanged += (s, e) =>
 {
      Console.WriteLine("{0}%", e.ProgressPercentage);
 };
 launcher.FileChanged += (e) =>
 {
      Console.WriteLine("[{0}] {1} - {2}/{3}", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount);
 };

 foreach (var item in launcher.ProfileInfos)
 {
     Console.WriteLine(item.Name);
 }

 var launchOption = new MLaunchOption
 {
     MaximumRamMb = 1024,
     Session = session, // Login Session. ex) Session = MSession.GetOfflineSession("hello")

     //LauncherName = "MyLauncher",
     //ScreenWidth = 1600,
     //ScreenHeigth = 900,
     //ServerIp = "mc.hypixel.net"
 };

 // launch forge
 //var process = launcher.Launch("1.12.2", "14.23.5.2768", launchOption);

 // launch vanila
 var process = launcher.Launch("1.15.2", launchOption);

 process.Start();

More Information

Go to wiki

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on CmlLib.Core:

Package Downloads
CmlLib.Core.Installer.Forge

Minecraft Forge Installer

CmlLib.Core.Auth.Microsoft.Uno

Minecraft login with Microsoft Xbox account migrated to work with the UnoPlatform

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.0.3 156 10/29/2024
4.0.2 889 7/25/2024
4.0.1 148 7/22/2024
4.0.0 417 7/7/2024
4.0.0-beta.2 135 6/9/2024
4.0.0-beta.1 126 3/29/2024
3.3.10 1,424 3/9/2024
3.3.9 618 2/1/2024
3.3.8 1,590 10/14/2023
3.3.7 2,914 6/26/2023
3.3.6 2,590 1/22/2023
3.3.5 7,973 12/20/2021
3.3.4 958 12/13/2021
3.3.3 2,289 10/4/2021
3.3.2 933 9/5/2021
3.3.1 1,359 6/22/2021
3.3.0 936 6/14/2021
3.2.0 878 6/2/2021
3.2.0-pre3 652 5/25/2021
3.2.0-pre1 654 4/8/2021
3.1.1 1,250 2/11/2021
3.1.0 958 12/27/2020
3.0.0 1,117 8/25/2020
3.0.0-alpha3 759 8/24/2020
3.0.0-alpha 861 7/3/2020
2.0.2 1,074 5/31/2020
2.0.1 976 5/31/2020
2.0.0 1,063 5/17/2020
0.2.0 1,086 4/13/2020
0.1.0 1,065 4/6/2020