mojang-lib
TypeScript icon, indicating that this package has built-in type declarations

1.13.1 • Public • Published

mojang-lib GitHub repo size npm bundle size

A modern wrapper for interacting with the Mojang API.

This library is a rewritten version of minecraft-lib in Typescript.
The list of changes made are available here.

Read the docs

Install

PNPM - pnpm add mojang-lib (Recommended)
NPM - npm i mojang-lib
Yarn - yarn add mojang-lib

Usage

ESM

import { players, servers } from "mojang-lib"

const server = await servers.get('play.earthmc.net')
console.log(server)

const player = await players.get('Owen3H')
console.log(player)

CommonJS

const MCAPI = require("mojang-lib")

async function runTest() {
  const server = await MCAPI.servers.get('play.earthmc.net')
  console.log(server)

  const player = await MCAPI.players.get('Owen3H')
  console.log(player)
}

runTest()

Package Sidebar

Install

npm i mojang-lib

Weekly Downloads

2

Version

1.13.1

License

MIT

Unpacked Size

250 kB

Total Files

79

Last publish

Collaborators

  • owen77stubbs