1.0.2 • Published 7 months ago

@kye5000/mojang-api v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

Mojang-API

Mojang API Wrapper made in JavaScript. Everything is asynchronous and uses Promises.

npm (scoped) npm

Installation

npm install @kye5000/mojang-api

Usage

const mojang = require("@kye5000/mojang-api");

// Get UUID from username
mojang.GetUUIDFromUsername("JEB_").then((user) => {
  //Capitalization of name is fetched from Mojang API
  console.log(`${user.name}'s UUID is ${user.id}`);
});

// Get multiple UUIDs from usernames
mojang.GetMultipleUUIDFromUsername(["JEB_", "Notch"]).then((uuids) => {
  uuids.forEach((uuid) => {
    console.log(`${uuid.name}'s UUID is ${uuid.id}`);
  });
});

// Get user's profile from UUID (includes currently equipped skin and cape data)
mojang
  .GetProfileFromUUID("853c80ef3c3749fdaa49938b674adae6")
  .then((profile) => {
    console.log(JSON.stringify(profile));
  });

mojang.GetBlockedServers().then((resp) => {
  console.log(resp.length);
  console.log(resp);
});
1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago