AccountManager

Manage multiple accounts

Describes how to manage multiple accounts. Each account is identified by a unique value called identifier.

For more methods for Minecraft: Java Edition account, see JELoginHandler.

Get All Accounts

var accounts = loginHandler.AccountManager.GetAccounts();
foreach (var account in accounts)
{
    Console.WriteLine(account.Identifier);
}

Get Account by Identifier

var accounts = loginHandler.AccountManager.GetAccounts();
var account = accounts.GetAccount("identifier");

Get the Most Recent Account

var account = loginHandler.AccountManager.GetDefaultAccount();

Create New Empty Account

var account = loginHandler.AccountManager.NewAccount();

Clear All Accounts

loginHandler.AccountManager.ClearAccounts();

Save

loginHandler.AccountManager.SaveAccounts();

Last updated