35 lines
651 B
Markdown
35 lines
651 B
Markdown
# Minecraft Utilities - Javascript Library
|
|
|
|
The JavaScript library for the Minecraft Utilities API.
|
|
|
|
## Usage
|
|
|
|
Install the package using npm:
|
|
|
|
```bash
|
|
npm install mcutils-library
|
|
```
|
|
|
|
Get player:
|
|
|
|
```javascript
|
|
import { getPlayer } from "mcutils-library";
|
|
|
|
const cachedPlayer = await getPlayer(playerId);
|
|
const { player } = cachedPlayer;
|
|
|
|
console.log(player);
|
|
```
|
|
|
|
Get Server:
|
|
|
|
```javascript
|
|
import { getServer } from "mcutils-library";
|
|
import JavaMinecraftServer from "mcutils-library/dist/types/server/javaServer";
|
|
|
|
const cachedServer = await getServer(ServerPlatform.Java, "hypixel.net");
|
|
const { server } = cachedServer;
|
|
|
|
console.log(server);
|
|
```
|