Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 days 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-19T02:56:59.000Z (30 days ago)
- Last Synced: 2024-11-04T12:20:43.861Z (13 days ago)
- Topics: library, minecraft, mojang, node, wrapper
- Language: TypeScript
- Homepage: https://npmjs.com/package/mojang-lib
- Size: 938 KB
- Stars: 2
- Watchers: 2
- 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 ![GitHub repo size](https://img.shields.io/github/repo-size/Owen3H/mojang-lib) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/mojang-lib?label=minzip)
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()
```