This package has been deprecated

Author message:

Please use @xmcl/user

@xmcl/mojang

1.0.3 • Public • Published

Mojang Module

npm version npm Build Status

This is a sub-module belong to minecraft-launcher-core module. You can still use this individually.

Usage

Mojang Account Info

Get personal info from mojang.

    import { MojangService } from "@xmcl/mojang";
    const accessToken: string;
    const info: Promise<MojangAccount> = MojangService.getAccountInfo(accessToken);

Validate if user have a validated IP address, and get & answer challenges to validate player's identity.

    import { MojangService } from "@xmcl/mojang";
    const accessToken: string;
    const validIp: boolean = await MojangService.checkLocation(accessToken);

    if (!validIp) {
        const challenges: MojangChallenge[] = await MojangService.getChallenges(accessToken);
        // after your answer the challenges
        const responses: MojangChallengeResponse[];
        await MojangService.responseChallenges(accessToken, responses);
    }

Package Sidebar

Install

npm i @xmcl/mojang

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

18.8 kB

Total Files

8

Last publish

Collaborators

  • ci010