Legacy Mojang Account
Last updated
Last updated
This api has been deprecated since Mojang closed their legacy login api.
Use Microsoft Xbox Account instead.
For legacy mojang account,
MLogin
class provides methods to communicate with the Mojang auth server.
MLoginResponse
class represents login result. Methods in MLogin
class return this object.
MSession
class represents player's session data, containing Username
, UUID
, and AccessToken
.
Note: this document will help you to understand basic process of minecraft login.
The basic login process is:
PremiumLogin() in CmlLibCoreSample
Provides methods to communicate with the Mojang auth server and cache game session.
All methods return MLoginResult. You can get the result of login and result session from MLoginResponse
.
This class fully implments Yggdrasil authentication scheme.
Initialize object with default login cache file path. Default path : Path.Combine(MinecraftPath.GetOSDefaultPath(), "logintoken.json")
Initializes object and sets SessionCacheFilePath
.
Type: string
SessionCacheFilePath
Save session data to SessionCacheFilePath
if this true. Default value is true.
Returns session from cache file.
Login with Mojang email and password, with cached clientToken.
Login with Mojang email and password.
Checks validation of cached session and refresh session if it is not valid session.
Checks validation of the specified session and refresh session if it is not valid session.
Refresh session using cached session.
Refresh the specified session.
Validate session with cached session.
Validate the specified session.
Delete cached session file. This is the easiest way to logout.
Logout with cached session file.
Logout the specified session.
Logout using Mojang email and password.
Indicates the login response.
Type: bool
Returns true if Result
is MLoginResult.Success
.
Type: MLoginResponse
Login Result. If this property is not MLoginResult.Success
, then Session
will be null.
Type: Login and Sessions
Result session.
Type: string
Error message. It is set when the Result
property is not MLoginResult.Success
. This property can be empty or a null string when the login result is not successful.
Indicates the login result.
Login successful.
User doesn't purchase minecraft.