https://github.com/owen3h/mojang-lib
A modern wrapper for interacting with the Mojang API.
https://github.com/owen3h/mojang-lib
library minecraft mojang node wrapper
Last synced: about 1 year ago
JSON representation
A modern wrapper for interacting with the Mojang API.
- Host: GitHub
- URL: https://github.com/owen3h/mojang-lib
- Owner: Owen3H
- Created: 2023-06-22T15:05:21.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-11T16:20:27.000Z (over 1 year ago)
- Last Synced: 2025-04-03T11:04:14.856Z (over 1 year ago)
- Topics: library, minecraft, mojang, node, wrapper
- Language: TypeScript
- Homepage: https://npmjs.com/package/mojang-lib
- Size: 1.16 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# mojang-lib  
A modern wrapper for interacting with the Mojang API.
This library is a rewritten version of [minecraft-lib](https://github.com/Emrio/minecraft-js) in TypeScript.
The list of changes made are available [here](/CHANGES.md).
[Read the docs](https://owen3h.github.io/mojang-lib)
## Install
[Bun](https://bun.sh) - `bun add mojang-lib`\
[PNPM](https://pnpm.io/installation#using-npm) - `pnpm add mojang-lib`
## Usage
### ESM
```js
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
```js
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()
```