classstableSource
@API(status = STABLE)
public final class User
    implements MinecraftAccount

Represents a logged-in user uuid is the unique identifier for the user (Mojang UUID) username is the display name of the user accessToken is the token used for authenticated requests serializedSession is the full session data as returned by the authentication server

Implemented interfaces
MinecraftAccount

Constructors

public User(
    UUID uuid,
    String username,
    String accessToken,
    JsonObject serializedSession
)
Parameters
uuidUUID
usernameString
accessTokenString
serializedSessionJsonObject

Methods

public String accessToken()
Returns
String
public boolean equals(Object o)
Parameters
oObject
Returns
boolean

Overrides Object.equals()

public MinecraftUUID getMinecraftUUID()
Returns
MinecraftUUIDMinecraftUUID, contains dashed and non dashed uuid

Implements MinecraftAccount.getMinecraftUUID()

public int hashCode()
Returns
int

Overrides Object.hashCode()

public JsonObject serializedSession()
Returns
JsonObject
public String toString()
Returns
String

Overrides Object.toString()

public String username()
Returns
StringThe display name of the account

Implements MinecraftAccount.username(), description copied from there

Used by

Methods of other types that accept or return User.