MicrosoftAccount

A premium account authenticated through a Microsoft account.

Authentication is delegated to MinecraftAuth, which implements the full Microsoft -> Xbox Live -> XSTS -> Minecraft token exchange. Every buildFrom* blocks the calling thread until the sign-in completes, so none of them may be called on the render thread.

Constructors

Link copied to clipboard
constructor()

Used for JSON deserialize.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var profile: GameProfile?
Link copied to clipboard
Link copied to clipboard

Known as soon as the account exists, unlike profile, which is only resolved once refresh has succeeded at least once.

Functions

Link copied to clipboard
fun isBanned(serverName: String): Boolean
Link copied to clipboard
Link copied to clipboard
fun login(): Pair<SessionWithService, YggdrasilAuthenticationService>

Authenticates the account and returns the session to hand to the game, along with the authentication service that resolves other players' profiles while it is active.

Link copied to clipboard
open override fun refresh()
Link copied to clipboard
fun toJson(): JsonObject
Link copied to clipboard
fun trackBan(ban: Ban)

Tracking bans is up to the caller - this only stores and expires them.

Link copied to clipboard
fun untrackBan(serverName: String)